Use max output context for output buffer#322648
Conversation
pwang347
commented
Jun 24, 2026
|
Trying to think this through. If the model is a 64k context model and the max output tokens is 32k then if we have a prompt of 40k the buffer should only be rendered as 24k not 32k as otherwise the buffer would exceed max context. If that makes sense? |
To my knowledge the clamping already happens in Let me see if I can reproduce it though! |
There was a problem hiding this comment.
Pull request overview
This PR updates the chat context-usage UI to compute the “reserved for response” band from the currently selected model’s max output tokens (instead of last-response usage data), and adds instrumentation to help diagnose model-configuration restore behavior during session reloads.
Changes:
- Derive the output reserve band in the context usage widget from the selected model’s
maxOutputTokens. - Add
ILogServiceplumbing and troubleshooting logs aroundrestoreModelConfiguration. - Thread
ILogServiceintoChatModelConfigurationStoreconstruction fromChatInputPart.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.ts | Uses selected model metadata (maxOutputTokens) to compute remaining reserved output band. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationStore.ts | Adds ILogService dependency and logs to diagnose schema availability/filtering during configuration restore. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Passes ILogService into ChatModelConfigurationStore. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
