suppress claude CLI unrecognized-model telemetry from reviewer stderr - #6239
Merged
Conversation
…e-2 reviewer stderr The claude-ollama / claude-ollama-tui providers redirect the real Anthropic claude binary's ANTHROPIC_BASE_URL at a local Ollama endpoint serving models like gemma3:27b. The binary's own SDK doesn't recognize those model names and logs a one-time-per-model `[claude-code:unrecognized_model]` warning to stderr — harmless telemetry, but confusing in reviewer output since it names "claude-code" while running under an Ollama-backed OpenCode/claude-ollama review stage. Filter it out at both places stderr is tagged and surfaced (agentCliSpawning.js and cos-runner/index.js).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[claude-code:unrecognized_model] {"model":"gemma3:27b",...}in their stderr tail. This is the real AnthropicclaudeCLI's own SDK telemetry, logged once per model whenever it doesn't recognize themodelfield — expected here because those providers redirect the binary'sANTHROPIC_BASE_URLat a local Ollama endpoint serving non-Anthropic models. It's harmless but confusing, since it names "claude-code" while running under an Ollama-backed review stage.server/lib/cliStderrNoise.js(isKnownCliStderrNoise) and wired it into both places stderr is tagged and surfaced for CoS agent runs:server/services/agentCliSpawning.jsandserver/cos-runner/index.js.Test plan
server/lib/cliStderrNoise.test.js(new) — unit tests for the predicateserver/services/agentCliSpawning.test.js— added a behavioral test confirming the noise line is dropped from the surfaced output tailserver/cos-runner/index.test.js— updated the parity assertion for the new guardservices/agentCliSpawning.test.js cos-runner/index.test.js lib/cliStderrNoise.test.js lib/index.test.js— 90 passed