@mediadatafusion/pi-workflow-suite 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +9 -9
- package/VERSION +1 -1
- package/config/prompts/mission-repair.md +3 -1
- package/config/prompts/workflow-repair.md +4 -2
- package/extensions/workflow-model-router.ts +88 -55
- package/extensions/workflow-modes.ts +363 -66
- package/package.json +1 -1
- package/scripts/verify-live.sh +46 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
All notable public releases will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.0.16] - 2026-06-09
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed Plan Mode recovery so interrupted or resumed workflows return to the correct state more reliably.
|
|
10
|
+
- Fixed Standard Mode completion cleanup to prevent stale active-status indicators after work is complete.
|
|
11
|
+
- Fixed workflow preset behavior so presets preserve user-selected model-routing preferences.
|
|
12
|
+
- Improved compaction recovery for continued workflow sessions.
|
|
13
|
+
- Refined repair flow handling so advisory follow-up notes do not unnecessarily block continued progress.
|
|
14
|
+
|
|
15
|
+
### Improved
|
|
16
|
+
|
|
17
|
+
- Improved overall workflow reliability across Plan, Standard, and repair flows.
|
|
18
|
+
|
|
19
|
+
## [0.0.15] - 2026-06-09
|
|
20
|
+
|
|
21
|
+
### Improved
|
|
22
|
+
|
|
23
|
+
- Improved Plan Mode approval handoffs so approval-ready plans remain visible while action menus are open.
|
|
24
|
+
- Refined the Deep Plan preset so reviewer review remains available without automatically starting by default.
|
|
25
|
+
- Improved workflow recovery around transient connection interruptions so Plan, Mission, and Standard workflows are easier to resume after short transport failures.
|
|
26
|
+
|
|
27
|
+
### Hardened
|
|
28
|
+
|
|
29
|
+
- Expanded regression coverage for reviewer routing, sub-agent handoffs, package command surfaces, and interruption recovery.
|
|
30
|
+
|
|
5
31
|
## [0.0.14] - 2026-06-08
|
|
6
32
|
|
|
7
33
|
### Fixed
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](#installation) [](#quick-start) [](#core-commands) [](#settings-reference)
|
|
6
6
|
|
|
7
|
-
**Workflow Suite Version:** `v0.0.
|
|
7
|
+
**Workflow Suite Version:** `v0.0.16`
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
@@ -578,15 +578,15 @@ Mission: approval-gated, auto-run after approval, standard planning, milestone v
|
|
|
578
578
|
|
|
579
579
|
Deep — Careful
|
|
580
580
|
Plan: deep, asks clarification for non-trivial work
|
|
581
|
-
Review: automatic
|
|
582
|
-
Validation: automatic
|
|
581
|
+
Review: manual/optional; not automatic before execution
|
|
582
|
+
Validation: automatic after execution
|
|
583
583
|
Sub-agents: forced larger teams across planning/execution/repair/review/validation
|
|
584
584
|
Mission: deep planning with final validation
|
|
585
585
|
|
|
586
586
|
Maximum — Thorough
|
|
587
587
|
Plan: maximum
|
|
588
588
|
Review: automatic
|
|
589
|
-
Validation: automatic
|
|
589
|
+
Validation: automatic after execution
|
|
590
590
|
Sub-agents: forced maximum teams across planning/execution/repair/review/validation
|
|
591
591
|
Mission: supervised auto, final validation, higher retry budget
|
|
592
592
|
```
|
|
@@ -1007,8 +1007,8 @@ pi install -l npm:@mediadatafusion/pi-workflow-suite
|
|
|
1007
1007
|
### Installing specific versions
|
|
1008
1008
|
|
|
1009
1009
|
```bash
|
|
1010
|
-
pi install npm:@mediadatafusion/pi-workflow-suite@0.0.
|
|
1011
|
-
pi install -l npm:@mediadatafusion/pi-workflow-suite@0.0.
|
|
1010
|
+
pi install npm:@mediadatafusion/pi-workflow-suite@0.0.16
|
|
1011
|
+
pi install -l npm:@mediadatafusion/pi-workflow-suite@0.0.16
|
|
1012
1012
|
```
|
|
1013
1013
|
|
|
1014
1014
|
An unversioned install follows normal update behavior: `pi update` and `pi update --extensions` will pick up new package releases. A versioned install pins the package to that version. Pinned package specs are intentionally skipped by Pi's normal package update commands. To move a pinned install to a newer version, reinstall with the desired version. To switch back to latest tracking, use the unversioned install command without `@<version>`.
|
|
@@ -1214,10 +1214,10 @@ See `docs/TROUBLESHOOTING.md` for detailed diagnostics.
|
|
|
1214
1214
|
|
|
1215
1215
|
## Versioning
|
|
1216
1216
|
|
|
1217
|
-
The current preparation version is `v0.0.
|
|
1217
|
+
The current preparation version is `v0.0.16`. Version information is intentionally aligned across:
|
|
1218
1218
|
|
|
1219
|
-
- `VERSION` (`v0.0.
|
|
1220
|
-
- `package.json` (`0.0.
|
|
1219
|
+
- `VERSION` (`v0.0.16`),
|
|
1220
|
+
- `package.json` (`0.0.16`),
|
|
1221
1221
|
- `package-lock.json`,
|
|
1222
1222
|
- this README,
|
|
1223
1223
|
- Workflow Suite settings/about output.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v0.0.
|
|
1
|
+
v0.0.16
|
|
@@ -4,7 +4,7 @@ MANDATORY STRUCTURED HANDOFF: call workflow_repair_result before final response
|
|
|
4
4
|
|
|
5
5
|
You are PI MISSION MODE REPAIR EXECUTOR.
|
|
6
6
|
|
|
7
|
-
Repair
|
|
7
|
+
Repair concrete validator-identified failures for the current mission milestone and keep going while fixes are in-scope and non-destructive. Do not re-grade validation; only Mission validation can pass repaired work.
|
|
8
8
|
|
|
9
9
|
Rules:
|
|
10
10
|
- Only fix concrete issues directly related to the failed milestone validation.
|
|
@@ -32,6 +32,8 @@ Use only these exact installed agent names when calling the subagent tool. Do no
|
|
|
32
32
|
- Do not create arbitrary repository-root files. A root file is allowed only when the mission plan, user request, or validator finding names that exact root path.
|
|
33
33
|
- If a current-task-created file is in the wrong location but contains recoverable work, move or rename it to the correct approved location instead of deleting it.
|
|
34
34
|
- Treat untracked, unexpected, or ambiguous files as possibly user-owned; do not delete, overwrite, move, or clean them without explicit approval for that exact file.
|
|
35
|
+
- Do not set `needsUserApproval` for advisory-only follow-up, credential rotation recommendations, preserved ambiguous files, manual QA still needed, or pre-existing project debt. Put those in the summary/safety notes and let revalidation run.
|
|
36
|
+
- Set `needsUserApproval` only when a concrete hard-safety action or artifact disposition should pause automatic revalidation.
|
|
35
37
|
- Keep file writes sequential unless workflow settings explicitly allow safe scoped parallel edits.
|
|
36
38
|
- Preserve checkpoint integrity and disclose moved, preserved, deleted, root, and possibly user-owned files.
|
|
37
39
|
|
|
@@ -6,7 +6,7 @@ You are PI WORKFLOW REPAIR MODE.
|
|
|
6
6
|
|
|
7
7
|
Available tools in repair mode: edit, write, bash, workflow_diagram, workflow_progress, workflow_repair_result. The workflow_repair_result tool IS registered and active. If you cannot see it in your tool list, re-check — it is available. You MUST call it with your repair summary before finishing. Do not output a prose-only repair report; use the typed handoff tool.
|
|
8
8
|
|
|
9
|
-
Repair
|
|
9
|
+
Repair concrete validator-identified failed validation items for the approved Plan Mode workflow and keep going while fixes are in-scope and non-destructive. Do not re-grade validation; only the validator/revalidator can declare PASS.
|
|
10
10
|
|
|
11
11
|
Rules:
|
|
12
12
|
- The approved plan is still the execution contract.
|
|
@@ -14,11 +14,13 @@ Rules:
|
|
|
14
14
|
- Do not perform unrelated refactors.
|
|
15
15
|
- Do not commit, push, deploy, or mutate databases.
|
|
16
16
|
- Do not edit secrets, auth/session files, runtime logs/state, `.env`, `.factory`, or `.cursor` files.
|
|
17
|
-
- Stop and report if the repair requires destructive, out-of-scope, secret-adjacent, deployment, database, or otherwise risky action.
|
|
17
|
+
- Stop and report if the repair requires destructive, out-of-scope, secret-adjacent, deployment, database, protected runtime/auth/session, or otherwise truly risky action.
|
|
18
18
|
- Do not create arbitrary repository-root files. A root file is allowed only when the approved plan, user request, or validator finding names that exact root path.
|
|
19
19
|
- If a current-task-created file is in the wrong location but contains recoverable work, move or rename it to the correct approved location instead of deleting it.
|
|
20
20
|
- Treat untracked, unexpected, or ambiguous files as possibly user-owned; do not delete, overwrite, move, or clean them without explicit approval for that exact file.
|
|
21
21
|
- If the validation finding is only manual/visual/browser verification or says no code repair is needed, do not change code; summarize manual QA/revalidation readiness.
|
|
22
|
+
- Do not set `needsUserApproval` for advisory-only follow-up, credential rotation recommendations, preserved ambiguous files, manual QA still needed, or pre-existing project debt. Put those in the summary/safety notes and let revalidation run.
|
|
23
|
+
- Set `needsUserApproval` only when a concrete hard-safety action or artifact disposition should pause automatic revalidation.
|
|
22
24
|
- Use repair sub-agents aggressively for failure triage, missing-file inspection, patch planning, and validation preparation when policy allows/requires them.
|
|
23
25
|
|
|
24
26
|
## Available Sub-Agent Types
|
|
@@ -280,8 +280,8 @@ export interface WorkflowPresetBundle {
|
|
|
280
280
|
description?: string;
|
|
281
281
|
planning?: Partial<WorkflowSettings["planning"]>;
|
|
282
282
|
workflow?: Partial<WorkflowSettings["workflow"]>;
|
|
283
|
-
standard?: Partial<Omit<WorkflowSettings["standard"], "models"
|
|
284
|
-
missions?: Partial<Omit<WorkflowSettings["missions"], "models">>;
|
|
283
|
+
standard?: Partial<Omit<WorkflowSettings["standard"], "models" | "useSharedExecutorModel" | "useStandardSpecificModels" | "modelRole">>;
|
|
284
|
+
missions?: Partial<Omit<WorkflowSettings["missions"], "models" | "useMissionSpecificModels">>;
|
|
285
285
|
subagents?: Partial<WorkflowSettings["subagents"]>;
|
|
286
286
|
ui?: Partial<WorkflowSettings["ui"]>;
|
|
287
287
|
}
|
|
@@ -801,29 +801,55 @@ interface UpdateSettingsOptions {
|
|
|
801
801
|
preserveActivePreset?: boolean;
|
|
802
802
|
}
|
|
803
803
|
|
|
804
|
-
export const
|
|
804
|
+
export const WORKFLOW_CUSTOM_PRESET_MARKER = "custom";
|
|
805
|
+
|
|
806
|
+
function standardSettingsWithoutModelRouting(standard?: Partial<WorkflowSettings["standard"]>): Partial<WorkflowSettings["standard"]> {
|
|
807
|
+
const {
|
|
808
|
+
models: _ignoredModels,
|
|
809
|
+
useSharedExecutorModel: _ignoredUseSharedExecutorModel,
|
|
810
|
+
useStandardSpecificModels: _ignoredUseStandardSpecificModels,
|
|
811
|
+
modelRole: _ignoredModelRole,
|
|
812
|
+
...standardWithoutModelRouting
|
|
813
|
+
} = standard ?? {};
|
|
814
|
+
return standardWithoutModelRouting;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function missionSettingsWithoutModelRouting(missions?: Partial<WorkflowSettings["missions"]>): Partial<WorkflowSettings["missions"]> {
|
|
818
|
+
const {
|
|
819
|
+
models: _ignoredModels,
|
|
820
|
+
useMissionSpecificModels: _ignoredUseMissionSpecificModels,
|
|
821
|
+
...missionsWithoutModelRouting
|
|
822
|
+
} = missions ?? {};
|
|
823
|
+
return missionsWithoutModelRouting;
|
|
824
|
+
}
|
|
805
825
|
|
|
806
826
|
function presetOwnedSettingsSignature(settings: WorkflowSettings): string {
|
|
807
|
-
const { models: _ignoredStandardModels, ...standardWithoutModels } = settings.standard;
|
|
808
|
-
const { models: _ignoredMissionModels, ...missionsWithoutModels } = settings.missions;
|
|
809
827
|
return JSON.stringify({
|
|
810
828
|
planning: settings.planning,
|
|
811
829
|
workflow: settings.workflow,
|
|
812
|
-
standard:
|
|
813
|
-
missions:
|
|
830
|
+
standard: standardSettingsWithoutModelRouting(settings.standard),
|
|
831
|
+
missions: missionSettingsWithoutModelRouting(settings.missions),
|
|
814
832
|
subagents: settings.subagents,
|
|
815
833
|
});
|
|
816
834
|
}
|
|
817
835
|
|
|
818
836
|
function applyActivePresetOverlay(settings: WorkflowSettings): WorkflowSettings {
|
|
819
|
-
const active = settings.presets?.activePreset ??
|
|
820
|
-
if (active ===
|
|
837
|
+
const active = settings.presets?.activePreset ?? WORKFLOW_CUSTOM_PRESET_MARKER;
|
|
838
|
+
if (active === WORKFLOW_CUSTOM_PRESET_MARKER) return settings;
|
|
821
839
|
const preset = workflowPresetCatalog(settings)[active];
|
|
822
840
|
if (!preset) return settings;
|
|
823
841
|
const defaults = defaultWorkflowSettings();
|
|
824
842
|
const normalized = normalizeWorkflowPresetBundle(preset);
|
|
825
|
-
const
|
|
826
|
-
|
|
843
|
+
const currentStandardModelRouting = {
|
|
844
|
+
models: settings.standard.models,
|
|
845
|
+
useSharedExecutorModel: settings.standard.useSharedExecutorModel,
|
|
846
|
+
useStandardSpecificModels: settings.standard.useStandardSpecificModels,
|
|
847
|
+
modelRole: settings.standard.modelRole,
|
|
848
|
+
};
|
|
849
|
+
const currentMissionModelRouting = {
|
|
850
|
+
models: settings.missions.models,
|
|
851
|
+
useMissionSpecificModels: settings.missions.useMissionSpecificModels,
|
|
852
|
+
};
|
|
827
853
|
return {
|
|
828
854
|
...settings,
|
|
829
855
|
planning: normalized.planning ? { ...settings.planning, ...normalized.planning } : settings.planning,
|
|
@@ -833,9 +859,9 @@ function applyActivePresetOverlay(settings: WorkflowSettings): WorkflowSettings
|
|
|
833
859
|
...settings.standard,
|
|
834
860
|
...normalized.standard,
|
|
835
861
|
subagents: { ...(defaults.standard.subagents ?? {}), ...(settings.standard.subagents ?? {}), ...(normalized.standard.subagents ?? {}) },
|
|
836
|
-
|
|
862
|
+
...currentStandardModelRouting,
|
|
837
863
|
},
|
|
838
|
-
missions: normalized.missions ? { ...settings.missions, ...normalized.missions,
|
|
864
|
+
missions: normalized.missions ? { ...settings.missions, ...normalized.missions, ...currentMissionModelRouting } : settings.missions,
|
|
839
865
|
subagents: normalized.subagents ? { ...settings.subagents, ...normalized.subagents } : settings.subagents,
|
|
840
866
|
presets: settings.presets,
|
|
841
867
|
};
|
|
@@ -923,12 +949,12 @@ export function createProjectSettingsOverride(cwd: string): SettingsWriteResult
|
|
|
923
949
|
export function updateSettings(cwd: string, requestedScope: WorkflowSettingsScope | undefined, updater: (settings: WorkflowSettings) => void, options: UpdateSettingsOptions = {}): SettingsWriteResult {
|
|
924
950
|
const target = getWriteTarget(cwd, requestedScope);
|
|
925
951
|
const settings = target.scope === "global" ? loadGlobalSettings() : loadEffectiveSettings(cwd).settings;
|
|
926
|
-
const beforePreset = settings.presets?.activePreset ??
|
|
952
|
+
const beforePreset = settings.presets?.activePreset ?? WORKFLOW_CUSTOM_PRESET_MARKER;
|
|
927
953
|
const beforePresetOwned = presetOwnedSettingsSignature(settings);
|
|
928
954
|
updater(settings);
|
|
929
955
|
const afterPresetOwned = presetOwnedSettingsSignature(settings);
|
|
930
|
-
if (!options.preserveActivePreset && beforePreset !==
|
|
931
|
-
settings.presets = { ...(settings.presets ?? {}), activePreset:
|
|
956
|
+
if (!options.preserveActivePreset && beforePreset !== WORKFLOW_CUSTOM_PRESET_MARKER && settings.presets?.activePreset === beforePreset && beforePresetOwned !== afterPresetOwned) {
|
|
957
|
+
settings.presets = { ...(settings.presets ?? {}), activePreset: WORKFLOW_CUSTOM_PRESET_MARKER, items: { ...(settings.presets?.items ?? {}) } };
|
|
932
958
|
}
|
|
933
959
|
saveSettingsFile(target.file, settings);
|
|
934
960
|
return { settings, scope: target.scope, file: target.file };
|
|
@@ -941,7 +967,7 @@ export function builtInWorkflowPresets(): Record<string, WorkflowPresetBundle> {
|
|
|
941
967
|
description: "Fast end-to-end Plan/Mission/Standard workflow with minimal ceremony, automatic validation when work runs, low safe repair retries, and one-worker sub-agent support.",
|
|
942
968
|
planning: { depth: "fast", clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationQualityGate: false, useSubagentsBeforeClarification: true },
|
|
943
969
|
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: false, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: false, autoRepairValidationFailures: true, reviewRetryMode: "off", validationRetryMode: "safe_only", maxReviewRetriesPerPlan: 0, maxReviewRetriesPerWorkflow: 0, maxValidationRetriesPerPlan: 1, maxValidationRetriesPerWorkflow: 2, pauseAfterReviewFailure: true, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
944
|
-
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 1, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: false, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: false, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "auto", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 1, minExecutionWorkersForMaximum: 1, minRepairWorkersForDeep: 1, minRepairWorkersForMaximum: 1, minReviewWorkersForDeep: 1, minReviewWorkersForMaximum: 1, minValidationWorkersForDeep: 1, minValidationWorkersForMaximum: 1 }, statusWidgetVisible: true
|
|
970
|
+
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 1, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: false, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: false, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "auto", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 1, minExecutionWorkersForMaximum: 1, minRepairWorkersForDeep: 1, minRepairWorkersForMaximum: 1, minReviewWorkersForDeep: 1, minReviewWorkersForMaximum: 1, minValidationWorkersForDeep: 1, minValidationWorkersForMaximum: 1 }, statusWidgetVisible: true },
|
|
945
971
|
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "auto", maxClarificationQuestions: 2, planningDepth: "fast", useSubagentsBeforeClarification: true, autoRepairReviewFailures: false, reviewRetryMode: "off", maxReviewRetriesPerMission: 0, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 1, maxValidationRetriesPerMission: 2, finalValidationEnabled: false, autoRepairFinalValidationFailures: false, maxFinalValidationRetries: 0, subagentPolicy: "forced", minWorkersForDeep: 1, minWorkersForMaximum: 1 },
|
|
946
972
|
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "auto", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 1, minExecutionWorkersForMaximum: 1, minRepairWorkersForDeep: 1, minRepairWorkersForMaximum: 1, minReviewWorkersForDeep: 1, minReviewWorkersForMaximum: 1, minValidationWorkersForDeep: 1, minValidationWorkersForMaximum: 1, allowBackgroundSubagents: false },
|
|
947
973
|
},
|
|
@@ -950,16 +976,16 @@ export function builtInWorkflowPresets(): Record<string, WorkflowPresetBundle> {
|
|
|
950
976
|
description: "Default end-to-end workflow with useful clarification, automatic execution/validation after approval, safe repair retries, and balanced worker support.",
|
|
951
977
|
planning: { depth: "standard", clarificationMode: "auto", maxClarificationQuestions: 3, interactiveClarificationEnabled: true, clarificationQualityGate: true, useSubagentsBeforeClarification: true },
|
|
952
978
|
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: false, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: true, autoRepairValidationFailures: true, reviewRetryMode: "safe_only", validationRetryMode: "safe_only", maxReviewRetriesPerPlan: 2, maxReviewRetriesPerWorkflow: 4, maxValidationRetriesPerPlan: 2, maxValidationRetriesPerWorkflow: 4, pauseAfterReviewFailure: false, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
953
|
-
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 1, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: false, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 2, minExecutionWorkersForMaximum: 2, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 2, minReviewWorkersForMaximum: 2, minValidationWorkersForDeep: 2, minValidationWorkersForMaximum: 2 }, statusWidgetVisible: true
|
|
979
|
+
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 1, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: false, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 2, minExecutionWorkersForMaximum: 2, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 2, minReviewWorkersForMaximum: 2, minValidationWorkersForDeep: 2, minValidationWorkersForMaximum: 2 }, statusWidgetVisible: true },
|
|
954
980
|
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "auto", maxClarificationQuestions: 3, planningDepth: "standard", useSubagentsBeforeClarification: true, autoRepairReviewFailures: true, reviewRetryMode: "safe_only", maxReviewRetriesPerMission: 2, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 2, maxValidationRetriesPerMission: 6, finalValidationEnabled: false, autoRepairFinalValidationFailures: false, maxFinalValidationRetries: 1, subagentPolicy: "forced", minWorkersForDeep: 1, minWorkersForMaximum: 1 },
|
|
955
981
|
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 2, minExecutionWorkersForMaximum: 2, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 2, minReviewWorkersForMaximum: 2, minValidationWorkersForDeep: 2, minValidationWorkersForMaximum: 2, allowBackgroundSubagents: false },
|
|
956
982
|
},
|
|
957
983
|
deep: {
|
|
958
984
|
displayName: "Deep",
|
|
959
|
-
description: "Careful end-to-end workflow for risky or codebase-heavy work with stronger clarification, automatic
|
|
985
|
+
description: "Careful end-to-end workflow for risky or codebase-heavy work with stronger clarification, manual Plan review, automatic validation, final mission validation, and larger worker teams.",
|
|
960
986
|
planning: { depth: "deep", clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 5, interactiveClarificationEnabled: true, clarificationQualityGate: true, useSubagentsBeforeClarification: true },
|
|
961
|
-
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute:
|
|
962
|
-
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: true, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 2, minPlanningWorkersForMaximum: 2, minExecutionWorkersForDeep: 3, minExecutionWorkersForMaximum: 3, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 3, minReviewWorkersForMaximum: 3, minValidationWorkersForDeep: 3, minValidationWorkersForMaximum: 3 }, statusWidgetVisible: true
|
|
987
|
+
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: false, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: true, autoRepairValidationFailures: true, reviewRetryMode: "safe_only", validationRetryMode: "safe_only", maxReviewRetriesPerPlan: 3, maxReviewRetriesPerWorkflow: 6, maxValidationRetriesPerPlan: 3, maxValidationRetriesPerWorkflow: 6, pauseAfterReviewFailure: false, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
988
|
+
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: true, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 2, minPlanningWorkersForMaximum: 2, minExecutionWorkersForDeep: 3, minExecutionWorkersForMaximum: 3, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 3, minReviewWorkersForMaximum: 3, minValidationWorkersForDeep: 3, minValidationWorkersForMaximum: 3 }, statusWidgetVisible: true },
|
|
963
989
|
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 5, planningDepth: "deep", useSubagentsBeforeClarification: true, autoRepairReviewFailures: true, reviewRetryMode: "safe_only", maxReviewRetriesPerMission: 3, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 3, maxValidationRetriesPerMission: 8, finalValidationEnabled: true, autoRepairFinalValidationFailures: true, maxFinalValidationRetries: 2, subagentPolicy: "forced", minWorkersForDeep: 3, minWorkersForMaximum: 3 },
|
|
964
990
|
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 3, minPlanningWorkersForMaximum: 3, minExecutionWorkersForDeep: 3, minExecutionWorkersForMaximum: 3, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 3, minReviewWorkersForMaximum: 3, minValidationWorkersForDeep: 3, minValidationWorkersForMaximum: 3, allowBackgroundSubagents: true },
|
|
965
991
|
},
|
|
@@ -968,7 +994,7 @@ export function builtInWorkflowPresets(): Record<string, WorkflowPresetBundle> {
|
|
|
968
994
|
description: "Highest-rigor end-to-end workflow with strongest clarification, automatic review/validation, final mission validation, aggressive in-scope repair, and maximum worker teams.",
|
|
969
995
|
planning: { depth: "maximum", clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 5, interactiveClarificationEnabled: true, clarificationQualityGate: true, useSubagentsBeforeClarification: true },
|
|
970
996
|
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: true, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: true, autoRepairValidationFailures: true, reviewRetryMode: "aggressive_within_scope", validationRetryMode: "aggressive_within_scope", maxReviewRetriesPerPlan: 5, maxReviewRetriesPerWorkflow: 8, maxValidationRetriesPerPlan: 5, maxValidationRetriesPerWorkflow: 8, pauseAfterReviewFailure: false, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
971
|
-
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: true, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 3, minPlanningWorkersForMaximum: 3, minExecutionWorkersForDeep: 4, minExecutionWorkersForMaximum: 4, minRepairWorkersForDeep: 3, minRepairWorkersForMaximum: 3, minReviewWorkersForDeep: 4, minReviewWorkersForMaximum: 4, minValidationWorkersForDeep: 4, minValidationWorkersForMaximum: 4 }, statusWidgetVisible: true
|
|
997
|
+
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: true, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 3, minPlanningWorkersForMaximum: 3, minExecutionWorkersForDeep: 4, minExecutionWorkersForMaximum: 4, minRepairWorkersForDeep: 3, minRepairWorkersForMaximum: 3, minReviewWorkersForDeep: 4, minReviewWorkersForMaximum: 4, minValidationWorkersForDeep: 4, minValidationWorkersForMaximum: 4 }, statusWidgetVisible: true },
|
|
972
998
|
missions: { defaultAutonomy: "supervised_auto", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 6, planningDepth: "maximum", useSubagentsBeforeClarification: true, autoRepairReviewFailures: true, reviewRetryMode: "aggressive_within_scope", maxReviewRetriesPerMission: 5, autoRepairValidationFailures: true, validationRetryMode: "aggressive_within_scope", maxValidationRetriesPerMilestone: 4, maxValidationRetriesPerMission: 12, finalValidationEnabled: true, autoRepairFinalValidationFailures: true, maxFinalValidationRetries: 4, subagentPolicy: "forced", minWorkersForDeep: 4, minWorkersForMaximum: 4 },
|
|
973
999
|
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 4, minPlanningWorkersForMaximum: 4, minExecutionWorkersForDeep: 4, minExecutionWorkersForMaximum: 4, minRepairWorkersForDeep: 3, minRepairWorkersForMaximum: 3, minReviewWorkersForDeep: 4, minReviewWorkersForMaximum: 4, minValidationWorkersForDeep: 4, minValidationWorkersForMaximum: 4, allowBackgroundSubagents: true },
|
|
974
1000
|
},
|
|
@@ -977,35 +1003,43 @@ export function builtInWorkflowPresets(): Record<string, WorkflowPresetBundle> {
|
|
|
977
1003
|
|
|
978
1004
|
function normalizeWorkflowPresetBundle(preset: WorkflowPresetBundle): WorkflowPresetBundle & { standard: WorkflowSettings["standard"] } {
|
|
979
1005
|
const defaults = defaultWorkflowSettings();
|
|
980
|
-
const
|
|
1006
|
+
const standardWithoutModelRouting = standardSettingsWithoutModelRouting(preset.standard as Partial<WorkflowSettings["standard"]> | undefined);
|
|
981
1007
|
return {
|
|
982
1008
|
...preset,
|
|
983
1009
|
// Legacy custom presets saved before Standard Mode do not contain a
|
|
984
1010
|
// standard section. Hydrate it from safe defaults during apply so stale
|
|
985
1011
|
// Standard settings from the previously active preset cannot leak forward.
|
|
986
|
-
standard: normalizeStandardSettings(defaults, defaults.standard,
|
|
1012
|
+
standard: normalizeStandardSettings(defaults, defaults.standard, standardWithoutModelRouting as Partial<WorkflowSettings>["standard"] | undefined),
|
|
1013
|
+
missions: missionSettingsWithoutModelRouting(preset.missions as Partial<WorkflowSettings["missions"]> | undefined),
|
|
987
1014
|
};
|
|
988
1015
|
}
|
|
989
1016
|
|
|
990
1017
|
function workflowPresetBundleWithoutUserOwnedSettings(preset: WorkflowPresetBundle): WorkflowPresetBundle {
|
|
991
1018
|
const { context: _ignoredContext, ...presetWithoutContext } = preset as WorkflowPresetBundle & { context?: unknown };
|
|
992
|
-
const { models: _ignoredStandardModels, ...standardWithoutModels } = (preset.standard ?? {}) as Partial<WorkflowSettings["standard"]>;
|
|
993
|
-
const { models: _ignoredMissionModels, ...missionsWithoutModels } = (preset.missions ?? {}) as Partial<WorkflowSettings["missions"]>;
|
|
994
1019
|
return {
|
|
995
1020
|
...presetWithoutContext,
|
|
996
|
-
standard: { ...
|
|
997
|
-
missions: { ...
|
|
1021
|
+
standard: { ...standardSettingsWithoutModelRouting(preset.standard as Partial<WorkflowSettings["standard"]> | undefined) },
|
|
1022
|
+
missions: { ...missionSettingsWithoutModelRouting(preset.missions as Partial<WorkflowSettings["missions"]> | undefined) },
|
|
998
1023
|
};
|
|
999
1024
|
}
|
|
1000
1025
|
|
|
1001
1026
|
function applyPresetBundle(settings: WorkflowSettings, preset: WorkflowPresetBundle, name: string): void {
|
|
1002
1027
|
const defaults = defaultWorkflowSettings();
|
|
1003
1028
|
const normalized = normalizeWorkflowPresetBundle(preset);
|
|
1004
|
-
const
|
|
1029
|
+
const currentStandardModelRouting = {
|
|
1030
|
+
models: settings.standard.models,
|
|
1031
|
+
useSharedExecutorModel: settings.standard.useSharedExecutorModel,
|
|
1032
|
+
useStandardSpecificModels: settings.standard.useStandardSpecificModels,
|
|
1033
|
+
modelRole: settings.standard.modelRole,
|
|
1034
|
+
};
|
|
1035
|
+
const currentMissionModelRouting = {
|
|
1036
|
+
models: settings.missions.models,
|
|
1037
|
+
useMissionSpecificModels: settings.missions.useMissionSpecificModels,
|
|
1038
|
+
};
|
|
1005
1039
|
if (normalized.planning) settings.planning = { ...settings.planning, ...normalized.planning };
|
|
1006
1040
|
if (normalized.workflow) settings.workflow = { ...settings.workflow, ...normalized.workflow };
|
|
1007
|
-
settings.standard = { ...defaults.standard, ...normalized.standard, subagents: { ...(defaults.standard.subagents ?? {}), ...(normalized.standard?.subagents ?? {}) },
|
|
1008
|
-
if (normalized.missions) settings.missions = { ...settings.missions, ...normalized.missions,
|
|
1041
|
+
settings.standard = { ...defaults.standard, ...normalized.standard, subagents: { ...(defaults.standard.subagents ?? {}), ...(normalized.standard?.subagents ?? {}) }, ...currentStandardModelRouting };
|
|
1042
|
+
if (normalized.missions) settings.missions = { ...settings.missions, ...normalized.missions, ...currentMissionModelRouting };
|
|
1009
1043
|
if (normalized.subagents) settings.subagents = { ...settings.subagents, ...normalized.subagents };
|
|
1010
1044
|
if (normalized.ui) settings.ui = { ...settings.ui, ...normalized.ui };
|
|
1011
1045
|
settings.presets = { ...(settings.presets ?? {}), activePreset: name, items: { ...(settings.presets?.items ?? {}) } };
|
|
@@ -1017,34 +1051,34 @@ export function normalizeWorkflowPresetName(name: string): string {
|
|
|
1017
1051
|
|
|
1018
1052
|
export function workflowPresetCatalog(settings: WorkflowSettings = loadGlobalSettings()): Record<string, WorkflowPresetBundle> {
|
|
1019
1053
|
const items = { ...(settings.presets?.items ?? {}) };
|
|
1020
|
-
delete items[
|
|
1054
|
+
delete items[WORKFLOW_CUSTOM_PRESET_MARKER];
|
|
1021
1055
|
return { ...builtInWorkflowPresets(), ...items };
|
|
1022
1056
|
}
|
|
1023
1057
|
|
|
1024
1058
|
export function workflowPresetNames(settings: WorkflowSettings = loadGlobalSettings()): string[] {
|
|
1025
1059
|
const builtIns = ["simple", "standard", "deep", "maximum"];
|
|
1026
1060
|
const custom = Object.keys(settings.presets?.items ?? {}).sort((a, b) => a.localeCompare(b));
|
|
1027
|
-
return [...builtIns, ...custom.filter((name) => name !==
|
|
1061
|
+
return [...builtIns, ...custom.filter((name) => name !== WORKFLOW_CUSTOM_PRESET_MARKER && !builtIns.includes(name))];
|
|
1028
1062
|
}
|
|
1029
1063
|
|
|
1030
1064
|
export function workflowPresetLabel(name: string, preset?: WorkflowPresetBundle): string {
|
|
1031
|
-
if (name ===
|
|
1065
|
+
if (name === WORKFLOW_CUSTOM_PRESET_MARKER) return "No active preset";
|
|
1032
1066
|
return preset?.displayName?.trim() || name;
|
|
1033
1067
|
}
|
|
1034
1068
|
|
|
1035
1069
|
export function workflowPresetTitle(name: string, preset?: WorkflowPresetBundle): string {
|
|
1036
|
-
if (name ===
|
|
1070
|
+
if (name === WORKFLOW_CUSTOM_PRESET_MARKER) return "No active preset";
|
|
1037
1071
|
return preset?.displayName?.trim() || name;
|
|
1038
1072
|
}
|
|
1039
1073
|
|
|
1040
1074
|
export function activeWorkflowPresetLabel(settings: WorkflowSettings): string {
|
|
1041
|
-
const active = settings.presets?.activePreset ??
|
|
1042
|
-
if (active ===
|
|
1075
|
+
const active = settings.presets?.activePreset ?? WORKFLOW_CUSTOM_PRESET_MARKER;
|
|
1076
|
+
if (active === WORKFLOW_CUSTOM_PRESET_MARKER) return "No active preset";
|
|
1043
1077
|
return workflowPresetLabel(active, workflowPresetCatalog(settings)[active]);
|
|
1044
1078
|
}
|
|
1045
1079
|
|
|
1046
1080
|
function assertValidCustomPresetName(name: string, safe: string): void {
|
|
1047
|
-
if (safe ===
|
|
1081
|
+
if (safe === WORKFLOW_CUSTOM_PRESET_MARKER) throw new Error(`Reserved workflow preset name: ${name}. Use a specific preset name instead of custom.`);
|
|
1048
1082
|
}
|
|
1049
1083
|
|
|
1050
1084
|
function sectionCoverage(section: unknown): "configured" | "missing" {
|
|
@@ -1052,9 +1086,9 @@ function sectionCoverage(section: unknown): "configured" | "missing" {
|
|
|
1052
1086
|
}
|
|
1053
1087
|
|
|
1054
1088
|
export function workflowPresetDiagnostics(name: string, preset?: WorkflowPresetBundle): string[] {
|
|
1055
|
-
if (name ===
|
|
1089
|
+
if (name === WORKFLOW_CUSTOM_PRESET_MARKER) return ["Diagnostic: reserved custom marker; no saved preset bundle is active."];
|
|
1056
1090
|
const lines: string[] = [];
|
|
1057
|
-
if (normalizeWorkflowPresetName(name) ===
|
|
1091
|
+
if (normalizeWorkflowPresetName(name) === WORKFLOW_CUSTOM_PRESET_MARKER) lines.push("Diagnostic: reserved-name collision; rename this preset before use.");
|
|
1058
1092
|
const standard = sectionCoverage(preset?.standard);
|
|
1059
1093
|
const planning = sectionCoverage(preset?.planning);
|
|
1060
1094
|
const workflow = sectionCoverage(preset?.workflow);
|
|
@@ -1077,15 +1111,15 @@ export function workflowPresetPickerLabel(name: string, preset?: WorkflowPresetB
|
|
|
1077
1111
|
const summaries: Record<string, string> = {
|
|
1078
1112
|
simple: "fast autonomous validation, low repair retries, 1-worker phases",
|
|
1079
1113
|
standard: "balanced autonomous validation and safe repair",
|
|
1080
|
-
deep: "careful
|
|
1114
|
+
deep: "careful manual review, autonomous validation, and final mission validation",
|
|
1081
1115
|
maximum: "maximum autonomous rigor with bounded aggressive repair",
|
|
1082
1116
|
};
|
|
1083
1117
|
return summaries[name] ? `${title} — ${summaries[name]}` : title;
|
|
1084
1118
|
}
|
|
1085
1119
|
|
|
1086
1120
|
export function workflowPresetMeaningLines(name: string, preset?: WorkflowPresetBundle): string[] {
|
|
1087
|
-
if (name ===
|
|
1088
|
-
"Name:
|
|
1121
|
+
if (name === WORKFLOW_CUSTOM_PRESET_MARKER) return [
|
|
1122
|
+
"Name: No active preset",
|
|
1089
1123
|
"Purpose: uses the current workflow settings exactly as saved; this is not a built-in speed or rigor profile.",
|
|
1090
1124
|
"Applies to: the Standard, Plan, Mission, and shared sub-agent settings currently saved in workflow-settings.json.",
|
|
1091
1125
|
"Standard Mode: uses the saved Standard Mode To Do, clarification, continuation, and sub-agent settings.",
|
|
@@ -1122,7 +1156,7 @@ export function workflowPresetMeaningLines(name: string, preset?: WorkflowPreset
|
|
|
1122
1156
|
"Purpose: higher-rigor built-in profile for broad, risky, or codebase-heavy work that still should not stall unnecessarily.",
|
|
1123
1157
|
"Applies to: Standard Mode, Plan Mode, Mission Mode, and shared sub-agent intensity.",
|
|
1124
1158
|
"Standard Mode: requires a To Do for substantive work, uses stronger clarification, resumes automatically after answers, and uses deeper Standard worker coverage.",
|
|
1125
|
-
"Plan Mode: uses deep planning, clarifies non-trivial work, avoids a second execution-approval stop after the initial approval,
|
|
1159
|
+
"Plan Mode: uses deep planning, clarifies non-trivial work, avoids a second execution-approval stop after the initial approval, leaves review manual/optional, runs validation automatically, and retries safe repairs.",
|
|
1126
1160
|
"Mission Mode: starts after approval, auto-runs after approval, continues milestones without pause, keeps milestone validation on, and enables final comprehensive validation.",
|
|
1127
1161
|
"Shared sub-agents: forces larger teams across planning, execution, repair, review, and validation.",
|
|
1128
1162
|
"Does not change: models/providers/API keys/auth/session/runtime state/shared compaction settings.",
|
|
@@ -1160,11 +1194,11 @@ export function renderWorkflowPresetCard(name: string, preset?: WorkflowPresetBu
|
|
|
1160
1194
|
}
|
|
1161
1195
|
|
|
1162
1196
|
export function renderActiveWorkflowPresetSummary(settings: WorkflowSettings): string {
|
|
1163
|
-
const active = settings.presets?.activePreset ??
|
|
1164
|
-
const preset = active ===
|
|
1197
|
+
const active = settings.presets?.activePreset ?? WORKFLOW_CUSTOM_PRESET_MARKER;
|
|
1198
|
+
const preset = active === WORKFLOW_CUSTOM_PRESET_MARKER ? undefined : workflowPresetCatalog(settings)[active];
|
|
1165
1199
|
const lines = workflowPresetMeaningLines(active, preset);
|
|
1166
1200
|
lines.push("Effective Settings: detailed current values are listed below.");
|
|
1167
|
-
if (active !==
|
|
1201
|
+
if (active !== WORKFLOW_CUSTOM_PRESET_MARKER) lines.push(`Reapply Command: /workflow presets apply ${active}`);
|
|
1168
1202
|
return lines.join("\n");
|
|
1169
1203
|
}
|
|
1170
1204
|
|
|
@@ -1184,10 +1218,10 @@ export function resolveWorkflowPresetName(settings: WorkflowSettings, input: str
|
|
|
1184
1218
|
|
|
1185
1219
|
export function renderWorkflowPresets(settings: WorkflowSettings = loadGlobalSettings()): string {
|
|
1186
1220
|
const catalog = workflowPresetCatalog(settings);
|
|
1187
|
-
const active = settings.presets?.activePreset ??
|
|
1221
|
+
const active = settings.presets?.activePreset ?? WORKFLOW_CUSTOM_PRESET_MARKER;
|
|
1188
1222
|
const names = workflowPresetNames(settings);
|
|
1189
|
-
const cards = [renderWorkflowPresetCard(
|
|
1190
|
-
return `# Workflow Presets\n\nActive Preset: ${activeWorkflowPresetLabel(settings)}\nShortcut: Ctrl+Shift+U cycles saved presets while Plan/Mission/Standard Mode is active\nSelector: /workflow presets\n\n${cards.join("\n\n") || "No presets available."}\n\nQuick commands:\n- /workflow presets list\n- /workflow presets apply <name>\n- /workflow presets next\n- /workflow presets prev\n- /workflow presets
|
|
1223
|
+
const cards = [renderWorkflowPresetCard(WORKFLOW_CUSTOM_PRESET_MARKER, undefined, active === WORKFLOW_CUSTOM_PRESET_MARKER), ...names.map((name) => renderWorkflowPresetCard(name, catalog[name], name === active))];
|
|
1224
|
+
return `# Workflow Presets\n\nActive Preset: ${activeWorkflowPresetLabel(settings)}\nShortcut: Ctrl+Shift+U cycles saved presets while Plan/Mission/Standard Mode is active\nSelector: /workflow presets\n\n${cards.join("\n\n") || "No presets available."}\n\nQuick commands:\n- /workflow presets list\n- /workflow presets apply <name>\n- /workflow presets next\n- /workflow presets prev\n- /workflow presets save <name>\n- /workflow presets create <name> from simple|standard|deep|maximum\n- /workflow presets edit <name>\n- /workflow presets rename <old> to <new>\n- /workflow presets delete <name>\n\nBuilt-in presets are package-defined and sync with the extension. User-named custom presets are saved entries in workflow-settings.json and stay in hotkey cycling. The reserved custom marker only means no built-in or user-named preset is active. Extension updates preserve workflow-settings.json and do not overwrite custom presets. Presets adjust workflow behavior only and preserve model/provider choices, API keys, auth/session files, runtime workflow state, and shared compaction settings.`;
|
|
1191
1225
|
}
|
|
1192
1226
|
|
|
1193
1227
|
export function applyWorkflowPreset(cwd: string, requestedScope: WorkflowSettingsScope | undefined, name: string): SettingsWriteResult {
|
|
@@ -1205,14 +1239,13 @@ export function saveCurrentWorkflowPreset(cwd: string, requestedScope: WorkflowS
|
|
|
1205
1239
|
assertValidCustomPresetName(name, safe);
|
|
1206
1240
|
return updateSettings(cwd, requestedScope, (settings) => {
|
|
1207
1241
|
settings.presets = { ...(settings.presets ?? {}), activePreset: safe, items: { ...(settings.presets?.items ?? {}) } };
|
|
1208
|
-
const { models: _ignoredStandardModels, ...standardPreset } = settings.standard;
|
|
1209
1242
|
settings.presets.items![safe] = {
|
|
1210
1243
|
displayName: name.trim(),
|
|
1211
1244
|
description: "Custom saved workflow preset.",
|
|
1212
1245
|
planning: { ...settings.planning },
|
|
1213
1246
|
workflow: { ...settings.workflow },
|
|
1214
|
-
standard: { ...
|
|
1215
|
-
missions: { ...settings.missions
|
|
1247
|
+
standard: { ...standardSettingsWithoutModelRouting(settings.standard) } as WorkflowPresetBundle["standard"],
|
|
1248
|
+
missions: { ...missionSettingsWithoutModelRouting(settings.missions) } as WorkflowPresetBundle["missions"],
|
|
1216
1249
|
subagents: { ...settings.subagents },
|
|
1217
1250
|
ui: { showWorkflowStatus: settings.ui.showWorkflowStatus, showPlanModeIndicator: settings.ui.showPlanModeIndicator, planTopWidgetVisible: settings.ui.planTopWidgetVisible, planBottomWidgetVisible: settings.ui.planBottomWidgetVisible, missionTopWidgetVisible: settings.ui.missionTopWidgetVisible, missionBottomWidgetVisible: settings.ui.missionBottomWidgetVisible, workflowTheme: settings.ui.workflowTheme, workflowThemeOverrides: settings.ui.workflowThemeOverrides, startupVisual: settings.ui.startupVisual, startupVisualOnSessionStart: settings.ui.startupVisualOnSessionStart, customBrandEnabled: settings.ui.customBrandEnabled, customBrandText: settings.ui.customBrandText },
|
|
1218
1251
|
};
|
|
@@ -1256,7 +1289,7 @@ export function deleteWorkflowPreset(cwd: string, requestedScope: WorkflowSettin
|
|
|
1256
1289
|
if (!resolved || builtInWorkflowPresets()[resolved]) throw new Error(`Cannot delete unknown or built-in workflow preset: ${name}`);
|
|
1257
1290
|
const items = { ...(settings.presets?.items ?? {}) };
|
|
1258
1291
|
delete items[resolved];
|
|
1259
|
-
settings.presets = { ...(settings.presets ?? {}), activePreset: settings.presets?.activePreset === resolved ?
|
|
1292
|
+
settings.presets = { ...(settings.presets ?? {}), activePreset: settings.presets?.activePreset === resolved ? WORKFLOW_CUSTOM_PRESET_MARKER : settings.presets?.activePreset, items };
|
|
1260
1293
|
}, { preserveActivePreset: true });
|
|
1261
1294
|
}
|
|
1262
1295
|
|
|
@@ -1413,7 +1446,7 @@ export function workflowSettingsConsistencyDiagnostics(settings: WorkflowSetting
|
|
|
1413
1446
|
if (settings.missions.autoRepairReviewFailures !== false && settings.missions.reviewRetryMode === "off") {
|
|
1414
1447
|
diagnostics.push("mission review auto-repair is enabled but reviewRetryMode is off — override to safe_only will be applied at runtime; set reviewRetryMode explicitly to avoid confusion");
|
|
1415
1448
|
}
|
|
1416
|
-
const activePreset = settings.presets?.activePreset ??
|
|
1449
|
+
const activePreset = settings.presets?.activePreset ?? WORKFLOW_CUSTOM_PRESET_MARKER;
|
|
1417
1450
|
if ((activePreset === "standard" || activePreset === "deep" || activePreset === "maximum")
|
|
1418
1451
|
&& (settings.missions.autoRepairReviewFailures === false || settings.missions.reviewRetryMode === "off" || (settings.missions.maxReviewRetriesPerMission ?? 0) <= 0)) {
|
|
1419
1452
|
diagnostics.push(`active preset ${activePreset} expects Mission review repair to be available, but effective Mission review repair is disabled/off/zero; reapply the preset or update missions.autoRepairReviewFailures, missions.reviewRetryMode, and missions.maxReviewRetriesPerMission`);
|