Skip to content

Feat #875 #884: Doctor reports server companion mode and unpriced models - #904

Open
chrisdhaan wants to merge 1 commit into
mainfrom
feat/doctor-setup-857-875-884
Open

chrisdhaan wants to merge 1 commit into
mainfrom
feat/doctor-setup-857-875-884

Conversation

@chrisdhaan

@chrisdhaan chrisdhaan commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Why

preflight doctor resolved 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 say false while the server ran as true, and both reported ok. Doctor also had no way to show which models Preflight cannot price, which left an admin to query each machine's nr_observe_get_cost_breakdown.

Scope

  • LocalStore.writeHeartbeat() stores the server's resolved companionMode ({ value, source }) in the existing active-<sessionId>.meta.json sidecar. listActiveStdioInstances() returns it, and null for sidecars from older builds.
  • McpServerConfig.companionModeSource and ConfigSummary.companionModeSource carry the source. nr_observe_get_config now returns it.
  • checkCompanionMode in src/install/diagnostics.ts reports 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.
  • New checkUnpricedModels reads the last 7 days of session summaries' unpricedByModel, re-resolves each model with resolvePricing(), and warns on the ones still unpriced. It points to aliases in customPricingFile.

Tradeoffs

The --local instance registry (local-instances/) was rejected as the data source. It only lists --local processes, and preflight local --clean kills 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 lint and npm run format:check clean (via the pre-commit hook).
  • Ran the built dist/index.js doctor against an isolated HOME with a live PID's sidecar and a seeded session. It printed Running MCP server resolved true (source: detected Claude Code OTel export, PID …). This shell would resolve false (source: default). and acme-gateway-x (3 calls) under Unpriced models.

#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 branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

1 participant