Skip to content

refactor: split runtime and Runner module responsibilities - #801

Merged
yyjeqhc merged 11 commits into
mainfrom
refactor/runtime-module-boundaries
Sep 30, 2026
Merged

yyjeqhc merged 11 commits into
mainfrom
refactor/runtime-module-boundaries

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Dense runtime and Runner entry modules mixed workflow routing, protocol handling, execution, output collection, and lifecycle responsibilities. This series separates those responsibilities into private modules so changes can be reviewed within a smaller domain while preserving existing public entry points and behavior.

The PR combines all 10 commits on refactor/runtime-module-boundaries:

  • Split coding workflow startup, project preparation, observations, projection, and closeout; split Runner ACP setup, protocol, execution, lifecycle, and durability.
  • Separate file mutation preflight, transactional execution, recovery, and result validation; separate Computer requests, control, observations, and receipt validation.
  • Separate JobManager admission, workers, delivery, retention, detached execution, SSH, and shutdown; separate persistent-shell opening, framing, execution, output, lifecycle, and Runner routing.
  • Separate Runner transport bootstrap, supervision, polling, WebSocket/QUIC loops, metrics, and ordered shutdown; separate shell environments, profiles, command/script preparation, execution, drains, and process-tree cleanup.
  • Keep dispatch authority/Session/permission/recording order in one governance chain, with an exhaustive router delegating authorized tools to private domain handlers. Preserve feature-gated Code Mode, checkpoint, and legacy routes.

Entry-file physical line counts (implementation and any inline tests included; code is moved into domain modules):

Entry module Before After
Runtime coding task 3,957 105
Runner coding agent 6,308 760
File mutations 5,086 25
Computer tools 3,821 113
Runner JobManager 3,953 411
Persistent-shell crate 3,831 249
Runner persistent shell 2,188 248
Runner transport 3,294 268
Runner shell 3,280 195
Runtime dispatch 2,570 340

Validation:

  • Runner package check and Server library checks passed, including experimental-code-mode, workspace-checkpoints, and legacy-gpt-actions together.
  • Latest Runner transport/shell regression selection: 160 passed, 10 manual tests skipped; three selected ignored stdin/probe process fixtures passed separately.
  • Latest dispatch/permission/Session/execution-context/specialized-routing/process/trusted-smoke selection: 85 passed.
  • Selected feature-enabled routing regressions: 9 passed, 1 pre-existing failure, detailed below.
  • Earlier commits passed focused Computer, JobManager, and persistent-shell suites, including relevant process/timing checks.
  • Reviewed extraction equivalence for all 104 transport functions, 98 shell functions, 102 original dispatch arm bodies/patterns, and their data/constants; verified ordered dispatch guards and recording around the extracted gateway/activity helpers.
  • Formatting, whitespace, workspace dependency boundaries, and merge preflight against origin/main (73be6e50) passed. Native execution evidence is Linux; macOS/Windows remain CI coverage.

Known pre-existing optional-feature failure:

tool_runtime::tests::code_mode_e2b::e2b_read_guarded_edit_post_read_preserves_canonical_mutation_truth fails at src/tool_runtime/tests/code_mode_e2b.rs:412 (Null versus true). The same exact test reproduces on the clean pre-series main commit 25e1ea25, using experimental-code-mode,workspace-checkpoints,legacy-gpt-actions. The test reads edit.output.state_changed, while the existing model projection omits this duplicate when changed already carries that fact. This PR preserves that behavior and leaves the unrelated test untouched.

No deployment, release, or service operations are included.

@yyjeqhc
yyjeqhc merged commit afcae93 into main Sep 30, 2026
18 checks passed
@yyjeqhc
yyjeqhc deleted the refactor/runtime-module-boundaries branch September 30, 2026 09:40
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