You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitHub Copilot GPT-5 throwing "invalid_request_body" on requests after compaction #10650
When running OpenCode alongside GitHub Copilot GTP-5, whenever the context window gets to compaction the TUI throws "{"error":{"message":"","code":"invalid_request_body"}}". This then no longer allows any GPT-5 prompt as the next.
This is running in a Dockerised environment (ubuntu:24.04) with the following tooling:
git curl ca-certificates gnupg jq tar unzip ripgrep fd-find locales openssh-client tini
Workaround:
I sometimes change (see second attachment of this not working; could be the moving from Build to Plan?). to another model gpt-5-mini, get it to run the next command (although this then means I don't get great results, and then changing back after. Undo and Redo, haven't appeared to help here.
Notes:
I have previously seen this behaviour by initialising a blank session and requesting basic functionality such as "What is the current time?". This does appear to have resolved for the moment, but wanted to note it.
These issues relate to context compaction and token limit handling. While your issue specifically involves the GitHub Copilot GPT-5 provider returning an invalid_request_body error after compaction, it may be connected to underlying compaction logic issues.
Feel free to ignore if none of these address your specific case.
Activity
github-actions commentedon Jan 26, 2026
This issue might be a duplicate of existing issues. Please check:
These issues relate to context compaction and token limit handling. While your issue specifically involves the GitHub Copilot GPT-5 provider returning an
invalid_request_bodyerror after compaction, it may be connected to underlying compaction logic issues.Feel free to ignore if none of these address your specific case.
LiamMacP commentedon Jan 26, 2026
Another instance attached:

LiamMacP commentedon Jan 27, 2026
Reproduced on fresh session, Plan mode, default gpt-5 settings:

adiled commentedon Jan 28, 2026
Reproduced in plan mode of an opus-maintained session, after switching to codex (since anthropic got the itch again).
Env: OSX 26.1 / Opencode 1.1.37
adiled commentedon Jan 28, 2026
Reproduced on a fresh session, in a fresh terminal window.
LiamMacP commentedon Jan 28, 2026
Appeared to have worked past compaction on 1.1.39 🚀 :

Still failed on a new request:

fix(opencode): remove broken gpt-5 model from plan agent
github-actions commentedon Mar 30, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.