Skip to content

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

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions