feat(bench): tool-using router backend (routerToolLoop) + self-repair gate#198
Merged
Conversation
… gate routerToolLoop (router-client.ts): a real agentic loop OVER the Tangle router's tool-calling, OFF-BOX — each turn is a router completion with `tools`; tool_calls execute on the host and fold back as `tool` messages; repeat until done or budget. The depth substrate the chat-only routerChatWithUsage couldn't express (routes around the sandbox→router egress block, #984). One turn = one completion, so maxTurns is the equal-compute unit vs random@k. humaneval-repair-gate.mts: the strongest steering test — the worker gets a run_tests tool (the deployable Docker checker, now returning failure detail), so it RUNS the tests, sees the real failure, and fixes, vs blind resampling at equal k. Removes the weakness of the earlier LLM-audit null (which never ran the code). Gate result (gpt-3.5-turbo, HumanEval hard half, n=82, equal k=3, paired bootstrap): blind@1 54.9% blind@3 (resample) 75.6% repair@3 (tools) 58.5% repair@3 − blind@3 (steering) -17.1pp CI [-26.8, -7.3] SIGNIFICANT NEGATIVE blind@3 − blind@1 (more-compute) +20.7pp CI [+12.2, +30.5] SIGNIFICANT POSITIVE Execution-grounded self-repair is SIGNIFICANTLY WORSE than blind resampling at equal budget: refining one anchored attempt loses to exploring k fresh ones. The tool backend works (recovered tasks blind missed); the depth strategy loses on single-shot codegen. Sharpens the steering-vs-compute boundary: breadth wins where fresh samples are cheap+independent; depth's one win remains EOPS (stateful/agentic).
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.
What
Adds the tool-using router backend — a real agentic loop over the Tangle router's tool-calling, off-box (no sandbox) — and uses it to run the strongest form of the steering gate.
routerToolLoop(bench/src/router-client.ts): each turn is a router completion withtools; tool_calls execute on the host and fold back astoolmessages; repeat until the model answers without a tool or the turn budget is hit. One turn = one completion, somaxTurnsis the equal-compute unit. This is the depth substrate the chat-onlyrouterChatWithUsagecouldn't express, and it routes around the sandbox→router egress block (#984).humaneval-repair-gate.mts: the worker gets arun_teststool (the deployable Docker checker, now returning the failuredetail), so it runs the tests, sees the real failure, and fixes — vs blind resampling at equal k. Removes the weakness of the earlier null (an LLM that guessed the bug without running it).Result (gpt-3.5-turbo, HumanEval hard half, n=82, equal k=3, paired bootstrap B=10000)
Even with real execution feedback, self-repair is significantly worse than blind resampling at equal budget. Refining one anchored attempt loses to exploring k fresh ones — repair barely beats a single shot; resampling crushes it. The tool backend works (it recovered tasks blind missed); the depth strategy loses on single-shot codegen.
This sharpens the steering-vs-compute boundary: breadth/resampling wins where fresh samples are cheap and independent; depth/steering's one win remains EOPS (stateful, multi-step ops, where you can't cheaply resample).
Test
typecheck clean (bench tsconfig); smoke (N=3) fired the tool loop end-to-end; full n=82 ran with 0 errors.