Skip to content

feat(runner): central runner plan + anthropic runner seam (#521)#692

Closed
gewenyu99 wants to merge 3 commits into
mainfrom
pi/01-seam-flag
Closed

feat(runner): central runner plan + anthropic runner seam (#521)#692
gewenyu99 wants to merge 3 commits into
mainfrom
pi/01-seam-flag

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Epic #520 · implements #521.

Problem

  • The wizard is hard-wired to a single agent loop (@anthropic-ai/claude-agent-sdk) — no way to swap or A/B an alternate backend.

Changes

  • AgentBackend seam + selectBackend(flags) in runner/backends/ (unknown/missing → anthropic).
  • Wired into linear.ts at the agent-run step; anthropic wraps today's path verbatim.
  • Multivariate wizard-runner flag (anthropic | pi, default anthropic); active backend logged each run.

Test plan

  • Build + unit tests green; selectBackend unit-tested per variant.
  • wizard-runner created in PostHog (US + EU), default anthropic, 100% anthropic.

gewenyu99 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

gewenyu99 and others added 2 commits June 26, 2026 20:30
Re-add the wizard-runner flag key on top of latest main (it lived only on the
old stack, which is being re-authored). Read by the wizardRunner resolver
middleware in #692b; no importer yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mcp-prompt-streaming.ts and agent-prompt-loader.ts hardcoded 'claude-sonnet-4-6';
point them at the shared DEFAULT_AGENT_MODEL constant (agent-interface already
uses it on main). Value unchanged; prep for the MODELS alias map in #692a.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gewenyu99 gewenyu99 changed the title feat(runner): agent-backend seam + multivariate wizard-runner flag (#521) feat(runner): central runner plan + anthropic runner seam (#521) Jun 27, 2026
}

/** The fall-through when a program has no `ROUTES` entry. */
export const DEFAULT_ROUTE: Route = {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right now we just default everything to this

Introduce runner-plan.ts: the central config map (ROUTES -> {router, runner,
model}, DEFAULT_ROUTE = linear/anthropic/sonnet), the RUNNERS/MODELS registries,
the middleware-chain plumbing, and resolvePair (empty chain -> map terminal).
Extract the claude-agent-sdk path (initializeAgent + runAgent, incl.
emitStepEvents) into backends/anthropic.ts behind the AgentRunner seam. linear.ts
resolves the (runner, model) pair and dispatches through the runner; skill
install, ask bridge (richLinks), prompt assembly (teamProductOptIns), error
routing and outro stay shared. The pair's model threads via modelOverride.

Behavior identical: every program resolves to linear/anthropic/sonnet. The
orchestrator fork (isOrchestratorEnabled) is untouched here; resolveRouter and
the per-flag middleware land in #692b.

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

Copy link
Copy Markdown
Collaborator Author

Superseded — this landed on main in the harness/switchboard shape via #780 and #701.

@gewenyu99 gewenyu99 closed this Jul 3, 2026
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