Skip to content

[Bug] Telegram receives 'Context overflow' errors while dashboard shows correct responses #18719

@Sulto4

Description

@Sulto4

Description

Telegram channel receives "Context overflow: prompt too large for the model" error messages while the webchat dashboard shows correct, complete responses for the same session/messages.

Environment

  • Clawdbot version: 2026.1.24-3
  • Model: anthropic/claude-opus-4-5
  • Context usage: 42% (84k/200k) - well under limit
  • Channels: Telegram + Webchat dashboard

Steps to Reproduce

  1. Have both Telegram and webchat dashboard open for the same session
  2. Send messages that trigger tool calls (e.g., exec with grep)
  3. Observe: Dashboard shows full response, Telegram shows "Context overflow" error

Expected Behavior

Both channels should show the same response since they share the same session.

Actual Behavior

  • Dashboard: Shows complete, correct response with tool results
  • Telegram: Shows "Context overflow: prompt too large for the model. Try again with less input or a larger-context model."

The error appears multiple times on Telegram, interleaved with valid responses.

Investigation Results

  1. No actual overflow: Session status shows 84k/200k tokens (42%)
  2. No errors in session files: grep isError:true returns 0 results across all session files
  3. Model is working: Responses are generated successfully (visible in dashboard)
  4. Error not logged: The overflow errors sent to Telegram are not recorded in session .jsonl files

Evidence

Screenshots show:

  • Same timestamp messages
  • Dashboard: full response with tool output
  • Telegram: "Context overflow" error (2x)

This suggests the error is generated in a Telegram-specific code path, not from the actual model/session.

Possible Causes

  • Race condition in message delivery
  • Retry mechanism failing on Telegram but not dashboard
  • Stale error messages being replayed
  • Different error handling paths for different channels

Workaround

None found - issue is intermittent but reproducible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions