Skip to content

refactor(agent): split runner into agent/runner, move orchestrator machinery out of programs#688

Merged
gewenyu99 merged 4 commits into
mainfrom
refactor/agent-runner-split
Jun 19, 2026
Merged

refactor(agent): split runner into agent/runner, move orchestrator machinery out of programs#688
gewenyu99 merged 4 commits into
mainfrom
refactor/agent-runner-split

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Just moves things around!

Behavior-preserving split of the runner into four concerns, with dependencies pointing inward only (modes → shared; dispatch → both modes + shared).

  1. Dispatch — the single decision: run bootstrap, read the flag, hand off to a mode. Nothing else.
  2. Shared — everything both modes consume: the pre-flight, the contract types, the error helpers.
  3. Linear mode — the single-agent flow.
  4. Orchestrator mode — the task-queue flow + its machinery (queue/executor/loader/metrics).
agent/runner/
  index.ts          # (1) DISPATCH — the only `isOrchestratorEnabled` fork
  shared/           # (2) SHARED — what both modes need
    bootstrap.ts    #     pre-flight: auth, health, flags, MCP → BootstrapResult
    types.ts        #     the contract: ProgramRun, BootstrapResult, AbortCase
    errors.ts       #     abortOnInstallFailure + friends
  linear.ts         # (3) LINEAR mode
  orchestrator/     # (4) ORCHESTRATOR mode (+ queue, executor, run-metrics, …)

@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/cicd-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-nested-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-gitlab-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-ssh-vps-node-raw
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

gewenyu99 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread src/lib/agent/runner/linear.ts
gewenyu99 and others added 2 commits June 18, 2026 15:00
…chinery out of programs

Phase 1: extract agent-runner.ts into agent/runner/:
- runner/index.ts — runAgent + runProgram dispatcher (the only isOrchestratorEnabled fork)
- runner/bootstrap.ts — bootstrapProgram + shouldDisableAsk + sessionToOptions
- runner/linear.ts — runLinearProgram (the linear arm)
- runner/types.ts — ProgramRun, BootstrapResult, AbortCase (+ re-exports)
- runner/errors.ts — abortOnInstallFailure
- agent-runner.ts reduced to a thin re-export shim

Phase 2: move programs/orchestrator/ → agent/orchestrator/:
- queue.ts, executor.ts, queue-tools.ts, run-metrics.ts and their __tests__
- orchestrator-runner.ts with updated import paths
- All importers updated: wizard-tools, agent-interface, agent-prompt-loader,
  agent-prompt-loader.test, RunScreen.tsx

No logic changes — only moves, extractions, and import fixes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…strator modes

Moves agent/orchestrator/ into runner/orchestrator/ and runner/{bootstrap,types,errors}.ts
into runner/shared/, giving the 4-concern layout: index (dispatch), shared/, linear, orchestrator/.
Fixes all broken imports; shared/ uses @lib/@utils/@ui aliases to stay flat.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gewenyu99 gewenyu99 force-pushed the refactor/agent-runner-split branch from 29c190e to 415ed39 Compare June 18, 2026 19:12
@gewenyu99 gewenyu99 changed the base branch from orchestrator-surface-framework-docs to main June 18, 2026 19:12
@gewenyu99 gewenyu99 requested a review from a team June 18, 2026 19:31
@gewenyu99 gewenyu99 marked this pull request as ready for review June 18, 2026 19:31

@sarahxsanders sarahxsanders left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran tests locally and looks good

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gewenyu99

Copy link
Copy Markdown
Collaborator Author

/wizard-ci basic-integration/angular

@wizard-ci-bot

wizard-ci-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: bdb7658
Workflow: View run

App Confidence PR YARA
basic-integration/angular/angular-saas 5/5 #2004 (logs)

Configuration

Setting Value
Wizard ref refactor/agent-runner-split
Context Mill ref main
PostHog ref master

Search for trigger ID bdb7658 in wizard-workbench PRs.

@gewenyu99 gewenyu99 merged commit 3263ecb into main Jun 19, 2026
17 of 18 checks passed
@gewenyu99 gewenyu99 deleted the refactor/agent-runner-split branch June 19, 2026 20:18
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.

2 participants