fix: isolate adversarial stage sub-agents from spine persistence [refs OSWE-239] - #121
Merged
Merged
Conversation
…s OSWE-239] Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericlitman
enabled auto-merge
August 4, 2026 07:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The first production adversarial review (tonal-api#3) published nothing and exited success in 4.6s; tonight's canary (PR #120) reproduced it in 3.1s — with PR #117's instrumentation finally exposing the mechanism. Ten
Ignoring unknown node name find in pending sendswarnings fired from inside the finder nodes:_run_stageforwards the spine node's runtime config (thread_id, checkpoint_ns, the platform's injected checkpointer) into each bounded sub-agent'sainvoke, so under production persistence every stage sub-agent runs as a checkpoint-sharing subgraph of the spine — it loads the spine's own checkpoint, chokes on the spine's pendingSend("find")tasks, returns no structured response, and the spine settles and exits success. Locally there is no checkpointer, so all tests passed. LangSmith corroborates: the failed adversarial roots cost 4.3k/4.8k tokens vs ~600k for a real review.What changed
_bounded_agentpassescheckpointer=False— langgraph's documented opt-out from inherited persistence (pregel/main.pyresolvesFalseunconditionally, overriding ambientCONFIG_KEY_CHECKPOINTER). Stage sub-agents now run stateless-fresh under any parent checkpointing._run_stageis untouched, so tracing/callbacks keep flowing.Regression test
test_stage_subagent_ignores_spine_checkpointer_and_thread: a real_bounded_agentfinder driven through a minimal spine replica (node namedfind,Sendfan-out, closure-over-config) under a realInMemorySaverwiththread_id+ injectedCONFIG_KEY_CHECKPOINTER. Mutation check: deleting the fix line reproduces the exact production warning 4x and fails the test; restoring it passes.Verification
uv run pytest tests/reviewer/test_reviewer_adversarial.py→ 36 passeduv run pytest -q tests/→ 2383 passedmake lintclean;make typecheck0 errorsAnalysis and live evidence on OSWE-239.
🤖 Generated with Claude Code