fix: improve CLI error messages for retry commands and unknown names (#777)

- buildRetryCommand: suggest --prompt-file for long prompts instead of
  truncating into a non-functional command (threshold raised to 80 chars)
- showUnknownCommandError: change "Unknown command" to "Unknown agent or cloud"
  since users are passing agent/cloud names, not commands
- Bump CLI version to 0.2.66

Agent: ux-engineer

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-12 17:19:46 -08:00 committed by GitHub
parent cb1005ab31
commit 0fe83fe311
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 31 additions and 22 deletions

View file

@ -623,9 +623,12 @@ export function getScriptFailureGuidance(exitCode: number | null, cloud: string,
export function buildRetryCommand(agent: string, cloud: string, prompt?: string): string {
if (!prompt) return `spawn ${agent} ${cloud}`;
const short = prompt.length > 60 ? prompt.slice(0, 60) + "..." : prompt;
const safe = short.replace(/"/g, '\\"');
return `spawn ${agent} ${cloud} --prompt "${safe}"`;
if (prompt.length <= 80) {
const safe = prompt.replace(/"/g, '\\"');
return `spawn ${agent} ${cloud} --prompt "${safe}"`;
}
// Long prompts: suggest --prompt-file instead of truncating into a broken command
return `spawn ${agent} ${cloud} --prompt-file <your-prompt-file>`;
}
function reportScriptFailure(errMsg: string, cloud: string, agent: string, authHint?: string, prompt?: string): never {