Skip to content

fix: make a brokered Grok worker actually run, and make its failures diagnosable - #29

Merged
apresmoi merged 124 commits into
mainfrom
fix/grok-worker-tmp-spill
Sep 18, 2026
Merged

apresmoi merged 124 commits into
mainfrom
fix/grok-worker-tmp-spill

Conversation

@apresmoi

Copy link
Copy Markdown
Collaborator

Makes a brokered Grok worker run end to end under Daimon inside a training container, and makes every failure name its own cause.

What was broken

  • the broker MCP facade dropped Mcp-Session-Id, so every mounted tool was unreachable and search_tool returned an empty catalogue
  • the worker's stdout pipe was non-blocking on the child's end, killing it with EAGAIN on its first large write
  • DBL_MAX_OUTPUT (64 KiB) was exceeded by an ordinary turn, and the trip discarded the turn's whole text
  • a failed worker's own words were erased in three separate layers, so exit=1 was unexplainable by construction
  • an expired credential was retried ~15 times instead of being named

What this adds

  • MCP session/protocol header forwarding plus GET/DELETE, with a closed allowlist
  • a blocking child pipe with a non-blocking launcher read end, and a no-hang proof
  • the output bound raised to the protocol's own text bound (262,144), set on measurement
  • the worker's last words captured head + elision marker + tail, redacted, inside the sealed terminal response
  • per-request tool-call names, an MCP call and tunnel observation, and a turns.jsonl seal ledger that survives a hung turn
  • auth_stale as a named non-retryable refusal; policy misses answered 400 rather than blind-retried 503
  • an inbox turn leads with the delivery's own text; Grok tool names render as daimon__<name> from shared contract atoms
  • the MCP capability budget derived from the compiled turn bound so the two cannot drift
  • the v2 activity closure query stays answerable after a control host stop

Verification

Full suite 887 pass / 0 fail. Typecheck, contract manifest, production closure and native verify all green. The Docker native adversarial suite passes all 16 stages, including a real 219,608-byte turn and a no-hang proof where the worker is asleep inside write().

Reviewed adversarially before this PR; every blocking finding was fixed with a failing-first test and a named mutation check.

🤖 Generated with Claude Code

…tead of waiting for a worker to release them
@apresmoi
apresmoi merged commit 98877b2 into main Sep 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant