Repository navigation
🤖 refactor: the agent definitions service builds host-local runtimes through the RuntimeFactory - #7420
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
🟢 e2e stories (Haiku): 14 passed27 agent steps · 7 replayed from cache · 31 model calls · 218.8k tokens (74% cached) All 14 tests in 9 files
e2e 0.20.0 · 2m 58s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 8.1k tokens (32% cached) All 3 tests in 3 files
e2e 0.20.0 · 19.4s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts |
…through the RuntimeFactory
ThomasK33
force-pushed
the
phase5/b-agent-definitions-service
branch
from
October 24, 2026 14:37
bc53832 to
73d36a5
Compare
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.
Summary
5b PR 8c of phase 5 (Loop host I/O) of the agent-loop refactor. The agent definitions service builds its host-local runtimes through the session's
RuntimeFactory(claim 3.3) instead ofnew LocalRuntime. This completes 5b PR 8. Behavior does not change: on the host, every caller gets the Node layer (nodeRuntimeFactory), whosecreateLocalRuntimeisnew LocalRuntime.Order
Base main. 5b PR 8a (#7415,
Runtime.location) and 5b PR 8b (#7417, the agent skills service) merged. When #7417 merged, the native stack rebased this PR onto main 6887934 as head 73d36a5. This PR replaces the temporarynodeRuntimeFactorythat 8b passes toresolveGlobalRuntimeinagentDefinitionsService.ts.Implementation
agentDefinitionsService.ts:discoverAgentDefinitions,readAgentDefinition,resolveAgentBody,resolveAgentDefinitionandresolveAgentFrontmattertake a requiredruntimeFactory(ReadAgentDefinitionOptions). The plugin container scans and the global scan build their host runtime through it.resolveHeadlessAgentDefinitiontakes the factory as an argument.resolveAgentInheritanceChain.tsandresolveNodeAgentAiSettings.ts(NodeAgentDefinitionContext) carry a requiredruntimeFactoryto the base-definition reads.agentResolution.ts,turnContextAssembler.ts,turnRequestBuilder.ts,continuousCompactionSummary.ts) pass the session's factory.taskService.ts,workspaceService.ts,workspaceTurnManager.ts,gitPatchArtifactService.ts,memoryConsolidationService.ts,agentPlugins/composition.ts) passnodeRuntimeFactoryexplicitly, with a comment.The tests change in 8 files: the new case below, and
runtimeFactoryin the calls that typecheck listed.As in 8b, plugin discovery and its containment checks still read the process filesystem next to the factory's runtime. Item 12 of the phase 5 follow-ups on #7255 tracks it, with the 5b proof PR as its trigger.
resolveAgentDiscoveryContext(the ORPC entry point) still builds its runtime with the freecreateRuntimeForWorkspaceandcreateRuntime. Item 11 of the phase 5 follow-ups on #7255 tracks it, with the 5b proof PR as its trigger.Validation
agentDefinitionsService.test.ts: a new case "resolves plugin containers through the host-local runtime of the RuntimeFactory it was given". The factory's host runtime resolves~/to a temp home that holds a plugin agent. With the scans onnew LocalRuntime, the case fails: discovery reads the real home. With this PR, it passes.rg -n 'new LocalRuntime|instanceof (LocalBaseRuntime|DevcontainerRuntime|RemoteRuntime)'prints nothing for the 5 files of 5b PR 8 (the plan's done check).agentDefinitions/,agentSkills/,workflows/and the task, turn-manager, git-patch and continuous-compaction tests: 2922 pass, 0 fail.make static-check,make lint-eslint,make crap-checkandmake dry-check(dry-check with the marker of 8b).make test(host suite lock) on head bd0dae3:bun test srchad 27881 pass, 7 skip, 0 fail. The shared scripts/storybook/vscode run had 729 pass, 1 skip, 0 fail, and the 18 isolated files had 0 fail. Loop-test tripwire, 3 runs against 8b's head 63b6943: 0 trips.make test(host suite lock) passed:bun test srchad 27898 pass, 7 skip, 0 fail, the shared run had 729 pass, 1 skip, 0 fail, and the 18 isolated files had 0 fail. Loop-test tripwire, 3 runs against main: 0 trips. The diff against main equals the pre-restack diff against 8b, apart from line offsets inworkspaceService.ts.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$183.62