Skip to content

feat(runtime): first-class router-tools executor backend (off-box tool use)#199

Merged
drewstone merged 1 commit into
mainfrom
feat/router-tools-executor
Jun 8, 2026
Merged

feat(runtime): first-class router-tools executor backend (off-box tool use)#199
drewstone merged 1 commit into
mainfrom
feat/router-tools-executor

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

createExecutor gains backend: 'router-tools' — a real agentic loop over the Tangle router's tool-calling, off-box (no sandbox). Each turn passes tools; the model's tool_calls run via the seam's executeToolCall on this host and fold back as tool messages, repeating until the model answers or maxTurns (one turn = one completion = the equal-compute unit vs random@k).

This is the multi-turn capability the single-shot routerInlineExecutor couldn't express, and it routes around the sandbox→router egress block (#984). executeToolCall(name, args, task) receives the task so per-task tool surfaces (e.g. a gym keyed by task) dispatch correctly. RouterToolsSeam + ToolSpec exported via /loops.

createExecutor({
  backend: 'router-tools',
  routerBaseUrl, routerKey, model: 'gpt-4o-mini',
  tools: [weatherTool], maxTurns: 4,
  executeToolCall: async (name, args, task) => runMyTool(name, args),
})

Why

The chat-only router backend can't do agentic work (it was the wrong worker for any tool-using domain — e.g. EOPS). This makes the tool-using off-box worker first-class, symmetric with the other createExecutor backends, so any adapter with a tool surface gets it for free.

Verified live

createExecutor({backend:'router-tools', tools:[get_weather], …}).execute("weather in Paris?") → called get_weather({city:"Paris"}), ran the host tool, answered "The weather in Paris is clear with a temperature of 18°C." in 2 turns.

Test

typecheck + build clean (router-tools exported in dist/loops.d.ts); lint clean; live end-to-end proof above.

…l use)

createExecutor gains `backend: 'router-tools'` — a real agentic loop over the
Tangle router's tool-calling, OFF-BOX (no sandbox, so unaffected by a box's
egress allowlist, #984): each turn passes `tools`; the model's tool_calls run via
the seam's `executeToolCall` on this host and fold back as `tool` messages,
repeating until the model answers or `maxTurns` (one turn = one completion = the
equal-compute unit). The multi-turn capability the single-shot routerInlineExecutor
could not express; `executeToolCall` receives the task so per-task tool surfaces
dispatch correctly. RouterToolsSeam + ToolSpec exported via /loops.

Verified live: createExecutor({backend:'router-tools', tools:[get_weather], …})
called get_weather({city:Paris}), ran the host tool, and answered from the result
in 2 turns. Any adapter that has a tool surface now gets a tool-using off-box
worker for free.
@drewstone drewstone merged commit 89f2895 into main Jun 8, 2026
1 check passed
@drewstone drewstone deleted the feat/router-tools-executor branch June 8, 2026 22:34
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