mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-01 21:30:21 +00:00
fix(update-check): redirect install script stdout to stderr in --output json mode (#2919)
When --output json is requested, the auto-update install script was running with stdio: "inherit", causing [spawn] install messages to pollute stdout before the JSON result, breaking JSON consumers. Fix: - Pre-scan process.argv for --output json before checkForUpdates() is called in index.ts (formal flag parsing happens later at line 944) - Pass jsonOutput flag through checkForUpdates() -> performAutoUpdate() - When jsonOutput=true, use stdio: ["pipe", stderr, stderr] for the install script execution so all output goes to stderr only - Set SPAWN_CLI_UPDATED=1 env var on re-exec so JSON consumers can detect the update via cli_updated: true in SpawnResult - Add cli_updated?: boolean to SpawnResult interface in commands/run.ts - Add tests covering both json and non-json stdio behavior Fixes #2918 Agent: issue-fixer 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:
parent
c1e6fb76f9
commit
e0db833307
5 changed files with 103 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.25.21",
|
||||
"version": "0.25.22",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue