Problem
When a follow-up question requires accessing large artifacts from prior orchestration runs, workers (and the coordinator) call read_artifact which returns the full artifact content directly. This bypasses the scratchpad interception mechanism, causing context overflow when artifacts are large.
The scratchpad tools (head, slice, grep, etc.) are registered on the worker, but read_artifact is an internal orchestration tool — not an MCP tool — so it never hits the scratchpad token-threshold check.
Observed behavior
A worker reads a 12MB deduplicate_logs artifact via read_artifact. The full 12MB content is placed into the conversation, exceeding OpenAI's per-message string limit (10MB). The worker fails with context_overflow. The coordinator then also calls read_artifact during re-planning and hits the same error.
Expected behavior
read_artifact should respect scratchpad limits — either by routing large results through scratchpad interception, or by saving the content to scratchpad storage and returning a summary/pointer with instructions to use scratchpad tools for exploration.
Logs
2026-05-13T20:22:21.900Z INFO aura::orchestration::tools::read_artifact: read_artifact cross-run: filename=task-0-log-analyst-iter-1-deduplicate-logs-relative-time-0-output.txt, run_id=019e22fa-b702-7b33-9455-21369e1b819e
2026-05-13T20:22:21.940Z DEBUG aura::orchestration::orchestrator: Worker task: tool result received (id=call_NOEIvT6Md0QHf78vXrgz7z2S, call_id=-)
2026-05-13T20:22:21.957Z INFO rig::agent::prompt_request::streaming: Current conversation depth: 2/16
2026-05-13T20:22:27.021Z ERROR rig::providers::openai::completion::streaming: SSE error error=InvalidStatusCodeWithMessage(400, "{\n \"error\": {\n \"message\": \"Invalid 'messages[3].content': string too long. Expected a string with maximum length 10485760, but got a string with length 12152840 instead.\",\n \"type\": \"invalid_request_error\",\n \"param\": \"messages[3].content\",\n \"code\": \"string_above_max_length\"\n }\n}")
2026-05-13T20:22:27.025Z WARN aura::orchestration::orchestrator: Worker 'log-analyst' failed task 0 after 8015ms (context_overflow): Worker failed task 0 after 1 attempts: Worker context limit exceeded for task 0. Task context too large. The plan may need smaller, more focused tasks.
Coordinator also hits the same wall during re-planning:
2026-05-13T20:22:28.531Z INFO aura::orchestration::tools::read_artifact: read_artifact cross-run: filename=task-0-log-analyst-iter-1-deduplicate-logs-relative-time-0-output.txt, run_id=019e22fa-b702-7b33-9455-21369e1b819e
2026-05-13T20:22:32.615Z ERROR rig::providers::openai::completion::streaming: SSE error error=InvalidStatusCodeWithMessage(400, "{\n \"error\": {\n \"message\": \"Invalid 'messages[11].content': string too long. Expected a string with maximum length 10485760, but got a string with length 12152840 instead.\",\n \"type\": \"invalid_request_error\",\n \"param\": \"messages[11].content\",\n \"code\": \"string_above_max_length\"\n }\n}")
2026-05-13T20:22:32.615Z WARN aura::orchestration::orchestrator: Post-execute coordinator call failed: Context limit exceeded during planning.
Context
- Artifact:
deduplicate_logs_relative_time output (~12MB JSON)
- Worker has scratchpad tools registered but
read_artifact doesn't use them
- Scratchpad interception only applies to MCP tool outputs, not internal tools
Problem
When a follow-up question requires accessing large artifacts from prior orchestration runs, workers (and the coordinator) call
read_artifactwhich returns the full artifact content directly. This bypasses the scratchpad interception mechanism, causing context overflow when artifacts are large.The scratchpad tools (
head,slice,grep, etc.) are registered on the worker, butread_artifactis an internal orchestration tool — not an MCP tool — so it never hits the scratchpad token-threshold check.Observed behavior
A worker reads a 12MB deduplicate_logs artifact via
read_artifact. The full 12MB content is placed into the conversation, exceeding OpenAI's per-message string limit (10MB). The worker fails withcontext_overflow. The coordinator then also callsread_artifactduring re-planning and hits the same error.Expected behavior
read_artifactshould respect scratchpad limits — either by routing large results through scratchpad interception, or by saving the content to scratchpad storage and returning a summary/pointer with instructions to use scratchpad tools for exploration.Logs
Coordinator also hits the same wall during re-planning:
Context
deduplicate_logs_relative_timeoutput (~12MB JSON)read_artifactdoesn't use them