Skip to content

refactor(runtime): lift the router chat client out of bench into src/runtime#270

Merged
drewstone merged 1 commit into
mainfrom
refactor/router-client-lift
Jun 12, 2026
Merged

refactor(runtime): lift the router chat client out of bench into src/runtime#270
drewstone merged 1 commit into
mainfrom
refactor/router-client-lift

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

One router chat client, exported from @tangle-network/agent-runtime/loops, replacing three copies:

  • bench/src/router-client.ts → moved to src/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 calls routerChatWithUsage and gains the retry/backoff behavior (429/5xx/CF-origin family) the bare fetch lacked. Duplicate ToolSpec collapsed to one definition.
  • agent-lab's copy is flagged for deletion at its next dependency bump (its file: dep snapshots this repo, so the export becomes visible after this lands + a lab pnpm install).

Kept duplicated, deliberately, with the adjudication recorded in-file: stats.mts (agent-eval's pairedBootstrap has 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.

…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 tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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

@drewstone drewstone merged commit 6e84644 into main Jun 12, 2026
1 check 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.

2 participants