Repository navigation
fix(github-copilot): honor live prompt token limits - #103275
Merged
Merged
Conversation
Contributor
|
Land-ready maintainer pass complete.
Merging with contributor credit preserved. Thanks @saju01. |
Contributor
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 10, 2026
* fix(github-copilot): honor live prompt token limits * fix(github-copilot): align prompt token budgets * fix(github-copilot): align prompt token budgets --------- Co-authored-by: saju01 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
This was referenced Oct 8, 2026
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.
What Problem This Solves
GitHub Copilot's live
/modelsresponse advertises native context, effective prompt, and output limits separately. OpenClaw declaredmax_prompt_tokensin the response type but discarded it while mapping models, so runtime compaction could target the larger native window rather than the usable prompt ceiling. The known GPT-5.5 offline fallback had the same mismatch: 400k native context but a 272k prompt ceiling.Why This Change Was Made
The GitHub Copilot plugin is the metadata owner, and core already uses
contextTokensfor the effective input/compaction budget. This change therefore:max_prompt_tokensvalue tocontextTokenswithout changingcontextWindowormaxTokens;contextTokens: 272000; andMicrosoft's Copilot implementation and GitHub's generated SDK model prompt/input, output/completion, and native-window limits independently. Deriving one from the others or moving Copilot policy into core would conflate those contracts.
User Impact
Fresh and offline GitHub Copilot sessions compact against the provider-advertised usable prompt capacity instead of the full native window. This prevents over-budget prompts while preserving the native context and output limits shown in model metadata. Authentication, entitlements, routing, and network behavior are unchanged.
Release-note context: fix GitHub Copilot prompt budgeting by carrying live and static effective prompt limits separately from native context and output capacity. Thanks @saju01.
Evidence
be4cdaa0baf89d0cad1ccd74f629d43f70165025passed full hosted CI on rerun: https://github.com/openclaw/openclaw/actions/runs/29070358849OPENCLAW_TESTBOX=1 scripts/pr prepare-run 103275passed against that exact head.No dedicated credentialed Copilot
/modelstoken was available for this maintainer pass. The contributor reported live entitled-account observations; deterministic mapping tests plus the primary contracts are the durable proof used for landing.