Skip to content

[BUG] Un-controllable Token Exceed with MCP results #648

Open
0 of 4 issues completed
Open

Description

@sihangchen97

Problem (one or two sentences)

The conversation will get stuck when MCP tools return a large amount of context.

  • with “Compression API failed: OpenAI completion error: 400 request (359746 tokens) exceeds the available context size (128000 tokens), try increasing it”

Context (who is affected and when)

N/A

Reproduction steps

  1. Clone a rather large git repo
  2. Activate "Git Tools" from "Zoo Marketplace - MCP"
  3. Ask Zoo to check the diff and status of this git repo
  4. Zoo will use the MCP tool for the task
  5. The conversation gets stuck with a compression error

Expected result

Run normally with either trunc or compressed MCP result

Actual result

“Compression API failed: OpenAI completion error: 400 request (359746 tokens) exceeds the available context size (128000 tokens), try increasing it”

Variations tried (optional)

No response

App Version

3.60.0

API Provider (optional)

OpenAI Compatible

Model Used (optional)

Qwen3.6-27B

Zoo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Activity

  1. pajitosingh commented on Jun 18, 2026

    @pajitosingh
    Contributor

    I can confirm. This happens with html_get use with a browser mcp (playwright) as well. A large html dump will take the context over 1M sometimes and then the session is borked.

  2. Awilen-Bernkastel commented on Sep 14, 2026

    @Awilen-Bernkastel

    Adding to this: my own workflow first compacts fine, then the subsequent compaction runs try to reuse the full context from before compaction. This leads to a silly situation in which a session tries to compact a million-tokens worth of conversation from a 128k window: Condensing API call failed: OpenAI completion error: 400 request (1009019 tokens) exceeds the available context size (128000 tokens), try increasing it (Yes, somehow this is still working out fine for my purpose, despite the context window crops.)

    This didn't come from a massive MCP call result filling the context window, just normal usage. This may be another bug I could describe as "the compaction algorithm keeps reusing the full conversation instead of previous compaction results."

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

Metadata

Metadata

Assignees

No one assigned

    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