← All needs

Claude agent host: native (Anthropic-auth) models report no context window, so the context usage indicator can't show usage

Does this issue occur when all extensions are disabled?: Yes. The cause is in the agent host itself (`out/vs/platform/agentHost/node/agentHostMain.js`), not in an extension. - VS Code Version: 1.144.0 (2c33b50b16c472efe58357d1d2a8a5414bc23fbf), x64 - OS Version: Windows 11 Pro 10.0.26200 - Harness: Claude agent host, authenticated natively with `CLAUDE_CODE_OAUTH_TOKEN` (Claude subscription), with `chat.agentHost.allowSignedOutWhenUsable` on. Not Copilot-routed. ## Steps to reproduce 1. Authenticate the Claude harness with Anthropic credentials (`CLAUDE_CODE_OAUTH_TOKEN` from `claude setup-token`). 2. In the Agents window, start a Claude session on a native model (for example Opus) and run a few turns. 3. Look for the context window usage indicator in the chat input (`chat.contextUsage.enabled` is on, the default). ## Expected The indicator shows how much of the model's context window the session uses, as it does for Copilot-routed models. ## Actual No percentage is shown for native Claude models. The per-response hover still reports token use (in this session, about 1M cached input tokens), so the usage is known; only the limit is missing. ## Cause The two model mappers in `agentHostMain.js` differ. The Copilot-routed one fills in the limits from the model list: ```js maxContextWindow: o.capabilities?.limits?.max_context_window_tokens, maxOutputTokens: o.capabilities?.limits?.max_output_tokens, maxPromptTokens: o.capabilities?.limits?.max_prompt_tokens, ``` The native (Anthropic-auth) one returns only: ```js { provider: i, id: o.value, name: o.displayName, supportsVision: !1, ...configSchema } ``` with no `maxContextWindow`, so the UI has no denominator for native models. Related: #331347 (the same native mapper hard-codes `supportsVision: false`) and #336797 (context limits lost for BYOK custom endpoints).