Skip to content

GitHub Copilot GPT-5 throwing "invalid_request_body" on requests after compaction #10650

Closed

Description

@LiamMacP

Description

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.

Plugins

None

OpenCode version

1.1.34 (but have seen across earlier versions)

Steps to reproduce

  1. On GitHub Copilot - use the model GPT 5
  2. Fill the context until compaction
  3. Send a request.

Screenshot and/or share link

Image Image

Operating System

Dockerised (Ubuntu 24.04)

Terminal

Ghostty (container TERM is set to xterm-256color)

Activity

  1. github-actions commented on Jan 26, 2026

    @github-actions
    Contributor

    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_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.

  2. LiamMacP commented on Jan 26, 2026

    @LiamMacP
    Author

    Another instance attached:
    Image

  3. LiamMacP commented on Jan 27, 2026

    @LiamMacP
    Author

    Reproduced on fresh session, Plan mode, default gpt-5 settings:
    Image

  4. adiled commented on Jan 28, 2026

    @adiled

    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

    Image
  5. adiled commented on Jan 28, 2026

    @adiled

    Reproduced on a fresh session, in a fresh terminal window.

    Image
  6. LiamMacP commented on Jan 28, 2026

    @LiamMacP
    Author

    Appeared to have worked past compaction on 1.1.39 🚀 :
    Image

    Still failed on a new request:
    Image

  7. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions