Repository navigation
feat(modes): add user-defined staged workflows - #2194
Merged
Merged
Conversation
Replace closed mode selection with validated definitions and durable staged\nrun coordination. Preserve the existing Plan approval flow and reuse the\nauthoritative claim and settlement design from the Goal contribution. Co-authored-by: new-Beginner <[email protected]>
# Conflicts: # docs/adr/README.md
Exercise staged workflows against an isolated real Host and retain normal\npermission approval in continuation tests. Update existing IPC fixtures for\nthe mode coordinator and document the storage and RPC contracts.
# Conflicts: # docs/spec/06-delivery/04-e2e-test-plan.md
Keep workspace and approval assertions for Plan while checking the explicit\nrejection of retired Goal proposals. Remove redundant snapshot error closures\nso this feature adds no Clippy warnings.
# Conflicts: # docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
Use the supported v-pre container so double-brace workflow variables remain\nliteral with raw HTML disabled. Keep the site-wide HTML restriction intact.
# Conflicts: # docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
This was referenced Nov 8, 2026
yg2224
pushed a commit
to yg2224/PI-Desktop
that referenced
this pull request
Nov 9, 2026
The staged-mode redesign (vastsa#2194) kept the durable Goal engine but dropped several controls that vastsa#1999 / vastsa#2141 and issue vastsa#1995 asked for. This adds them back on top of the mode run engine: edit the objective and budget of an open run (modes.update, effective from the next claim), a per-run and a settings default Goal budget (goalBudget), Remove as distinct from Stop, a bounded closeout when a running turn is paused, and hiding the task dock while a Goal run is open. The closeout and Remove reach the running turn through a new sidecar notice (agent.modeTurnNotice); both are system-side and never fake a user message. A CompleteStage from a turn claimed for an edited objective is refused with MODE_INPUT_CHANGED, and the next turn is told the objective changed. All contract changes are additive. Refs vastsa#1995
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
Introduce global user-defined modes (
~/.pi/modes/<id>/mode.md) with simple prompts or staged workflows, artifact checks, approval and command gates, compaction injection, and durable run controls. The existing Plan proposal pipeline stays intact. Goal uses the staged run engine rather than the retired Goal negotiation flow.Host-core remains authoritative for definition snapshots, stage transitions, claims, permissions, budgets and settlement. Host-started turns cap Auto at Accept edits. Staged workflows are local-workspace only. Builtin mode ids are reserved; settings can duplicate them under a user id.
Original contribution and attribution
This is the maintainer-directed redesign of #1999 / #2140 / #2141, discussed in this task with explicit authorization to take the work over. The durable claim, revision-CAS, budget and settlement design originates from new-Beginner. The implementation commit retains
Co-authored-by: new-Beginner <[email protected]>and the ported modules/ADR identify the source. No contributor branch was rewritten or force-pushed. The original PRs remain untouched until this replacement lands.Verification
The macOS review-path test fails on unchanged main under the default
/vartemporary path; both baseline and candidate were checked. Candidate Rust validation uses an isolated canonical scratch temporary directory and passes. An initially hanging mode RPC fixture was fixed to answer the real permission request, without weakening the permission cap or extending a timeout.No paid model API, user-running Desktop instance,
verify:ui:*, or release installation was used. PR checks and the integration candidate still gate landing.