Skip to content

fix(github-copilot): honor live prompt token limits - #103275

Merged
steipete merged 4 commits into
openclaw:mainfrom
saju01:fix/copilot-live-prompt-context
Jul 10, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
saju01:fix/copilot-live-prompt-context

Conversation

@saju01

@saju01 saju01 commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

GitHub Copilot's live /models response advertises native context, effective prompt, and output limits separately. OpenClaw declared max_prompt_tokens in 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 contextTokens for the effective input/compaction budget. This change therefore:

  • maps a positive safe max_prompt_tokens value to contextTokens without changing contextWindow or maxTokens;
  • omits malformed or absent prompt limits rather than inventing a sentinel;
  • aligns the static GPT-5.5 override and plugin manifest at contextTokens: 272000; and
  • keeps live account entitlements and offline discovery on the same contract.

Microsoft'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

No dedicated credentialed Copilot /models token 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.

@openclaw-barnacle openclaw-barnacle Bot added extensions: github-copilot size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 10, 2026
@steipete steipete self-assigned this Jul 10, 2026
@steipete
steipete requested a review from a team as a code owner July 10, 2026 04:42
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: openai extensions: deepseek extensions: memory-wiki extensions: codex plugin: google-meet labels Jul 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: openai extensions: deepseek extensions: memory-wiki extensions: codex plugin: google-meet extensions: google extensions: xai extensions: clawrouter Extension: clawrouter size: XL triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 10, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready maintainer pass complete.

  • Preserved Copilot's separate prompt, output, and native-window contracts in live discovery, then aligned the known GPT-5.5 static fallback and manifest at the 272k prompt ceiling.
  • Extended existing catalog tests for static propagation, missing and malformed prompt limits, and absence on unrelated rows; no duplicate agent harness was added.
  • Exact prepared head be4cdaa0baf89d0cad1ccd74f629d43f70165025 passed full hosted CI on attempt 2: https://github.com/openclaw/openclaw/actions/runs/29070358849
  • Fresh autoreview, review artifacts, primary Microsoft/GitHub contract inspection, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 103275 passed. Attempt 1 had one unrelated flaky test/scripts/ui.test.ts SIGHUP assertion; its failed shard passed unchanged on rerun.
  • No credentialed Copilot /models token was available; deterministic mapping coverage and primary contracts are the durable proof.

Merging with contributor credit preserved. Thanks @saju01.

@steipete
steipete merged commit f0534c5 into openclaw:main Jul 10, 2026
166 of 173 checks passed
@steipete

Copy link
Copy Markdown
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants