Bug Description
Agent collaboration fails with error:
❌ Agent collaboration failed: insufficient_runtime_budget
This error only occurs in one specific A2A conversation, while other conversations work normally.
Root Cause Analysis
Why Only This Conversation Triggers
The capture_run_inputs logic in context_builder.py:
- direct session →
recent_messages = () (no history loaded)
- group session → same as above, no history loaded
- A2A session → uses
load_context_pack, sets watermark via covered_through_message_id, returns ALL history as pending when not compacted (watermark=NULL)
This A2A conversation has never been compacted (covered_through_message_id is NULL), so all 321 messages become pending history.
Regular direct/group sessions or already-compacted sessions don't trigger this — explaining why only this conversation fails.
Why It Appears in v1.11
v1.11 introduced a new runtime_budget hard validation check in model_capabilities.py. This validation didn't exist before, so the issue was hidden in previous versions.
Safety of Investigation
All operations were read-only:
- SELECT + checkpoint decoding only
- No data written, no code modified
- Only 6 test API calls to kimi-k3 (minimal token consumption)
- Temporary scripts have been cleaned up
Suggested Fixes (For Decision, Not Yet Implemented)
The root issue is unbounded pending history in uncompacted A2A sessions. Possible solutions:
- Option A (Recommended): Execute compact / set watermark for A2A sessions as well (fix at platform level)
- Option B: Add limits to
pending_session_messages_snapshot (limit by count or token budget) (fix in code)
- Option C: Set
context_window_tokens_override for the model (workaround, increases input_limit to bypass 114k cap)
Reporter
xiaoan (Platform User)
Bug Description
Agent collaboration fails with error:
This error only occurs in one specific A2A conversation, while other conversations work normally.
Root Cause Analysis
Why Only This Conversation Triggers
The
capture_run_inputslogic incontext_builder.py:recent_messages = ()(no history loaded)load_context_pack, sets watermark viacovered_through_message_id, returns ALL history as pending when not compacted (watermark=NULL)This A2A conversation has never been compacted (
covered_through_message_idis NULL), so all 321 messages become pending history.Regular direct/group sessions or already-compacted sessions don't trigger this — explaining why only this conversation fails.
Why It Appears in v1.11
v1.11 introduced a new runtime_budget hard validation check in
model_capabilities.py. This validation didn't exist before, so the issue was hidden in previous versions.Safety of Investigation
All operations were read-only:
Suggested Fixes (For Decision, Not Yet Implemented)
The root issue is unbounded pending history in uncompacted A2A sessions. Possible solutions:
pending_session_messages_snapshot(limit by count or token budget) (fix in code)context_window_tokens_overridefor the model (workaround, increases input_limit to bypass 114k cap)Reporter
xiaoan (Platform User)