From 6c0e9116a54b4e88bd23081d0a77a3ce563f4f89 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:11:50 -0800 Subject: [PATCH] fix: show spawn history newest-first with rerun hint (#488) `spawn list` now shows records in reverse chronological order (newest first), matching the convention of git log, shell history, and docker ps. Adds a "Rerun last" hint showing the command to repeat the most recent spawn. Agent: ux-engineer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 --- cli/package.json | 2 +- cli/src/commands.ts | 5 +++++ cli/src/history.ts | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/package.json b/cli/package.json index 7af8ee54..ef27f656 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.2.44", + "version": "0.2.45", "type": "module", "bin": { "spawn": "cli.js" diff --git a/cli/src/commands.ts b/cli/src/commands.ts index 49f29212..4fe02cc2 100644 --- a/cli/src/commands.ts +++ b/cli/src/commands.ts @@ -770,6 +770,11 @@ export async function cmdList(agentFilter?: string, cloudFilter?: string): Promi } console.log(); + + // Show rerun hint for the most recent spawn (first record since list is newest-first) + const latest = records[0]; + console.log(`Rerun last: ${pc.cyan(`spawn ${latest.agent} ${latest.cloud}`)}`); + console.log(pc.dim(`${records.length} spawn${records.length !== 1 ? "s" : ""} recorded`)); console.log(pc.dim(`Filter: ${pc.cyan("spawn list -a ")} or ${pc.cyan("spawn list -c ")}`)); console.log(); diff --git a/cli/src/history.ts b/cli/src/history.ts index 119eab96..8cadb035 100644 --- a/cli/src/history.ts +++ b/cli/src/history.ts @@ -52,5 +52,7 @@ export function filterHistory( const lower = cloudFilter.toLowerCase(); records = records.filter((r) => r.cloud.toLowerCase() === lower); } + // Show newest first (reverse chronological order) + records.reverse(); return records; }