Repository navigation
Feat #875 #884: Doctor reports server companion mode and unpriced models - #904
Open
chrisdhaan wants to merge 1 commit into
Open
chrisdhaan wants to merge 1 commit into
chrisdhaan wants to merge 1 commit into
Conversation
#875: stdio MCP servers record their resolved companion mode and source in the existing active-<sessionId>.meta.json sidecar; doctor reads it from live instances and labels the shell-derived value when none is running. nr_observe_get_config now includes companionModeSource. #884: doctor names models from the last 7 days of session summaries (unpricedByModel) that still cannot be priced. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was
linked to
issues
Oct 19, 2026
chrisdhaan
marked this pull request as ready for review
October 20, 2026 17:29
This branch has not been deployed
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.
Why
preflight doctorresolved companion mode from the shell it ran in, but the MCP server Claude Code spawns often gets its OTel variables from Claude Code settings. In a managed rollout doctor could sayfalsewhile the server ran astrue, and both reportedok. Doctor also had no way to show which models Preflight cannot price, which left an admin to query each machine'snr_observe_get_cost_breakdown.Scope
LocalStore.writeHeartbeat()stores the server's resolvedcompanionMode({ value, source }) in the existingactive-<sessionId>.meta.jsonsidecar.listActiveStdioInstances()returns it, andnullfor sidecars from older builds.McpServerConfig.companionModeSourceandConfigSummary.companionModeSourcecarry the source.nr_observe_get_confignow returns it.checkCompanionModeinsrc/install/diagnostics.tsreports each live server's value and source, and says when the shell would resolve differently. With no server running, it says the value comes from the shell.checkUnpricedModelsreads the last 7 days of session summaries'unpricedByModel, re-resolves each model withresolvePricing(), and warns on the ones still unpriced. It points toaliasesincustomPricingFile.Tradeoffs
The
--localinstance registry (local-instances/) was rejected as the data source. It only lists--localprocesses, andpreflight local --cleankills any it treats as orphaned, so registering stdio servers there would get them killed. The heartbeat sidecar already exists for every stdio server.Blast Radius
Doctor output and one optional field in a per-process sidecar file. Old sidecars still parse. No change to cost or event data.
Verification
npm test: 8866 passed, 0 failed.npm run lintandnpm run format:checkclean (via the pre-commit hook).dist/index.js doctoragainst an isolated HOME with a live PID's sidecar and a seeded session. It printedRunning MCP server resolved true (source: detected Claude Code OTel export, PID …). This shell would resolve false (source: default).andacme-gateway-x (3 calls)under Unpriced models.