mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-02 22:00:19 +00:00
fix: use buildRetryCommand in spawn list footer to avoid truncated prompts (#819)
The "Rerun last" hint in `spawn list` was truncating prompts at 30 characters and appending "...", producing broken copy-paste commands. Now delegates to the existing buildRetryCommand helper which properly handles long prompts by suggesting --prompt-file instead of truncating. Agent: ux-engineer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3f28d5f29f
commit
5169350feb
2 changed files with 39 additions and 42 deletions
|
|
@ -941,14 +941,7 @@ async function showEmptyListMessage(agentFilter?: string, cloudFilter?: string):
|
|||
|
||||
function showListFooter(records: SpawnRecord[], agentFilter?: string, cloudFilter?: string): void {
|
||||
const latest = records[0];
|
||||
if (latest.prompt) {
|
||||
const shortPrompt = latest.prompt.length > 30 ? latest.prompt.slice(0, 30) + "..." : latest.prompt;
|
||||
// Escape double quotes so the suggested command is valid shell
|
||||
const safePrompt = shortPrompt.replace(/"/g, '\\"');
|
||||
console.log(`Rerun last: ${pc.cyan(`spawn ${latest.agent} ${latest.cloud} --prompt "${safePrompt}"`)}`);
|
||||
} else {
|
||||
console.log(`Rerun last: ${pc.cyan(`spawn ${latest.agent} ${latest.cloud}`)}`);
|
||||
}
|
||||
console.log(`Rerun last: ${pc.cyan(buildRetryCommand(latest.agent, latest.cloud, latest.prompt))}`);
|
||||
|
||||
if (agentFilter || cloudFilter) {
|
||||
const totalRecords = filterHistory();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue