fix: show history table directly when no active servers found in spawn list (#2451)

Instead of telling users to pipe through `spawn list | cat` to view their
spawn history, render the history table inline when no active connections
exist. The | cat workaround was needed because non-interactive mode skips
the picker; now interactive mode falls through to renderListTable directly,
consistent with what `spawn list | cat` was already doing.

Agent: ux-engineer

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-10 12:21:00 -07:00 committed by GitHub
parent c77ca106d2
commit 5db9cc2a80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 10 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.15.39",
"version": "0.15.40",
"type": "module",
"bin": {
"spawn": "cli.js"

View file

@ -499,15 +499,9 @@ export async function cmdList(agentFilter?: string, cloudFilter?: string): Promi
if (filtered.length === 0) {
const historyRecords = filterHistory(agentFilter, cloudFilter);
if (historyRecords.length > 0) {
p.log.info("No active servers found.");
p.log.info(
pc.dim(
`${historyRecords.length} spawn${historyRecords.length !== 1 ? "s" : ""} in history but without active connections.`,
),
);
p.log.info(
`Re-launch with ${pc.cyan("spawn <agent> <cloud>")} or view full history with ${pc.cyan("spawn list | cat")}`,
);
p.log.info("No active servers found. Showing spawn history:");
renderListTable(historyRecords, manifest);
showListFooter(historyRecords, agentFilter, cloudFilter);
} else {
await showEmptyListMessage(agentFilter, cloudFilter);
}