@selesai/code 0.8.6 → 0.8.8
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 +31 -1
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.js +11 -0
- package/dist/cli/args.test.d.ts +1 -0
- package/dist/cli/args.test.js +24 -0
- package/dist/core/agent-session.d.ts +4 -1
- package/dist/core/agent-session.js +18 -7
- package/dist/core/experimental.d.ts +4 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/extensions/types.d.ts +6 -0
- package/dist/core/keybindings.d.ts +24 -0
- package/dist/core/model-config.d.ts +5 -0
- package/dist/core/model-config.js +1 -0
- package/dist/core/project-trust.js +2 -2
- package/dist/core/provider-composer.js +17 -4
- package/dist/core/sdk.d.ts +5 -3
- package/dist/core/sdk.js +2 -1
- package/dist/core/session-manager.js +2 -2
- package/dist/core/settings-manager.d.ts +8 -0
- package/dist/core/settings-manager.js +15 -0
- package/dist/core/system-prompt.js +3 -9
- package/dist/core/system-prompt.test.js +6 -0
- package/dist/core/tools/bash.js +2 -0
- package/dist/core/tools/edit.js +2 -0
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/index.d.ts +1 -0
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/read.js +2 -0
- package/dist/core/tools/schema-prune.d.ts +16 -0
- package/dist/core/tools/schema-prune.js +39 -0
- package/dist/core/tools/schema-prune.test.d.ts +1 -0
- package/dist/core/tools/schema-prune.test.js +111 -0
- package/dist/core/tools/write.js +2 -0
- package/dist/defaults/settings.json +1 -0
- package/dist/extensions/model-prompt-injector/config.json +10 -0
- package/dist/extensions/model-prompt-injector/index.test.ts +112 -0
- package/dist/extensions/model-prompt-injector/index.ts +151 -0
- package/dist/extensions/package.json +1 -0
- package/dist/extensions/pi-subagents/CHANGELOG.md +158 -90
- package/dist/extensions/pi-subagents/UPSTREAM-V0.50-MAPPING.md +172 -0
- package/dist/extensions/pi-subagents/agents/oracle.md +7 -5
- package/dist/extensions/pi-subagents/agents/reviewer.md +2 -2
- package/dist/extensions/pi-subagents/agents/scout.md +1 -1
- package/dist/extensions/pi-subagents/agents/worker.md +1 -1
- package/dist/extensions/pi-subagents/docs/configuration.md +78 -19
- package/dist/extensions/pi-subagents/docs/extension-api.md +36 -0
- package/dist/extensions/pi-subagents/docs/missions.md +5 -3
- package/dist/extensions/pi-subagents/docs/models.md +1 -1
- package/dist/extensions/pi-subagents/docs/observability.md +42 -2
- package/dist/extensions/pi-subagents/docs/tool-reference.md +20 -3
- package/dist/extensions/pi-subagents/docs/workflows.md +5 -5
- package/dist/extensions/pi-subagents/install.mjs +2 -2
- package/dist/extensions/pi-subagents/package-lock.json +1470 -1472
- package/dist/extensions/pi-subagents/package.json +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +5 -4
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +15 -14
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +5 -5
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +46 -26
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +2 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +37 -12
- package/dist/extensions/pi-subagents/src/api/external-runs.ts +174 -84
- package/dist/extensions/pi-subagents/src/api/preflight.ts +13 -7
- package/dist/extensions/pi-subagents/src/extension/config.ts +53 -0
- package/dist/extensions/pi-subagents/src/extension/index.ts +67 -13
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +34 -6
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +5 -1
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +31 -30
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +10 -9
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +13 -8
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +16 -3
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +2 -6
- package/dist/extensions/pi-subagents/src/inspectors/herdr/shell-command.ts +16 -0
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +5 -4
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +19 -42
- package/dist/extensions/pi-subagents/src/missions/goal-driver.ts +3 -1
- package/dist/extensions/pi-subagents/src/missions/store.ts +8 -3
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +82 -25
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +71 -1
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +73 -43
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +5 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +14 -6
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +277 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +8 -3
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +2 -2
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +11 -1
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +21 -6
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +437 -0
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +187 -41
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +27 -7
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +76 -19
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +30 -24
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +101 -4
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +54 -28
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +27 -13
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +298 -33
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +5 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/async-dismiss-action.ts +2 -1
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +16 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +219 -15
- package/dist/extensions/pi-subagents/src/runs/foreground/prompt-audit.ts +4 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +333 -45
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +107 -1
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +4 -0
- package/dist/extensions/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +39 -23
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +16 -2
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +66 -62
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +376 -0
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +15 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +1 -9
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +12 -0
- package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +95 -0
- package/dist/extensions/pi-subagents/src/shared/agent-stream-options.ts +5 -0
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +0 -4
- package/dist/extensions/pi-subagents/src/shared/display-text.ts +50 -0
- package/dist/extensions/pi-subagents/src/shared/node-executable.ts +21 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +50 -4
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +34 -25
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +4 -0
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +160 -45
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +1 -48
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +128 -16
- package/dist/extensions/pi-subagents/src/tui/render.ts +122 -44
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +2 -1
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +4 -3
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +10 -2
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +272 -76
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +68 -9
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +27 -1
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +49 -0
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +26 -1
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +144 -0
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +26 -0
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +395 -98
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +111 -78
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +49 -1
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +12 -0
- package/dist/extensions/pi-subagents/test/support/node-command.ts +15 -0
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +50 -0
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +28 -0
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +61 -0
- package/dist/extensions/pi-subagents/test/unit/agent-stream-options.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +76 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +2 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-snapshot.test.ts +162 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +209 -10
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +41 -1
- package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +135 -42
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +252 -1
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +192 -6
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector-bootstrap.test.ts +32 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-shell-command.test.ts +59 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +69 -0
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +23 -4
- package/dist/extensions/pi-subagents/test/unit/llm-intent-arbiter.test.ts +56 -1
- package/dist/extensions/pi-subagents/test/unit/mission-goal-driver.test.ts +67 -3
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +18 -0
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +25 -2
- package/dist/extensions/pi-subagents/test/unit/node-executable.test.ts +26 -0
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +8 -0
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +348 -0
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +5 -2
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +6 -1
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +92 -0
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +175 -0
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +127 -17
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +44 -0
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +247 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +107 -2
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +5 -8
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +456 -4
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +128 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +28 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +16 -7
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +15 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +79 -15
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +12 -12
- package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +109 -0
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +94 -1
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +42 -2
- package/dist/extensions/question/index.ts +21 -6
- package/dist/extensions/question/question-list.ts +7 -1
- package/dist/extensions/question/row-layout.ts +3 -0
- package/dist/extensions/question/tests/exp.test.ts +70 -0
- package/dist/extensions/question/tests/exp2.test.ts +59 -0
- package/dist/extensions/question/tests/exp3.test.ts +47 -0
- package/dist/extensions/question/tests/helpers.test.ts +7 -0
- package/dist/extensions/question/tests/question-list.test.ts +140 -0
- package/dist/extensions/question/tests/row-layout.test.ts +13 -0
- package/dist/extensions/question/tests/selection-mode.test.ts +54 -0
- package/dist/extensions/question/tests/zz-ig3.test.ts +20 -0
- package/dist/extensions/question/tests/zz-probe.test.ts +29 -0
- package/dist/extensions/tokenin-onboarding.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/main.js +4 -0
- package/dist/modes/interactive/components/model-selector.js +2 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/tool-execution.js +10 -1
- package/dist/modes/interactive/interactive-mode.d.ts +8 -2
- package/dist/modes/interactive/interactive-mode.js +81 -25
- package/dist/modes/interactive/model-catalog-refresh.d.ts +6 -0
- package/dist/modes/interactive/model-catalog-refresh.js +33 -0
- package/dist/modes/interactive/theme/dark.json +2 -0
- package/dist/modes/interactive/theme/light.json +2 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +10 -2
- package/dist/modes/interactive/theme/theme-controller.js +25 -11
- package/dist/modes/interactive/theme/theme-schema.json +9 -1
- package/dist/modes/interactive/theme/theme.d.ts +5 -3
- package/dist/modes/interactive/theme/theme.js +12 -2
- package/dist/skills/pi-subagents/SKILL.md +1 -1
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +5 -4
- package/dist/skills/pi-subagents/references/execution-controls.md +15 -14
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +5 -5
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +46 -26
- package/dist/utils/abort.d.ts +4 -0
- package/dist/utils/abort.js +47 -0
- package/dist/utils/tools-manager.d.ts +5 -1
- package/dist/utils/tools-manager.js +12 -21
- package/docs/settings.md +6 -0
- package/package.json +6 -6
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Upstream v0.50.0 merge mapping
|
|
2
|
+
|
|
3
|
+
Selesai fork of `nicobailon/pi-subagents` updated from v0.48.0 to upstream **v0.50.0**
|
|
4
|
+
(v0.49.0 + v0.50.0). This file is the exact reconciliation map: for every changed file,
|
|
5
|
+
what upstream did, what the fork had done, and what the merged tree contains. Regenerate
|
|
6
|
+
on the next upstream merge (the merge base is always the previously vendored tag).
|
|
7
|
+
|
|
8
|
+
Merge method: no shared git history exists (the fork vendors upstream as squashed
|
|
9
|
+
commits), so the merge was a file-level 3-way: base = upstream v0.48.0, ours = fork at
|
|
10
|
+
HEAD-before-merge, theirs = upstream v0.50.0. For each file, "theirs" was taken as the
|
|
11
|
+
new base and the fork's v0.48.0-based hunks were re-applied; hunks that no longer
|
|
12
|
+
matched were resolved by hand (listed below).
|
|
13
|
+
|
|
14
|
+
Result: `tsc --noEmit` clean, `tsgo` clean for the whole host monorepo, 2060 unit tests
|
|
15
|
+
pass (3 skipped), 777 integration tests pass.
|
|
16
|
+
|
|
17
|
+
## Numbers
|
|
18
|
+
|
|
19
|
+
| Set | Count | Handling |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Files changed by both fork and upstream (src) | 37 | 3-way merge, hunks re-applied |
|
|
22
|
+
| Files changed only by upstream (src) | 33 | v0.50.0 adopted wholesale (+ branding on 3) |
|
|
23
|
+
| Files changed only by the fork (src) | 38 | fork versions kept |
|
|
24
|
+
| Fork "new" files | 6 | exist **verbatim** in upstream v0.50.0 (our features were upstreamed) |
|
|
25
|
+
| Upstream-only test changes | 48 files | v0.50.0 adopted |
|
|
26
|
+
| Fork-only test changes | 80 files patched, 7 new files | fork hunks re-applied; 12 files took fork versions, then fixed |
|
|
27
|
+
|
|
28
|
+
## Fork features that upstream v0.50.0 already contains verbatim
|
|
29
|
+
|
|
30
|
+
These six fork additions were merged into upstream before v0.50.0; the merged tree uses
|
|
31
|
+
the upstream copies (identical content):
|
|
32
|
+
|
|
33
|
+
- `src/slash/inline-subagents.ts` (#agent-name inline invocation + autocomplete)
|
|
34
|
+
- `src/workflows/workflow-auto-relaunch.ts` (relaunch decision module — note: upstream
|
|
35
|
+
ships the module but **does not wire it**; the fork wires it, see below)
|
|
36
|
+
- `src/agents/task-aware-routing.ts`
|
|
37
|
+
- `src/extension/chain-validation.ts`
|
|
38
|
+
- `src/shared/env.ts` (PI_SUBAGENT* → SELESAI_SUBAGENT* legacy shim)
|
|
39
|
+
- `src/shared/session-lineage.ts`
|
|
40
|
+
|
|
41
|
+
## Both-changed files (37) — resolutions
|
|
42
|
+
|
|
43
|
+
Base for every file is v0.50.0; fork hunks were re-applied. Hand-resolved files:
|
|
44
|
+
|
|
45
|
+
| File | Upstream (v0.48→v0.50) | Fork (vs v0.48) | Resolution |
|
|
46
|
+
| --- | --- | --- | --- |
|
|
47
|
+
| `src/extension/index.ts` | Orca tabs, external jobs, async-status snapshot, detach shortcut, resumable retained children, result-index reload work | branding; lineage goal continuation; resources_discover prompt paths; adoptedActive capacity; formatActiveWorkflowSummary; resetSessionState(previousSessionFile) | v0.50.0 + fork hunks; hand-added: lineage/adoption bits in `resetSessionState`, `formatActiveWorkflowSummary` definition (was referenced but missing), `resources_discover`, adopted-job capacity accounting |
|
|
48
|
+
| `src/extension/public-execution.ts` | structured single-child (converts `{agent,task}` → `runs.run("main",…)`), rejects legacy top-level chain/tasks | restores chain/tasks/clarify as first-class | v0.50.0 + fork policy: `clarify` rejected only with workflowScript, top-level `chain`/`tasks` pass through, `schedule.create` accepts direct execution fields, single-child conversion kept (fork executor is v0.50's) |
|
|
49
|
+
| `src/extension/schemas.ts` | task param, toolTimeoutMs, debug.run descriptions, agentContract integer bounds (#1095) | top-level `chain`/`tasks`/`clarify`, chatProgress 5-value enum, legacyChainControls trim comment | v0.50.0 + fork's top-level `chain`/`tasks`/`clarify` + 5-value chatProgress enum; v0.50's bounds fix and new descriptions kept |
|
|
50
|
+
| `src/extension/tool-description.ts` | rewrote FULL/COMPACT text (single-child + retained resumability) | fork text describing all four modes | fork's FULL/COMPACT text kept (matches fork schema), v0.50's resumable-children wording folded in |
|
|
51
|
+
| `src/agents/agents.ts` | `tools: "inherit"`, model validation | branding, extra builtins, home-dir guard, extra-agent-dirs env | v0.50.0 + fork branding/builtins (fork's splitToolList was already upstreamed) |
|
|
52
|
+
| `src/runs/background/retained-children.ts` | resumable/not-resumable states | `listRetainedChildren` accepts multiple session ids | v0.50.0 + signature widened to `string \| string[]` (lineage callers) |
|
|
53
|
+
| `src/runs/foreground/subagent-executor.ts` | result-files/async-status refactors, detached children as paused | auto-relaunch wiring (fan-out budget exhaustion) | v0.50.0 + re-wired fork auto-relaunch loop around `runWorkflowScript` (async path), with cap-exhaustion → failed run + `relaunchNote` summaries |
|
|
54
|
+
| `src/runs/shared/llm-intent-arbiter.ts` | confidence levels, registry-method auth call, fail-closed >8k | simpler arbitration, head+tail truncation | v0.50.0 wholesale (strictly better) + `SELESAI_SUBAGENTS_LLM_INTENT_ARBITER` env rebrand |
|
|
55
|
+
| `src/runs/shared/model-fallback.ts` | `resolveRequiredSubagentModelCandidate` (rejects unknown models, #1093) | same-model transient retry (503/429/no-body/econnreset), `MODEL_RETRY_DELAYS_MS`, `formatModelRetryNote` | both: v0.50.0's strict resolution + fork's retry schedule/exports (used by runner/execution) |
|
|
56
|
+
| `src/shared/types.ts` | async-status snapshot types, artifact default "session" | `AsyncJobState.adopted`, artifact default "project" + `.pi-subagents` comment | v0.50.0 + `adopted` flag; fork's `DEFAULT_ARTIFACT_CONFIG.dir = "project"` kept (deliberate fork behavior) |
|
|
57
|
+
| `src/shared/artifacts.ts` | packaging-warning work | `getArtifactsDir`/`getChainRunsDir` default "project" | v0.50.0 + fork default "project" restored |
|
|
58
|
+
| `src/runs/background/result-watcher.ts` | indexed result inbox, session/observer/tool-call indexing | lineage adoption of old-session results | v0.50.0 + fork lineage logic, plus a fork-specific flat-file scan bounded to the adoption window (v0.50's scan only reads the index) |
|
|
59
|
+
| `src/slash/slash-commands.ts` | detach command/shortcut, live-state work | export `launchSlashSubagent` (host workflow extension imports it), branding | v0.50.0 + `export` on `launchSlashSubagent` + import rebrand + inline invocation import |
|
|
60
|
+
| `src/slash/slash-live-state.ts` | structured single-child initial results | `buildWorkflowInitialResult` + workflow update path | v0.50.0 + fork's workflow preview builder (+ `background` flag for async) |
|
|
61
|
+
| `src/tui/fleet-status.ts` | nested-run tree (#1086), spacing config | nested rows (older own implementation) | v0.50.0 wholesale + import rebrand (upstream's tree supersedes fork's) |
|
|
62
|
+
| `src/watchdog/review.ts`, `src/watchdog/permission-arbiter.ts`, `src/runs/foreground/prompt-audit.ts` | `agentStreamOptions()` host-API adapter | bare `streamFn` + auth | v0.50.0 wholesale + `@selesai/code` import rebrand (agentStreamOptions emits both `streamFn` and `streamFunction`, compatible with host pi-agent-core 0.84.1) |
|
|
63
|
+
|
|
64
|
+
Remaining both-changed files (20) merged mechanically: fork hunks re-applied over v0.50.0
|
|
65
|
+
with no conflicts — `extension/config.ts`, `extension/rpc.ts`, `intercom/native-supervisor-channel.ts`,
|
|
66
|
+
`runs/background/{async-execution, async-job-tracker, async-status, run-id-resolver, run-status,
|
|
67
|
+
scheduled-runs, subagent-runner, subagent-wait}.ts`, `runs/foreground/{chain-execution,
|
|
68
|
+
execution}.ts`, `runs/shared/{nested-events, subagent-prompt-runtime}.ts`,
|
|
69
|
+
`slash/slash-live-state.ts` (see above), `tui/{fleet, fleet-transcript, render}.ts`,
|
|
70
|
+
`workflows/chat-progress.ts`.
|
|
71
|
+
|
|
72
|
+
## Upstream-only files (33 src) — adopted wholesale
|
|
73
|
+
|
|
74
|
+
v0.50.0 content taken as-is, then the fork branding transform applied where tokens
|
|
75
|
+
appeared. Only three needed it:
|
|
76
|
+
|
|
77
|
+
- `src/runs/shared/tool-timeout.ts` — `TOOL_TIMEOUT_ENV` → `SELESAI_SUBAGENT_TOOL_TIMEOUT_MS`, reads via `readSubagentEnv` (PI_ fallback)
|
|
78
|
+
- `src/runs/shared/orca-progress-tabs.ts` — `PI_SUBAGENT_ORCA_BINARY` → `SELESAI_SUBAGENT_ORCA_BINARY` via `readSubagentEnv`
|
|
79
|
+
- `src/runs/background/async-status-snapshot.ts` — widget prefix → `SELESAI_SUBAGENT_ASYNC_JSON:`
|
|
80
|
+
|
|
81
|
+
The other 30 (agent-serializer, api/external-runs, api/preflight, herdr/*, intercom-bridge,
|
|
82
|
+
missions/goal-driver, missions/store, result-files, active-*-capacity/index, async-resume,
|
|
83
|
+
chain-root-attachment, completion-replay, fleet-view, resume-guidance, stale-run-reconciler,
|
|
84
|
+
wait-completions, async-dismiss-action, completion-guard, external-cli-runner, parallel-utils,
|
|
85
|
+
subagent-control, subagent-startup-retry, agent-stream-options, display-text, node-executable,
|
|
86
|
+
scripted-workflow) are upstream's latest with no fork content to preserve.
|
|
87
|
+
|
|
88
|
+
## Fork-only files (38 src) — kept
|
|
89
|
+
|
|
90
|
+
Fork versions kept (upstream did not touch them): agent-management, agent-memory,
|
|
91
|
+
agent-refinements, control-notices, doctor, fanout-child, steering-notices, profiles,
|
|
92
|
+
notify, wait-config/wait-subscriptions/wait-tool, chain-clarify, foreground-history,
|
|
93
|
+
capability-ceiling, permissions, pi-args, pi-spawn, run-fanout-budget,
|
|
94
|
+
runtime-acknowledged-extensions, structured-output, tool-availability, tool-budget,
|
|
95
|
+
worktree, fork-context, utils, prompt-workflows (`/chain` `/parallel` `/run-chain`
|
|
96
|
+
`/chain-prompts`), selector, slash-bridge, subagents-admin, render-helpers,
|
|
97
|
+
watchdog/{change-signature, child-status, model-selection, register-child, register-main,
|
|
98
|
+
runtime, tool-actions}.
|
|
99
|
+
|
|
100
|
+
## Deliberate fork-vs-upstream behavior decisions (the "how far" answer)
|
|
101
|
+
|
|
102
|
+
Kept as fork behavior:
|
|
103
|
+
|
|
104
|
+
1. **Execution surface** — top-level `chain` / `tasks` / `clarify` remain first-class
|
|
105
|
+
alongside `{ agent, task }` and `workflowScript`. Upstream v0.50.0 only exposes
|
|
106
|
+
structured single-child + workflowScript at the top level; our schemas, public
|
|
107
|
+
boundary, tool text, and skill docs advertise all four modes.
|
|
108
|
+
2. **Artifact default** — `DEFAULT_ARTIFACT_CONFIG.dir = "project"` (cwd `.pi-subagents/`).
|
|
109
|
+
Upstream moved the default to "session" (#1062) so worktrees stay clean; the fork
|
|
110
|
+
keeps project-scoped artifacts and gitignores `.pi-subagents/` subdirs. Consequence:
|
|
111
|
+
a worktree with artifacts is not `git status`-clean; the upstream worktree-clean test
|
|
112
|
+
is adapted to expect exactly `.pi-subagents/`.
|
|
113
|
+
3. **Mission storage** — upstream relocates automatic mission records out of project
|
|
114
|
+
worktrees (`<agentDir>/missions/projects/<hash>`); adopted as-is (fork's
|
|
115
|
+
`.pi-subagents/missions` was runtime state, not load-bearing).
|
|
116
|
+
4. **Workflow auto-relaunch wiring** — upstream ships the decision module only; the fork
|
|
117
|
+
wires `config.maxWorkflowAutoRelaunches` into the async workflow loop with fresh
|
|
118
|
+
fan-out budgets per relaunch and a failed-run outcome at the cap.
|
|
119
|
+
5. **Same-model transient retry** — fork's `MODEL_RETRY_DELAYS_MS` retry schedule on
|
|
120
|
+
503/429/no-body/econnreset, in addition to upstream's fallback-model switching.
|
|
121
|
+
6. **Lineage carry-over** — upstream adopted the fork's session-lineage machinery; the
|
|
122
|
+
fork additionally (a) counts adopted jobs against the per-session active async cap,
|
|
123
|
+
(b) labels adopted jobs in carry-over summaries, and (c) scans flat result files
|
|
124
|
+
during the adoption window (upstream only scans its indexed inbox).
|
|
125
|
+
7. **Branding** — `@selesai/code` host import, `~/.selesai` config dirs, `.pi-subagents`
|
|
126
|
+
runtime dir, `SELESAI_SUBAGENT*` / `SELESAI_SUBAGENTS_*` env vars with legacy `PI_`
|
|
127
|
+
fallback, extra builtin agents (architect, builder, commentator, explorer, recapper),
|
|
128
|
+
`SELESAI_SUBAGENT_EXTRA_AGENT_DIRS`, home directory never treated as a project root.
|
|
129
|
+
|
|
130
|
+
Adopted as upstream behavior (fork's prior code superseded):
|
|
131
|
+
|
|
132
|
+
1. Structured single-child converts to a `runs.run("main", …)` workflow internally.
|
|
133
|
+
2. Generic `intercom` tool removed from supervisor coordination (#1107); ceiling audit
|
|
134
|
+
removes only `write` + `contact_supervisor`.
|
|
135
|
+
3. `needs_attention` escalation for repeated mutating tool failures (was
|
|
136
|
+
`active_long_running` in the fork).
|
|
137
|
+
4. `tools: "inherit"` builtin overrides, model-registry validation before spawn (#1093),
|
|
138
|
+
`agentContract.version` integer bounds (#1095).
|
|
139
|
+
5. Retained-children resumability states, detached workflow children shown as paused.
|
|
140
|
+
6. Result inbox indexing, async-status snapshots, Orca progress tabs, external-job
|
|
141
|
+
FleetView API, foreground detach shortcut, per-tool-call timeouts, debug.run.
|
|
142
|
+
|
|
143
|
+
## Non-src mapping
|
|
144
|
+
|
|
145
|
+
| Area | Resolution |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| `package.json` / `package-lock.json` | v0.50.0 (version 0.50.0, no new deps) + fork description + `@selesai/code` renames |
|
|
148
|
+
| `CHANGELOG.md` | v0.50.0 changelog + branding transform + rewritten "Selesai fork (0.50.0)" section |
|
|
149
|
+
| `README.md` | v0.50.0 + branding + fork's 12-row builtin-agent table |
|
|
150
|
+
| `docs/*.md` (9 files) | v0.50.0 + mechanical branding transform (fork doc delta was pure branding) |
|
|
151
|
+
| `skills/pi-subagents/SKILL.md` | fork version (upstream didn't change it) |
|
|
152
|
+
| `skills/…/references/*.md` (4 files) | 3-way: v0.50.0 base + fork hunks; hand-added fork's Chain/Parallel execution sections and technique sections (context-build, handoff-plan) |
|
|
153
|
+
| `agents/*.md` | upstream's oracle/reviewer/scout/worker/delegate updates + fork's researcher (Selesai-custom) + fork's architect/builder/commentator/explorer/recapper |
|
|
154
|
+
| `prompts/*.md` | upstream's 5 + fork's parallel-context-build / parallel-handoff-plan |
|
|
155
|
+
| `test/` | v0.50.0 base + fork hunks; 12 behavioral files took fork versions, then adjusted to merged behavior (single-child conversion, `needs_attention`, mission store location, `.pi-subagents`/`.selesai` paths, `SELESAI_*` env names, worktree-clean exception); 7 fork test files copied |
|
|
156
|
+
|
|
157
|
+
## Test adjustments made after the merge (merged behavior wins)
|
|
158
|
+
|
|
159
|
+
- `agent-overrides/agent-frontmatter/index-child-registration/pi-coding-agent-dir` —
|
|
160
|
+
`.selesai` paths and `SELESAI_CODING_AGENT_DIR` (v0.50 tests still used `.pi`).
|
|
161
|
+
- `async-execution` — capability audit removes `["write", "contact_supervisor"]` (no `intercom`).
|
|
162
|
+
- `external-cli-runner` — `sessionId: "session-external"` (v0.50 result-files requirement).
|
|
163
|
+
- `orca-progress-tabs` — jiti path via `import.meta.resolve`, `SELESAI_*` env.
|
|
164
|
+
- `single-execution` — live-activity uses `needs_attention`; detach test expects
|
|
165
|
+
`/run detaches: detached/`; mission tests rewritten to upstream's agent-dir store
|
|
166
|
+
(`resolveMissionStoreLocation`/`missionStatePath`); worktree-clean test expects
|
|
167
|
+
`.pi-subagents/` (fork artifact default); mutating-failure escalation → `needs_attention`.
|
|
168
|
+
- `public-execution` / `schemas` / `slash-*` / `mission-lifecycle` / `builtin-agent-documentation`
|
|
169
|
+
— expectations aligned with merged surface (single→workflowScript conversion, four-mode
|
|
170
|
+
schema, "Workflow running." initial slash message, mode "workflow" snapshots,
|
|
171
|
+
`.pi-subagents` mission paths, 12-row README builtin table).
|
|
172
|
+
- `tool-timeout` / `orca` unit tests — `SELESAI_*` env with `PI_` fallback assertions.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: oracle
|
|
3
3
|
aliases: advisor
|
|
4
4
|
description: High-context decision-consistency oracle that protects inherited state and prevents drift
|
|
5
|
-
tools: read, grep, find, ls, bash
|
|
5
|
+
tools: read, grep, find, ls, bash
|
|
6
6
|
thinking: high
|
|
7
7
|
systemPromptMode: replace
|
|
8
8
|
inheritProjectContext: true
|
|
@@ -16,9 +16,11 @@ Your primary job is to prevent the main agent from making hidden, conflicting, o
|
|
|
16
16
|
|
|
17
17
|
Before you do anything else, reconstruct the key inherited decisions, constraints, and open questions from the forked conversation, codebase state, and task. Those decisions form your baseline contract. Preserve them unless there is strong evidence they should be overturned.
|
|
18
18
|
|
|
19
|
-
If
|
|
19
|
+
If the task is framed as asking or consulting the oracle, treat it as a live consultation unless the parent explicitly requests a one-shot report. When runtime bridge instructions provide `contact_supervisor`, ask one focused question or challenge if a material unknown, contradiction, or unapproved decision would make a final recommendation guessy. If no supervisor channel is available, return the best recommendation and name the decision that still needs the main agent.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
If you need clarification from the main agent and bridge instructions provide `contact_supervisor`, use it with `reason: "need_decision"` and wait for the reply. Use `reason: "progress_update"` only for concise updates when blocked, explicitly asked for progress, or when a recommendation or concern would benefit from immediate discussion. Keep coordination traffic tight and purposeful. Do not narrate your whole review through `contact_supervisor`.
|
|
22
|
+
|
|
23
|
+
Do not send routine completion handoffs. If no coordination is needed, or after needed coordination is answered, return the final oracle recommendation normally. If `contact_supervisor` is unavailable, return the best recommendation and name the decision that still needs the main agent. Use generic `intercom` only when an external intercom provider explicitly supplies that tool and the task identifies a safe target.
|
|
22
24
|
|
|
23
25
|
Core responsibilities:
|
|
24
26
|
- reconstruct inherited decisions, constraints, and open questions from the context
|
|
@@ -39,8 +41,8 @@ What you do not do by default:
|
|
|
39
41
|
|
|
40
42
|
Working rules:
|
|
41
43
|
- Use `bash` only for inspection, verification, or read-only analysis.
|
|
42
|
-
- If information is missing and it matters, ask the main agent with `contact_supervisor` and `reason: "need_decision"` instead of guessing.
|
|
43
|
-
- If the answer depends on a decision the main agent has not made yet, stop and ask with `contact_supervisor`
|
|
44
|
+
- If information is missing and it matters, ask the main agent with `contact_supervisor` and `reason: "need_decision"` when bridge instructions provide that tool. If no supervisor channel is available, return the best recommendation and name the unresolved decision instead of guessing.
|
|
45
|
+
- If the answer depends on a decision the main agent has not made yet, stop and ask with `contact_supervisor` when bridge instructions provide that tool. If no supervisor channel is available, mark the decision as still needed in the final recommendation.
|
|
44
46
|
- When bridge instructions are present, send concise coordination messages only when a recommendation, concern, or question would benefit from immediate discussion instead of waiting silently until the final return.
|
|
45
47
|
- Prefer narrow, specific corrections to the current path over rewriting the whole plan.
|
|
46
48
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
3
|
description: Versatile review specialist for code diffs, plans, proposed solutions, codebase health, and PR/issue validation
|
|
4
|
-
tools: read, grep, find, ls
|
|
4
|
+
tools: read, grep, find, ls
|
|
5
5
|
thinking: high
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: true
|
|
@@ -62,7 +62,7 @@ Review a PR or issue by understanding the context, then verifying:
|
|
|
62
62
|
## Supervisor coordination
|
|
63
63
|
If runtime bridge instructions identify a safe supervisor target and you are blocked or need a decision, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply. Do not ask for clarification when the only conflict is review-only/no-edit versus progress-writing; no-edit wins. Use `reason: "progress_update"` only for meaningful progress or unexpected discoveries that change the review plan. Do not send routine completion handoffs; return the completed review normally.
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
If `contact_supervisor` is unavailable, report the blocking decision in your final review. Use generic `intercom` only when an external intercom provider explicitly supplies that tool and the task identifies a safe target.
|
|
66
66
|
|
|
67
67
|
## Review output format
|
|
68
68
|
Structure your findings clearly:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: scout
|
|
3
3
|
description: Fast codebase recon that returns compressed context for handoff
|
|
4
|
-
tools: read, grep, find, ls, bash, write
|
|
4
|
+
tools: read, grep, find, ls, bash, write
|
|
5
5
|
thinking: low
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: true
|
|
@@ -22,7 +22,7 @@ The builtin worker uses a strict tool allowlist. It does not inherit ambient ext
|
|
|
22
22
|
|
|
23
23
|
If the task is framed as an approved direction, oracle handoff, or execution plan, treat that direction as the contract. Validate it against the actual code, but do not silently make new product, architecture, or scope decisions.
|
|
24
24
|
|
|
25
|
-
If the implementation reveals a decision that was not approved and is required to continue safely, pause and escalate through the live coordination channel. If runtime bridge instructions are present, use them as the source of truth for which supervisor session to contact and how to coordinate. Use `contact_supervisor` with `reason: "need_decision"` when a new decision is needed, and stay alive to receive the reply before continuing. Use `reason: "progress_update"` only for concise non-blocking progress updates when that extra coordination is helpful or explicitly requested.
|
|
25
|
+
If the implementation reveals a decision that was not approved and is required to continue safely, pause and escalate through the live coordination channel. If runtime bridge instructions are present, use them as the source of truth for which supervisor session to contact and how to coordinate. Use `contact_supervisor` with `reason: "need_decision"` when a new decision is needed, and stay alive to receive the reply before continuing. Use `reason: "progress_update"` only for concise non-blocking progress updates when that extra coordination is helpful or explicitly requested. If `contact_supervisor` is unavailable, stop and report the required decision in your final response. Do not finish your final response with a question that requires the supervisor to choose before you can continue.
|
|
26
26
|
|
|
27
27
|
Default responsibilities:
|
|
28
28
|
- validate the task or approved direction against the actual code
|
|
@@ -24,9 +24,9 @@ By default, project settings resolve from the nearest parent directory that cont
|
|
|
24
24
|
{ "toolDescriptionMode": "compact" }
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Controls the parent-facing `subagent` tool description registered at startup. `
|
|
27
|
+
Controls the parent-facing `subagent` tool description registered at startup. `compact` is the default. `full` keeps the full execution, management/control, and async guidance with more prompt bloat.
|
|
28
28
|
|
|
29
|
-
`custom` reads `subagent-tool-description.md` from the project config directory, then from `~/.selesai/agent/subagent-tool-description.md`. Missing, empty, unreadable, or oversized custom files fall back to the
|
|
29
|
+
`custom` reads `subagent-tool-description.md` from the project config directory, then from `~/.selesai/agent/subagent-tool-description.md`. Missing, empty, unreadable, or oversized custom files fall back to the compact description. Custom templates may use `{{fullDescription}}`, `{{compactDescription}}`, `{{safetyGuidance}}`, `{{agentDir}}`, and `{{projectConfigDir}}`; the safety guidance is always present so custom prose cannot remove the runtime guardrails. Restart Selesai after changing the mode or custom file.
|
|
30
30
|
|
|
31
31
|
## `legacyChainControls`
|
|
32
32
|
|
|
@@ -44,6 +44,61 @@ Defaults to `false`. The default registered model-facing tool schema and descrip
|
|
|
44
44
|
|
|
45
45
|
Controls the `subagent` tool result shown inline in chat. The default, `"rich"`, shows live child activity and expands to detailed output. `"summary"` keeps the inline result at one stable row for running, completed, failed, stopped, and paused runs; it does not animate, show elapsed time, preview child output, or change when Selesai's expand key is pressed. FleetView remains available for live progress and detailed inspection.
|
|
46
46
|
|
|
47
|
+
## `mainWindowRenderer`
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mainWindowRenderer": {
|
|
52
|
+
"horizontalSpacing": 0,
|
|
53
|
+
"compactResultMaxLines": 4
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Controls only the main chat `subagent` call/result renderer. It does not change child execution, orchestration, FleetView, artifacts, transcripts, or model-facing content.
|
|
59
|
+
|
|
60
|
+
`horizontalSpacing` is an integer from `0` to `4`. The default preserves current spacing. Set it to `0` to remove the extra spaces before compact result details and between parts of the call row.
|
|
61
|
+
|
|
62
|
+
`compactResultMaxLines` is a positive integer. It caps only collapsed rich-result rows and adds an expand hint when rows are hidden. Expanded output remains uncapped.
|
|
63
|
+
|
|
64
|
+
With `"summary"`, a tool result looks like this:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
✓ reviewer · completed
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## `foregroundDetachShortcut`
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{ "foregroundDetachShortcut": "ctrl+b" }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Optionally binds a shortcut that detaches the active foreground single-subagent run without terminating it. The running foreground card shows the configured shortcut beside its live-detail hint. The default is unset, so pi-subagents does not reserve a global key.
|
|
77
|
+
|
|
78
|
+
Pi binds `Ctrl+B` to editor cursor-left by default. The extension shortcut takes precedence, but Selesai reports the conflict at startup. To reserve the key without that warning, override the editor action in `~/.selesai/agent/keybindings.json`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"tui.editor.cursorLeft": "left"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## `orcaProgressTabs` (experimental)
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"orcaProgressTabs": {
|
|
91
|
+
"enabled": true
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Opt in to a best-effort Orca observer that creates one Orca terminal tab for each subagent child and mirrors its live tool, assistant, stdout, and stderr progress. Tab titles use a persistent worktree-local sequence (`subagent · <agent> · 1`, `... · 2`, and so on), so separate workflows and concurrent children do not reuse the same number. This does **not** replace Selesai as the child runner: native Selesai children keep the same process, lifecycle, status, control, artifact, and result paths. External CLI profiles also keep their existing runner and can mirror their stdout/stderr.
|
|
97
|
+
|
|
98
|
+
The integration is off by default and supports macOS and Linux. It is disabled on Windows. When enabled, `pi-subagents` looks for executable `orca` on `PATH`, or uses the executable path in `SELESAI_SUBAGENT_ORCA_BINARY`. If no executable is available, Orca is not running, the cwd is not an Orca-managed worktree, or `terminal create` fails, the authoritative subagent still runs normally. Tab creation is deliberately best-effort and never changes the child result.
|
|
99
|
+
|
|
100
|
+
Set `enabled` to `false` (or remove the block) as a kill switch. In that state, `pi-subagents` does not invoke `orca` and creates no Orca tabs. The temporary mirror files contain child output, use private file modes where supported, and are removed shortly after the child finishes. Each mirror is capped at 1 MiB. The observer stops accepting progress when the cap or stream backpressure is reached and appends a truncation notice. The viewer removes terminal control sequences with parser state that persists across file reads. On completion, the viewer exits back to the Orca terminal's shell prompt; the tab and its terminal scrollback remain open until the user closes the tab. A successfully completed native Selesai child with a recorded session ends with a safely quoted `rm -- <exact-session-path>` command; failed, stopped, timed-out, and sessionless children do not show the removal command.
|
|
101
|
+
|
|
47
102
|
## `asyncByDefault`
|
|
48
103
|
|
|
49
104
|
```json
|
|
@@ -127,6 +182,18 @@ Use it when foreground orchestration or plain async single-agent runs need a lon
|
|
|
127
182
|
|
|
128
183
|
Composite async runs (async chains, parallel tasks, and scripted workflows) stay unbounded at the top level by design. Their runner children are bounded individually by their own agent or runner defaults, so this value does not cap them. Must be a positive integer no greater than `2147483647` (the largest delay a Node.js timer can honor, roughly 24.8 days); invalid or out-of-range values are ignored and the built-in defaults apply.
|
|
129
184
|
|
|
185
|
+
## `toolTimeoutMs`
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{ "toolTimeoutMs": 600000 }
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Optional hard per-tool-call deadline in milliseconds. When configured, a child that emits `tool_execution_start` but not `tool_execution_end` is terminated with `timedOut: true` and a tool-specific error. The effective value is resolved per child: explicit `subagent` call value, then agent frontmatter, then this config value, then `SELESAI_SUBAGENT_TOOL_TIMEOUT_MS`.
|
|
192
|
+
|
|
193
|
+
Without a configured value, Selesai still applies a five-minute hard timeout to known-fast built-in tools: `read`, `grep`, `find`, `ls`, `edit`, `write`, and `structured_output`. Long-running tools such as `bash`, custom tools, and MCP tools do not get a hard default. They get the normal open-tool attention notice after `activeNoticeAfterMs` and remain bounded by the run-level deadline.
|
|
194
|
+
|
|
195
|
+
The tool timer tracks each active `toolCallId` separately and never extends the run-level deadline: when the remaining run budget is shorter, the ordinary run-level timeout wins. `contact_supervisor`, `intercom`, and `subagent_wait` are exempt because their legitimate purpose can be to wait for a human, supervisor, or child run. Use hard tool timeouts only for wedge protection; an elapsed timeout is not a mutation-safe boundary. Configured values must be positive integers no greater than `2147483647`; invalid or out-of-range values are rejected with a visible error rather than silently ignored.
|
|
196
|
+
|
|
130
197
|
## `globalConcurrencyLimit`
|
|
131
198
|
|
|
132
199
|
```json
|
|
@@ -155,14 +222,6 @@ Caps cumulative logical child admissions in one top-level run tree. The default
|
|
|
155
222
|
|
|
156
223
|
The budget counts single launches, expanded `tasks`/`count`, static chain steps and parallel groups, actual dynamic `expand` items, appended chain steps, workflow children, and nested child calls. Static and materialized dynamic groups are admitted atomically. Startup retries, model fallback, and retained-child resume reuse the original logical child claim. Claims are never released or refunded. This cap is independent from the session-wide cumulative spawn budget and `globalConcurrencyLimit`.
|
|
157
224
|
|
|
158
|
-
## `maxWorkflowAutoRelaunches`
|
|
159
|
-
|
|
160
|
-
```json
|
|
161
|
-
{ "maxWorkflowAutoRelaunches": 12 }
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Maximum automatic relaunches when an async scripted workflow ends with a fan-out `budget` result before the goal is clean. Each relaunch re-runs the same `workflowScript` as a fresh top-level run with a new fan-out budget, the same mission, and the same progress file, so the loop keeps building until the commentator reports clean. Defaults to 12; `0` means unlimited. When the cap is reached, the workflow completes as `failed` with a note to raise the cap or relaunch manually. Foreground workflows are unaffected — their budget results surface to the parent inline.
|
|
165
|
-
|
|
166
225
|
## `maxActiveAsyncRunsPerSession`
|
|
167
226
|
|
|
168
227
|
```json
|
|
@@ -244,7 +303,7 @@ Overrides the command used to launch child Selesai processes. Package wrappers c
|
|
|
244
303
|
export SELESAI_SUBAGENT_TASK_DELIVERY=file # auto | file (default: auto)
|
|
245
304
|
```
|
|
246
305
|
|
|
247
|
-
Controls how the task text reaches the child
|
|
306
|
+
Controls how the task text reaches the child Selesai process. `auto` (default) passes short tasks as an inline argv token and writes tasks longer than 8000 characters to a temp `task.md` referenced as `@<path>`. `file` always uses a temp file, keeping the task out of argv entirely.
|
|
248
307
|
|
|
249
308
|
Use `file` on hosts where endpoint protection (EDR) pre-execution scanning denies child processes whose command line embeds a long natural-language task — that denial surfaces as an immediate zero-activity `SIGKILL`. Independently of this setting, startup retries automatically escalate to file delivery after an unexplained zero-activity `SIGKILL`. Empty, whitespace-only, or unrecognized values fall back to `auto`.
|
|
250
309
|
|
|
@@ -260,7 +319,7 @@ Use `file` on hosts where endpoint protection (EDR) pre-execution scanning denie
|
|
|
260
319
|
}
|
|
261
320
|
```
|
|
262
321
|
|
|
263
|
-
Controls whether subagents receive runtime
|
|
322
|
+
Controls whether subagents receive runtime coordination instructions and whether `contact_supervisor` is auto-added to their tool allowlist when needed.
|
|
264
323
|
|
|
265
324
|
Fields:
|
|
266
325
|
|
|
@@ -268,9 +327,9 @@ Fields:
|
|
|
268
327
|
- `instructionFile`: optional Markdown template replacing the default bridge instructions. `{orchestratorTarget}` is interpolated. Relative paths resolve from `~/.selesai/agent/extensions/subagent/`.
|
|
269
328
|
- `resultDelivery`: default `false`; set `true` only when an external listener consumes `subagent:result-intercom` and acknowledges the grouped completion payload. This is optional external result delivery, not native supervisor messaging. Enabled delivery waits for acknowledgement and reports acknowledgement failures. It does not change supervisor asks or progress updates.
|
|
270
329
|
|
|
271
|
-
Bridge activation requires a targetable current parent session id, which `pi-subagents` passes to children automatically. Native supervisor messaging does not require an external `pi-intercom` installation or per-agent extension allowlists: children use `contact_supervisor`, and parents use `subagent_supervisor` to inspect or reply.
|
|
330
|
+
Bridge activation requires a targetable current parent session id, which `pi-subagents` passes to children automatically. Native supervisor messaging does not require an external `pi-intercom` installation or per-agent extension allowlists: children use `contact_supervisor`, and parents use `subagent_supervisor` to inspect or reply. Agents can still use an external `intercom` tool when they explicitly request a provider that supplies it.
|
|
272
331
|
|
|
273
|
-
The default injected guidance tells children to use `contact_supervisor` with `reason: "need_decision"` when blocked or needing a decision, `reason: "progress_update"` only for meaningful blocked/progress updates,
|
|
332
|
+
The default injected guidance tells children to use `contact_supervisor` with `reason: "need_decision"` when blocked or needing a decision, `reason: "progress_update"` only for meaningful blocked/progress updates, and avoid routine completion handoffs.
|
|
274
333
|
|
|
275
334
|
## `worktreeBaseDir`
|
|
276
335
|
|
|
@@ -305,7 +364,6 @@ stdin is a JSON object with `repoRoot`, `worktreePath`, `agentCwd`, `branch`, `i
|
|
|
305
364
|
{
|
|
306
365
|
"missions": {
|
|
307
366
|
"enabled": true,
|
|
308
|
-
"directory": ".pi-subagents/missions",
|
|
309
367
|
"globalIndex": true,
|
|
310
368
|
"retainTerminal": 200
|
|
311
369
|
}
|
|
@@ -314,7 +372,8 @@ stdin is a JSON object with `repoRoot`, `worktreePath`, `agentCwd`, `branch`, `i
|
|
|
314
372
|
|
|
315
373
|
Automatic missions are enabled by default for ordinary launches with a task. Use per-launch `mission: false` for intentionally ephemeral work, or set `enabled: false` to disable automatic creation globally; explicit mission actions and `missionId`/`mission` launch fields still work.
|
|
316
374
|
|
|
317
|
-
-
|
|
375
|
+
- Mission records default to a project-keyed directory under pi's agent directory (`~/.selesai/agent/missions/projects/<project-hash>/`). This keeps the project worktree clean.
|
|
376
|
+
- `directory` may be absolute, `~/...`, or project-relative. Set it to `.pi-subagents/missions` to opt in to project-scoped records.
|
|
318
377
|
- `retainTerminal` is a positive count (default `200`); pruning removes only the oldest completed, failed, or cancelled records and their pointers, never planned, active, waiting, needs-decision, or corrupt records.
|
|
319
378
|
- The user-global index contains pointers only; missing-record pointers self-heal when globally listed. Set `globalIndex: false` to disable writes or `globalIndexDir` to redirect it.
|
|
320
379
|
|
|
@@ -343,11 +402,11 @@ Each fixed action resolves to `"auto"`, `"confirm"`, or `"forbid"`. This is inte
|
|
|
343
402
|
|
|
344
403
|
Controls where subagent artifact files (inputs, outputs, transcripts, metadata) are stored:
|
|
345
404
|
|
|
346
|
-
- `"project"
|
|
347
|
-
- `"session"
|
|
405
|
+
- `"project"`: writes to `<cwd>/.pi-subagents/artifacts/`.
|
|
406
|
+
- `"session"` (default): stores artifacts under pi's session directory (`~/.selesai/agent/sessions/<session>/subagent-artifacts/`), keeping the working directory clean. It falls back to the OS temp directory when no session file exists.
|
|
348
407
|
- `"temp"`: uses the OS temp directory.
|
|
349
408
|
|
|
350
|
-
This preference also controls the default chain scratch directory. `"project"` uses `<cwd>/.pi-subagents/chain-runs/`, while `"session"` and `"temp"` use the user-scoped temp chain directory.
|
|
409
|
+
This preference also controls the default chain scratch directory. `"project"` uses `<cwd>/.pi-subagents/chain-runs/`, while the default `"session"` and `"temp"` use the user-scoped temp chain directory.
|
|
351
410
|
|
|
352
411
|
The `"session"` option uses the same directory that `cleanupAllArtifactDirs` already scans for age-based cleanup, so artifacts are still cleaned up automatically. Temporary chain directories are cleaned up separately after 24 hours.
|
|
353
412
|
|
|
@@ -56,6 +56,42 @@ The DTO intentionally never exposes run, async, or tool IDs. Clients must ignore
|
|
|
56
56
|
|
|
57
57
|
`pi.events` is in-process only. It does not reach separate Selesai processes or child subagents; use the file lifecycle artifacts or `pi-intercom` for cross-process coordination.
|
|
58
58
|
|
|
59
|
+
## External jobs in FleetView
|
|
60
|
+
|
|
61
|
+
Use `pi-subagents/external-runs` to publish display-only current-session jobs owned by another extension:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import {
|
|
65
|
+
registerExternalRun,
|
|
66
|
+
updateExternalRun,
|
|
67
|
+
unregisterExternalRun,
|
|
68
|
+
} from "pi-subagents/external-runs";
|
|
69
|
+
|
|
70
|
+
registerExternalRun({
|
|
71
|
+
id: "dependency-review",
|
|
72
|
+
sessionId: ctx.sessionManager.getSessionId(),
|
|
73
|
+
source: "interactive-shell",
|
|
74
|
+
label: "Dependency review",
|
|
75
|
+
state: "running",
|
|
76
|
+
startedAt: Date.now(),
|
|
77
|
+
currentAction: "Inspecting package metadata",
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
updateExternalRun(ctx.sessionManager.getSessionId(), "dependency-review", {
|
|
81
|
+
state: "completed",
|
|
82
|
+
updatedAt: Date.now(),
|
|
83
|
+
endedAt: Date.now(),
|
|
84
|
+
preview: "No dependency blockers found.",
|
|
85
|
+
reportPath: "/tmp/dependency-review.md",
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
unregisterExternalRun(ctx.sessionManager.getSessionId(), "dependency-review");
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The API validates and caches bounded display fields when the caller registers or updates a job. FleetView reads that cache only. It does not poll caller code. `snapshotExternalRuns(sessionId)` and `listExternalRuns(sessionId)` return bounded current-session snapshots. By default, malformed cached records throw with the validation error. Display-only Fleet callers can pass `{ ignoreMalformed: true, onMalformedRecord }` to remove bad records and keep rendering with a programmatic diagnostic.
|
|
92
|
+
|
|
93
|
+
External jobs are observational. The caller owns execution, persistence, cancellation, and result delivery. FleetView does not expose stop, steer, resume, cancel, or Herdr controls for them. Supplied report and transcript paths are shown as bounded text only; FleetView does not read arbitrary external paths.
|
|
94
|
+
|
|
59
95
|
## Launch contract preflight
|
|
60
96
|
|
|
61
97
|
Use `pi-subagents/preflight` when an extension needs to inspect the resolved child launch contract before deciding whether to run anything:
|
|
@@ -11,7 +11,9 @@ Missions are durable wrappers around runs. The noun map:
|
|
|
11
11
|
- **Run** — one actual subagent execution.
|
|
12
12
|
- **Receipt** — proof or a link for an external outcome, such as a PR, CI check, deployment, or release.
|
|
13
13
|
|
|
14
|
-
Ordinary workflow launches create one enclosing mission by default, with detailed JSON records under
|
|
14
|
+
Ordinary workflow launches create one enclosing mission by default, with detailed JSON records under `~/.selesai/agent/missions/projects/<project-hash>/` linking objectives, run ids, lifecycle status, decisions, artifact paths, and delivery receipts. Workflow children do not create separate missions. Each workflow child attempt is stored in the enclosing mission with its stable workflow key, run id when known, agent, task metadata, timestamps, session and artifact paths, and latest status heartbeat.
|
|
15
|
+
|
|
16
|
+
Records created under the old default `<project>/.pi-subagents/missions` stay on disk. Continue them by setting `missions.directory` to that path for the project or by copying the record into the new agent-dir project store. There is no automatic migration.
|
|
15
17
|
|
|
16
18
|
Behavior:
|
|
17
19
|
|
|
@@ -19,7 +21,7 @@ Behavior:
|
|
|
19
21
|
- Human receipts end with `Mission: <id> (<status>)`, while JSON/structured output text stays unchanged and `details.missionId` is authoritative.
|
|
20
22
|
- Pass `mission: false` for an intentionally ephemeral workflow. It creates no mission for the workflow or its children and has no `state` global.
|
|
21
23
|
- Set `missions.enabled: false` to disable automatic mission creation; explicit mission fields and actions still work.
|
|
22
|
-
- A workflow with a mission can use `await state.get(key)` and `await state.set(key, value)` for durable JSON state. Missing keys return `undefined`. Keys use the same format as `runs.run` keys. Each set takes the state-file lock, reads the latest file, merges the key, and atomically writes `<
|
|
24
|
+
- A workflow with a mission can use `await state.get(key)` and `await state.set(key, value)` for durable JSON state. Missing keys return `undefined`. Keys use the same format as `runs.run` keys. Each set takes the state-file lock, reads the latest file, merges the key, and atomically writes `<mission-directory>/<mission-id>/state.json`. The complete file cannot exceed 256 KiB. Each workflow caches the file on its first `get`. A `mission:false` workflow has no `state` global.
|
|
23
25
|
|
|
24
26
|
An explicit `mission` object must have exactly one non-empty `title` or `summary`. `objective` and `labels` are optional. When supplied, `goal` must be `true` and requires `budget: { tokens: <positive integer> }`.
|
|
25
27
|
|
|
@@ -56,7 +58,7 @@ subagent({
|
|
|
56
58
|
})
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
After each parent turn, an idle goal mission sends one needs-attention notice with its title, remaining token budget, and next ready action. The action comes from `state.nextReadyAction`, `state.nextAction`, a state item with `status: "ready"`, an open decision, or linked-run state. A workflow can write `state.nextReadyAction` to tell the next notice exactly what work is ready. When the latest linked workflow has a
|
|
61
|
+
After each parent turn, an idle goal mission sends one needs-attention notice with its title, remaining token budget, and next ready action. The action comes from `state.nextReadyAction`, `state.nextAction`, a state item with `status: "ready"`, an open decision, or linked-run state. A workflow can write `state.nextReadyAction` to tell the next notice exactly what work is ready. When the latest linked workflow has a resumable retained child, the notice names that child as the `resume` target. Non-resumable retained children stay visible in `children.list` with their reason, but goal notices do not present them as resume targets. The extension never launches or replans goal work by itself.
|
|
60
62
|
|
|
61
63
|
Linked-run token totals are stored on each run and folded into mission `usage`. An active linked run suppresses notices. Reaching the token budget changes the goal status to `budget-exhausted` and stops notices without closing the mission or reporting success.
|
|
62
64
|
|
|
@@ -128,7 +128,7 @@ To see what `pi-subagents` has actually loaded right now:
|
|
|
128
128
|
/subagents-models reviewer
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
That reports the live runtime mapping, which can differ from settings on disk until you reload
|
|
131
|
+
That reports the live runtime mapping, which can differ from settings on disk until you reload Pi.
|
|
132
132
|
|
|
133
133
|
## Fuzzy model matching
|
|
134
134
|
|
|
@@ -23,13 +23,37 @@ subagent({ action: "status", id: "..." }) // one run
|
|
|
23
23
|
|
|
24
24
|
Or ask naturally: "Show me the current async runs."
|
|
25
25
|
|
|
26
|
+
The under-editor async widget gives a short view while work runs. Its expand key follows your Selesai keybinding:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
async subagent worker · background
|
|
30
|
+
● worker
|
|
31
|
+
● Step 1/1: worker · running
|
|
32
|
+
⎿ read: src/auth.ts | 2.0s
|
|
33
|
+
Press configured-expand-key for live detail
|
|
34
|
+
```
|
|
35
|
+
|
|
26
36
|
To inspect one background child in text, use `subagent({ action: "status", id: "...", view: "transcript" })`; add `index` for a specific child in a parallel or chain run.
|
|
27
37
|
|
|
28
38
|
## FleetView
|
|
29
39
|
|
|
30
40
|
In the TUI, a persistent FleetView below the editor keeps active work visible as a compact summary. Set `fleetViewPlacement` to `"aboveEditor"` to move it above the editor.
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
```text
|
|
43
|
+
2 active agents · ↓ 4.2k tokens · ↓/← to inspect
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
After you expand it:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
↑↓/jk select · enter inspect · esc back
|
|
50
|
+
|
|
51
|
+
> main
|
|
52
|
+
scout · running 1m 12s · ↓ 2.8k tokens
|
|
53
|
+
reviewer · running 38s · ↓ 1.4k tokens
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
When the focused editor is empty, press `↓` or `←` to expand the summary into `main` plus active children with agent name, state, elapsed time, and token totals. Then use `↑`/`↓` or `j`/`k` to select a child and `Enter` to inspect it. Printable navigation keys are never intercepted before activation.
|
|
33
57
|
|
|
34
58
|
FleetView replaces the legacy above-editor async widget by default. Successful background completions stay quiet so inactive Selesai tabs are not marked unread, while failed or paused completions still notify the originating session. Parallel runs show every active child independently. Chains with parallel groups keep their grouped shape in progress and results, so failed or paused agents stay visible next to completed ones. When a child is explicitly allowed to fan out with `tools: subagent`, its nested runs appear under that parent child in the main status tree instead of being hidden inside the child process.
|
|
35
59
|
|
|
@@ -57,6 +81,22 @@ Without a TUI, `/subagents-fleet` retains the textual `subagent({ action: "statu
|
|
|
57
81
|
|
|
58
82
|
Use `/subagents-detach [run-id]` only for an active foreground single-subagent run you want to leave running without terminating; the eventual result remains available through status/wait.
|
|
59
83
|
|
|
84
|
+
Set `foregroundDetachShortcut` in `~/.selesai/agent/extensions/subagent/config.json` to bind the same action to a shortcut. The running foreground card shows the configured shortcut beside its live-detail hint:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"foregroundDetachShortcut": "ctrl+b"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Pi binds `Ctrl+B` to editor cursor-left by default. The extension shortcut takes precedence, but Selesai reports the conflict at startup. To reserve the key without that warning, override the editor action in `~/.selesai/agent/keybindings.json`:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"tui.editor.cursorLeft": "left"
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
60
100
|
If something feels misconfigured, run `/subagents-doctor` or ask: "Check whether subagents and intercom are set up correctly."
|
|
61
101
|
|
|
62
102
|
## Async run artifacts
|
|
@@ -126,7 +166,7 @@ Foreground and async runners share bounded child-protocol handling:
|
|
|
126
166
|
|
|
127
167
|
## Chain and debug artifacts
|
|
128
168
|
|
|
129
|
-
Each chain run creates a scratch directory under its resolved chain root. With the default `artifactDir: "
|
|
169
|
+
Each chain run creates a scratch directory under its resolved chain root. With the default `artifactDir: "session"` or with `"temp"`, it is user-scoped temp storage. With `artifactDir: "project"`, the root is `<cwd>/.pi-subagents/chain-runs/`:
|
|
130
170
|
|
|
131
171
|
```text
|
|
132
172
|
<tmpdir>/pi-subagents-<scope>/chain-runs/{runId}/
|