Skip to content

feat(runtime): createAgentRuntime — in-process agent core factory#12

Merged
drewstone merged 1 commit into
mainfrom
feat/agent-runtime-factory
Jun 5, 2026
Merged

feat(runtime): createAgentRuntime — in-process agent core factory#12
drewstone merged 1 commit into
mainfrom
feat/agent-runtime-factory

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Collapses the five-call hand-assembly every sandbox-free surface repeats (resolve model → build tool schemas → streamTurnexecuteToolCall → drive the loop) into one configured object with run() / stream().

The model is always advertised the app tools, so it emits tool_calls and the side effects fire — the exact failure that scored tool-driven agents zero off-sandbox (tcloud called the router with no tools). Domain (taxonomy, handlers, system prompt) is injected; no sandbox, no Durable Object, no agent-runtime import. The same core the Cloudflare Worker runs, runnable in an eval / edge / Node.

Additive: new export on the ./runtime barrel — no consumer breakage. 5 deterministic tests (fake SSE model → real handler fires, taxonomy rejection, non-app-tool routing, stream ordering). 176 total green. 0.1.14.

Collapses the five-call hand-assembly every sandbox-free surface repeats
(resolve model → build tool schemas → streamTurn → executeToolCall →
drive the loop) into one configured object: run()/stream() for an agent.
The model is always advertised the app tools, so it emits tool_calls and
the side effects fire — the failure that scored tool-driven agents zero
off-sandbox. Domain (taxonomy, handlers, system prompt) injected; no
sandbox, no DO, no agent-runtime import. The same core the Worker runs,
runnable in an eval/edge/Node. 5 tests, 176 total.
@drewstone drewstone merged commit 3ab068c into main Jun 5, 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.

1 participant