feat: add --list-models CLI flag and fix rendering artifacts#5
feat: add --list-models CLI flag and fix rendering artifacts#5matheustimbo wants to merge 2 commits into
Conversation
- Add --list-models option to fetch and display available Verboo models as JSON output, then exit - Remove model name width calculation from PromptInput that was causing rendering artifacts Co-Authored-By: Verboo Code <noreply@code.verboo.ai>
There was a problem hiding this comment.
Code Review
This pull request introduces a new CLI option --list-models to retrieve and display available Verboo models, alongside minor cleanup in PromptInput.tsx. The review feedback highlights a lack of error handling when fetching models, which could lead to unhandled promise rejections, and suggests wrapping the API call in a try-catch block.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const models = await fetchVerbooModels(tokens.accessToken); | ||
| if (!models || models.length === 0) { | ||
| process.stdout.write('[]\n'); | ||
| process.exit(0); | ||
| } | ||
| const output = models.map(m => ({ | ||
| id: m.id, | ||
| displayName: m.displayName || null, | ||
| contextWindow: m.contextWindow || null, | ||
| maxOutputTokens: m.maxOutputTokens || null, | ||
| description: m.description || null | ||
| })); | ||
| process.stdout.write(JSON.stringify(output, null, 2) + '\n'); | ||
| process.exit(0); | ||
| } |
There was a problem hiding this comment.
The model fetching logic lacks error handling. If fetchVerbooModels throws an error (or is refactored to propagate errors), it will result in an unhandled promise rejection. Wrapping this block in a try-catch ensures that any network or API errors are gracefully caught, logged to stderr, and the process exits with a non-zero status code (1).
try {
const models = await fetchVerbooModels(tokens.accessToken);
if (!models || models.length === 0) {
process.stdout.write('[]\\n');
process.exit(0);
}
const output = models.map(m => ({
id: m.id,
displayName: m.displayName || null,
contextWindow: m.contextWindow || null,
maxOutputTokens: m.maxOutputTokens || null,
description: m.description || null
}));
process.stdout.write(JSON.stringify(output, null, 2) + '\\n');
process.exit(0);
} catch (error) {
process.stderr.write(`Error: Failed to fetch models. ${errorMessage(error)}\\n`);
process.exit(1);
}
- Wrap --list-models handler in try-catch to prevent unhandled promise rejections from getClaudeAIOAuthTokensAsync or fetchVerbooModels - Remove orphaned comment in PromptInput that referenced non-existent code removal Co-Authored-By: Verboo Code <noreply@code.verboo.ai>
😴 PR inativoEste PR está sem atividade há 20 dias e tem um review comment sem resposta. Se ainda é relevante, atualize com o status atual ou responda ao review. worker:stale |
Summary
--list-modelsCLI option to fetch and display available Verboo models as JSON output, then exitTest plan
verboo --list-modelsoutputs JSON array of available modelsverboo --list-modelsexits with error when not authenticated🤖 Generated with Verboo Code