feat(runtime): createAgentRuntime — in-process agent core factory#12
Merged
Conversation
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.
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.
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 withrun()/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, noagent-runtimeimport. The same core the Cloudflare Worker runs, runnable in an eval / edge / Node.Additive: new export on the
./runtimebarrel — 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.