refactor(runtime): lift the router chat client out of bench into src/runtime#270
Merged
Conversation
…runtime routerChatWithUsage / routerChatWithTools / routerToolLoop move from bench/src/router-client.ts to src/runtime/router-client.ts and export via the ./loops subpath. routerInlineExecutor now calls routerChatWithUsage instead of carrying its own minimal copy (the in-code Integrate directive: do not re-copy a third time), picking up transient-status retry and the thinking-model max_tokens default. ToolSpec's single definition moves to router-client; the executor seam re-exports it. Bench importers point at @tangle-network/agent-runtime/loops. Not collapsed onto agent-eval's createChatClient: LlmCallRequest has no tools parameter and LlmMessage no tool role, retry covers only 429/502/503/504, and LlmUsage cannot express provider-omitted usage.
tangletools
approved these changes
Jun 12, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved PR — defdbbd2
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-12T02:13:44Z
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
One router chat client, exported from
@tangle-network/agent-runtime/loops, replacing three copies:bench/src/router-client.ts→ moved tosrc/runtime/router-client.ts(git mv, history preserved); all 14 bench importers rewired to the package subpath.routerInlineExecutor(src/runtime/supervise/runtime.ts) carried a minimal in-code duplicate with an explicit lift-me directive — now callsrouterChatWithUsageand gains the retry/backoff behavior (429/5xx/CF-origin family) the bare fetch lacked. DuplicateToolSpeccollapsed to one definition.file:dep snapshots this repo, so the export becomes visible after this lands + a labpnpm install).Kept duplicated, deliberately, with the adjudication recorded in-file:
stats.mts(agent-eval'spairedBootstraphas a different return shape — no discordant count — different resample/seed defaults and CI-quantile convention, and silent-zeros at n=0 vs our fail-loud throw);run-pool.ts(no substrate equivalent exists).Verification
Runtime lint + tsc clean, bench tsc clean, agent-lab tsc + certified-store test clean, full runtime suite 791 passed / 1 skipped.