Skip to content

Context overflow error with short conversations (unlike MiniMax graceful handling) #43

Description

@smallmj

Problem Description

When using Step-3.5-Flash through OpenClaw (or directly via API), context overflow errors occur even after relatively short conversations, forcing users to reset sessions frequently.

Error message:

Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model.

Expected Behavior

Other providers (e.g., MiniMax) handle context overflow gracefully by automatically dropping the oldest content from context, allowing conversations to continue seamlessly without errors. The model should either:

  1. Automatically manage context (like MiniMax does), or
  2. At minimum, provide a clearer error message explaining the actual input size limit

Environment

  • Model: step-3.5-flash
  • Context Window: 256,000 tokens (per documentation)
  • API Endpoint: https://api.stepfun.com/v1 (China)
  • Usage: OpenClaw agent with multi-turn conversation

Additional Observations

  1. The error occurs after only a few exchanges (not approaching 256K tokens)
  2. Cache metrics show: `缓存 67.2k/0 (98%)` - unclear what this means but seems relevant
  3. When using `reasoning: true` mode, the reasoning output consumes ~70% of output tokens, which may be contributing to context size
  4. Other providers with similar or smaller context windows (like MiniMax) handle this gracefully via automatic context eviction

Feature Request

Please consider implementing graceful context management similar to other providers, where:

  • When context approaches the limit, older messages are automatically evicted
  • Users can continue conversations without manual `/reset`
  • Or alternatively, implement a sliding window that actively manages context

This would significantly improve user experience, especially for agentic use cases with OpenClaw where long-running conversations are common.

Metadata

Metadata

Assignees

No one assigned

    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