Repository navigation
refactor: add shared run state, control types and run routing - #1377
Closed
gewenyu99 wants to merge 4 commits into
Conversation
Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
🧙 Wizard CIRun 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:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
This was referenced Sep 29, 2026
gewenyu99
added this pull request to stack #1394
September 29, 2026 09:41
gewenyu99
force-pushed
the
posthog/functional-r9-03-add-the-session-store-and-run-contract-t
branch
from
September 30, 2026 08:06
98e08dc to
176d272
Compare
gewenyu99
removed this pull request from stack #1394
September 30, 2026 08:07
gewenyu99
force-pushed
the
posthog/functional-r9-03-add-the-session-store-and-run-contract-t
branch
from
September 30, 2026 08:44
176d272 to
4153102
Compare
Collaborator
Author
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.
Phase 2 of Release C (#1320), PR 2 of 17, after #1376. Review PR. PRs 1 to 15 of this phase split one change into reviewable pieces and compile only as a stack: review them one by one, then land the whole phase together.
Problem
On main, types and helpers that several layers need live in the wrong place:
RunOutcomeandOutroDatain the agent layer, the ask policy in its bootstrap, the MCP client installs insrc/steps. A layer that must not import those cannot reach them.Changes
New files, plus the test config.
src/shared:RunOutcome,RunPhase,ScanConsentandMcpOutcomeinrun-state.ts,OutroDataandOutroKindinoutro.ts,TaskStatusintask-status.ts. The agent layer re-exports them in refactor: move the agent, programs, tui, hosts, tools and cli onto the session store #1378.src/shared/control/types.ts(ControlTarget,ControlAction,ControlSetter,ControlHooks), with param checks inparams.tsand state redaction inredact.ts.shouldDisableAsk(ask-policy.ts),consoleLogandprintAbortOutro(console-log.ts),registerCleanup(utils/cleanup.ts),flushAnalytics,withScopeAdditions(oauth-scopes.ts), and the MCP client installs inmcp-clients/install.ts(addMCPServer,removeMCPServer,installPlugins).resolveRunConfig(src/agent/runner/switchboard/resolve-run.ts) turns a run'sroutinginto theResolvedRunConfigthe runner reads, and records the switchboard's pick.vitest.config.ts:tools,headlessandsharedprojects replacelegacy, the@lib,@uiand@stepsaliases go, tests write their own log file, andink-actualmaps the real Ink for tests that render.resolveRunConfig, which decides the harness, sequence and model, and onredact.ts, which decides what a control parent may read.Test plan
pnpm typecheck0 errors,pnpm lint0 errors, 3,459 tests pass,pnpm buildok.Created with PostHog Desktop