mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
fix(coding-agent): suppress informational output in non-interactive modes
In -p, --mode json, and --mode rpc modes, don't print informational messages like 'Loaded project context from:' or model restore messages. Only the actual output should be printed.
This commit is contained in:
parent
b49a017c55
commit
56450a4f19
2 changed files with 11 additions and 227 deletions
234
package-lock.json
generated
234
package-lock.json
generated
|
|
@ -3850,8 +3850,8 @@
|
|||
"version": "0.9.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-ai": "^0.8.5",
|
||||
"@mariozechner/pi-tui": "^0.8.5"
|
||||
"@mariozechner/pi-ai": "^0.9.0",
|
||||
"@mariozechner/pi-tui": "^0.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.3.0",
|
||||
|
|
@ -3862,42 +3862,6 @@
|
|||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/agent/node_modules/@mariozechner/pi-ai": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-ai/-/pi-ai-0.8.5.tgz",
|
||||
"integrity": "sha512-13ZYEaS/V5EFoISPyB5oZomSsJSCVhTKUaUeiwXlzBzpbLOaBOfOwQmfQ7hRniE2S0OlQFFp4af1ljMhnrsQzQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.61.0",
|
||||
"@google/genai": "^1.30.0",
|
||||
"@sinclair/typebox": "^0.34.41",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-formats": "^3.0.1",
|
||||
"chalk": "^5.6.2",
|
||||
"openai": "5.21.0",
|
||||
"partial-json": "^0.1.7",
|
||||
"zod-to-json-schema": "^3.24.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/agent/node_modules/@mariozechner/pi-tui": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-tui/-/pi-tui-0.8.5.tgz",
|
||||
"integrity": "sha512-mpwsXuVBTc5Ls1kKBigA5KabpsiqP53NQYshFWayYTwYxQRE7bfXocYd3Glsrv7aCMs7SlgB7LZYVjqzz8e3fQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime-types": "^2.1.4",
|
||||
"chalk": "^5.5.0",
|
||||
"marked": "^15.0.12",
|
||||
"mime-types": "^3.0.1",
|
||||
"string-width": "^8.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/agent/node_modules/@types/node": {
|
||||
"version": "24.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz",
|
||||
|
|
@ -3908,22 +3872,6 @@
|
|||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"packages/agent/node_modules/string-width": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz",
|
||||
"integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"get-east-asian-width": "^1.3.0",
|
||||
"strip-ansi": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages/agent/node_modules/undici-types": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
|
|
@ -3977,9 +3925,9 @@
|
|||
"version": "0.9.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-agent": "^0.8.5",
|
||||
"@mariozechner/pi-ai": "^0.8.5",
|
||||
"@mariozechner/pi-tui": "^0.8.5",
|
||||
"@mariozechner/pi-agent": "^0.9.0",
|
||||
"@mariozechner/pi-ai": "^0.9.0",
|
||||
"@mariozechner/pi-tui": "^0.9.0",
|
||||
"chalk": "^5.5.0",
|
||||
"diff": "^8.0.2",
|
||||
"glob": "^11.0.3"
|
||||
|
|
@ -3997,55 +3945,6 @@
|
|||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/coding-agent/node_modules/@mariozechner/pi-agent": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-agent/-/pi-agent-0.8.5.tgz",
|
||||
"integrity": "sha512-HdzmOKf1NRi+edM6DNOpXYCooxTR2n9NhRKlMyDy87fwmK6mGIl99C8+vYS5x/kLrNBKBnfjVH2B2FwftiUthA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-ai": "^0.8.5",
|
||||
"@mariozechner/pi-tui": "^0.8.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/coding-agent/node_modules/@mariozechner/pi-ai": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-ai/-/pi-ai-0.8.5.tgz",
|
||||
"integrity": "sha512-13ZYEaS/V5EFoISPyB5oZomSsJSCVhTKUaUeiwXlzBzpbLOaBOfOwQmfQ7hRniE2S0OlQFFp4af1ljMhnrsQzQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.61.0",
|
||||
"@google/genai": "^1.30.0",
|
||||
"@sinclair/typebox": "^0.34.41",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-formats": "^3.0.1",
|
||||
"chalk": "^5.6.2",
|
||||
"openai": "5.21.0",
|
||||
"partial-json": "^0.1.7",
|
||||
"zod-to-json-schema": "^3.24.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/coding-agent/node_modules/@mariozechner/pi-tui": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-tui/-/pi-tui-0.8.5.tgz",
|
||||
"integrity": "sha512-mpwsXuVBTc5Ls1kKBigA5KabpsiqP53NQYshFWayYTwYxQRE7bfXocYd3Glsrv7aCMs7SlgB7LZYVjqzz8e3fQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime-types": "^2.1.4",
|
||||
"chalk": "^5.5.0",
|
||||
"marked": "^15.0.12",
|
||||
"mime-types": "^3.0.1",
|
||||
"string-width": "^8.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/coding-agent/node_modules/@types/node": {
|
||||
"version": "24.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz",
|
||||
|
|
@ -4084,7 +3983,7 @@
|
|||
"version": "0.9.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-agent": "^0.8.5",
|
||||
"@mariozechner/pi-agent": "^0.9.0",
|
||||
"chalk": "^5.5.0"
|
||||
},
|
||||
"bin": {
|
||||
|
|
@ -4095,71 +3994,6 @@
|
|||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/pods/node_modules/@mariozechner/pi-agent": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-agent/-/pi-agent-0.8.5.tgz",
|
||||
"integrity": "sha512-HdzmOKf1NRi+edM6DNOpXYCooxTR2n9NhRKlMyDy87fwmK6mGIl99C8+vYS5x/kLrNBKBnfjVH2B2FwftiUthA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-ai": "^0.8.5",
|
||||
"@mariozechner/pi-tui": "^0.8.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/pods/node_modules/@mariozechner/pi-ai": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-ai/-/pi-ai-0.8.5.tgz",
|
||||
"integrity": "sha512-13ZYEaS/V5EFoISPyB5oZomSsJSCVhTKUaUeiwXlzBzpbLOaBOfOwQmfQ7hRniE2S0OlQFFp4af1ljMhnrsQzQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.61.0",
|
||||
"@google/genai": "^1.30.0",
|
||||
"@sinclair/typebox": "^0.34.41",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-formats": "^3.0.1",
|
||||
"chalk": "^5.6.2",
|
||||
"openai": "5.21.0",
|
||||
"partial-json": "^0.1.7",
|
||||
"zod-to-json-schema": "^3.24.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/pods/node_modules/@mariozechner/pi-tui": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-tui/-/pi-tui-0.8.5.tgz",
|
||||
"integrity": "sha512-mpwsXuVBTc5Ls1kKBigA5KabpsiqP53NQYshFWayYTwYxQRE7bfXocYd3Glsrv7aCMs7SlgB7LZYVjqzz8e3fQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime-types": "^2.1.4",
|
||||
"chalk": "^5.5.0",
|
||||
"marked": "^15.0.12",
|
||||
"mime-types": "^3.0.1",
|
||||
"string-width": "^8.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/pods/node_modules/string-width": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz",
|
||||
"integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"get-east-asian-width": "^1.3.0",
|
||||
"strip-ansi": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages/proxy": {
|
||||
"name": "@mariozechner/pi-proxy",
|
||||
"version": "0.9.0",
|
||||
|
|
@ -4217,8 +4051,8 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lmstudio/sdk": "^1.5.0",
|
||||
"@mariozechner/pi-ai": "^0.8.5",
|
||||
"@mariozechner/pi-tui": "^0.8.5",
|
||||
"@mariozechner/pi-ai": "^0.9.0",
|
||||
"@mariozechner/pi-tui": "^0.9.0",
|
||||
"docx-preview": "^0.3.7",
|
||||
"jszip": "^3.10.1",
|
||||
"lucide": "^0.544.0",
|
||||
|
|
@ -4236,58 +4070,6 @@
|
|||
"@mariozechner/mini-lit": "^0.2.0",
|
||||
"lit": "^3.3.1"
|
||||
}
|
||||
},
|
||||
"packages/web-ui/node_modules/@mariozechner/pi-ai": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-ai/-/pi-ai-0.8.5.tgz",
|
||||
"integrity": "sha512-13ZYEaS/V5EFoISPyB5oZomSsJSCVhTKUaUeiwXlzBzpbLOaBOfOwQmfQ7hRniE2S0OlQFFp4af1ljMhnrsQzQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.61.0",
|
||||
"@google/genai": "^1.30.0",
|
||||
"@sinclair/typebox": "^0.34.41",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-formats": "^3.0.1",
|
||||
"chalk": "^5.6.2",
|
||||
"openai": "5.21.0",
|
||||
"partial-json": "^0.1.7",
|
||||
"zod-to-json-schema": "^3.24.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/web-ui/node_modules/@mariozechner/pi-tui": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/pi-tui/-/pi-tui-0.8.5.tgz",
|
||||
"integrity": "sha512-mpwsXuVBTc5Ls1kKBigA5KabpsiqP53NQYshFWayYTwYxQRE7bfXocYd3Glsrv7aCMs7SlgB7LZYVjqzz8e3fQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime-types": "^2.1.4",
|
||||
"chalk": "^5.5.0",
|
||||
"marked": "^15.0.12",
|
||||
"mime-types": "^3.0.1",
|
||||
"string-width": "^8.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"packages/web-ui/node_modules/string-width": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz",
|
||||
"integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"get-east-asian-width": "^1.3.0",
|
||||
"strip-ansi": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -745,7 +745,9 @@ export async function main(args: string[]) {
|
|||
// Having initial messages doesn't make it non-interactive anymore
|
||||
const isInteractive = !parsed.print && parsed.mode === undefined;
|
||||
const mode = parsed.mode || "text";
|
||||
const shouldPrintMessages = isInteractive || mode === "text";
|
||||
// Only print informational messages in interactive mode
|
||||
// Non-interactive modes (-p, --mode json, --mode rpc) should be silent except for output
|
||||
const shouldPrintMessages = isInteractive;
|
||||
|
||||
// Non-interactive mode: fail early if no model available
|
||||
if (!isInteractive && !initialModel) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue