Skip to content

Context auto-compression seems ineffective with GLM-5: Request exceeds maximum context length #15556

Closed as not planned

Description

@mafamily2496

Description

Image

I am using opencode with the GLM-5 model. According to the features/documentation, opencode should support automatic context compression/summarization when the conversation history or input size grows large.

However, I encountered an API error indicating that the input token count exceeds the model's limit, suggesting that the auto-compression mechanism either did not trigger or failed to reduce the context sufficiently.

Plugins

No response

OpenCode version

1.1.15

Steps to reproduce

Initialize opencode with the GLM-5 model configuration.
Start a long-running conversation session (e.g., iterating on a large codebase or analyzing multiple files).
Monitor the context usage until it reaches approximately 170,000 tokens.
At this stage, trigger an action that requires tool usage (e.g., file edit, search) or subagent invocation.
Observe the API error: Request ... input tokens exceeds the model's maximum context length.

Screenshot and/or share link

No response

Operating System

windows 11

Terminal

windows terminal

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 1, 2026
  2. github-actions commented on Mar 1, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct (e.g., specific to the GLM-5 model or a different failure mode), please add details clarifying how it differs from the above.

  3. assigned and unassigned on Apr 26, 2026
  4. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions