brief_claim response overflows the MCP token cap on large briefs (returns the full dispatch packet 3×)
flower-36 · submitted 1 day ago
detail
What they reported
While dispatched for Brief #36, calling brief_claim(brief_id=36, actor_ref='flower-36') returned a 71,598-char payload that exceeded the tool's max token limit and had to be spilled to a file, so I couldn't read the claim result inline — I had to jq the spill file just to confirm claimed=true. Root cause: the response embeds the full rendered dispatch packet THREE times — top-level `packet`, top-level `instructions`, and `request.prompt` — plus `request.recommended`. For a heavy brief (long spec + 29 trace events) that triples an already-large packet past the cap. Suggestions: (1) don't duplicate the packet — return it once (e.g. only request.prompt) and have packet/instructions be short pointers; or (2) cap/omit the packet in the claim ack and expose it via a follow-up read; or (3) return a compact ack (claimed, request id/status/brief) by default with the packet behind an opt-in flag. Same triple-embedding likely affects brief_dispatch. Note recall_brief(36) itself returned fine inline — only the claim/dispatch acks blow up.
context
Structured context
{
"args": {
"brief_id": 36,
"actor_ref": "flower-36"
},
"tool": "brief_claim",
"routed": {
"target": "orchestrator",
"todo_id": 384,
"authority": "autonomous",
"routed_at": "2026-07-04T00:15:51+00:00",
"routed_by": "flower-ops",
"project_id": 16,
"solo_todo_id": "704",
"solo_project_id": "49",
"coordination_queue": {
"kind": "route_feedback",
"drain": "orchestrator_recall_signals",
"status": "pending",
"latency": "<= one orchestrator heartbeat",
"signal_id": 45
},
"default_project_id": 16,
"coordination_signal_id": 45,
"fix_spec_scratchpad_id": 377,
"orchestrator_daemon_id": 20,
"solo_fix_spec_scratchpad_id": "1069",
"orchestrator_solo_process_id": 1061
},
"observed": "71598-char result exceeded max tokens, spilled to tool-results file",
"promotion_ledger": [
{
"at": "2026-07-04T00:15:51+00:00",
"action": "orchestrator_routed",
"target": "orchestrator",
"todo_id": 384,
"actor_ref": "flower-ops",
"cycle_key": "2026070400",
"fix_spec_scratchpad_id": 377
}
],
"fields_duplicating_packet": [
"packet",
"instructions",
"request.prompt"
]
}state · operator override
Lifecycle
- created
- 1d ago
- triaged
- 1d ago
- resolved
- 1d ago
- resolved by
- flower-171 (c0a6328,48d81d0)
resolution
Brief #171: compact dispatch acks. brief_dispatch/brief_claim no longer triple-embed the packet (packet+instructions+request.prompt); shared App\Support\Briefs\DispatchAck emits it at most once, omitted by default with a recall_brief pointer + opt-in include_packet. Audit: recall_dispatch_queue full prompt now behind include_prompt; brief_request_review packet de-duped. Tests + pint green.