pi-subagents 0.83.0 → 0.83.1

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +22 -2
  2. package/bundle/agents.js +4 -4
  3. package/bundle/capability-ceiling.js +1 -1
  4. package/bundle/child-tool-plan.js +3 -3
  5. package/bundle/{chunk-P2NCCTZP.js → chunk-2D52JFLF.js} +1 -1
  6. package/bundle/{chunk-WG2OTTAK.js → chunk-2DHZTCOL.js} +2 -2
  7. package/bundle/{chunk-MBDOYZ2V.js → chunk-2S4K53MV.js} +1 -1
  8. package/bundle/{chunk-HJJAVHFB.js → chunk-5YIITCPD.js} +23 -23
  9. package/bundle/{chunk-CNLDYEH4.js → chunk-AHIFYGR3.js} +11 -11
  10. package/bundle/{chunk-MHX22USZ.js → chunk-C5P5CHYK.js} +1 -1
  11. package/bundle/{chunk-XXKG3P2W.js → chunk-C7JMPU5F.js} +4 -4
  12. package/bundle/{chunk-VTMNBPCQ.js → chunk-D3JAFGMO.js} +1 -1
  13. package/bundle/{chunk-BKFWQ642.js → chunk-F4ASL6OV.js} +1 -1
  14. package/bundle/{chunk-CDI3GMNV.js → chunk-F5DBXJ2G.js} +15 -15
  15. package/bundle/{chunk-JHZ6DZ5M.js → chunk-G2Z6ZH26.js} +1 -1
  16. package/bundle/{chunk-TJQJ3MEA.js → chunk-IPGZMQXV.js} +10 -10
  17. package/bundle/{chunk-Y3I6H6DV.js → chunk-LFDBD4PW.js} +2 -2
  18. package/bundle/{chunk-7F5SK2U3.js → chunk-LNRJCP2Y.js} +17 -14
  19. package/bundle/{chunk-6B4ITO2W.js → chunk-MABL3FUM.js} +1 -1
  20. package/bundle/{chunk-CGXWSNPA.js → chunk-NPIYWVOD.js} +4 -4
  21. package/bundle/{chunk-RZJN63GU.js → chunk-QP5ZWNIS.js} +2 -2
  22. package/bundle/{chunk-Z7KVHQHL.js → chunk-QXASAHIA.js} +2 -2
  23. package/bundle/{chunk-5ESXK62X.js → chunk-RNIZLSEA.js} +416 -389
  24. package/bundle/{chunk-HLE22FSH.js → chunk-SSG7IEP5.js} +2 -2
  25. package/bundle/{chunk-CZTMUBUI.js → chunk-UFL7IYCW.js} +4 -4
  26. package/bundle/{chunk-LDMXJIA6.js → chunk-UUP372DR.js} +44 -67
  27. package/bundle/{chunk-OOFW75PV.js → chunk-UYK5MZWE.js} +15 -11
  28. package/bundle/{chunk-CSSZRTKY.js → chunk-V2BZYLEP.js} +2 -2
  29. package/bundle/{chunk-4BW55BTL.js → chunk-VLFZIN6D.js} +4 -4
  30. package/bundle/{chunk-527E3D2J.js → chunk-YXFJVCOL.js} +5 -5
  31. package/bundle/{chunk-HXVKGS33.js → chunk-ZVOAMTUQ.js} +4 -4
  32. package/bundle/control-channel.js +3 -3
  33. package/bundle/index.js +1 -1
  34. package/bundle/intercom-bridge.js +3 -3
  35. package/bundle/preflight.js +9 -9
  36. package/bundle/project-panes.js +4 -4
  37. package/docs/configuration.md +12 -1
  38. package/docs/extension-api.md +2 -0
  39. package/docs/missions.md +2 -0
  40. package/docs/tool-reference.md +1 -1
  41. package/package.json +1 -1
  42. package/src/agents/agent-management.d.ts +1 -1
  43. package/src/agents/agent-management.js +2 -2
  44. package/src/agents/agents.js +1 -2
  45. package/src/agents/frontmatter.js +22 -18
  46. package/src/extension/index.js +2 -2
  47. package/src/missions/actions.js +7 -2
  48. package/src/missions/lifecycle.d.ts +11 -0
  49. package/src/missions/lifecycle.js +37 -6
  50. package/src/missions/store.js +1 -0
  51. package/src/missions/types.d.ts +2 -0
  52. package/src/runs/background/async-execution.d.ts +1 -1
  53. package/src/runs/background/async-execution.js +3 -3
  54. package/src/runs/background/async-resume.js +3 -2
  55. package/src/runs/background/retained-children.js +1 -1
  56. package/src/runs/foreground/subagent-executor.js +24 -51
  57. package/src/runs/shared/capability-ceiling.d.ts +2 -1
  58. package/src/runs/shared/capability-ceiling.js +3 -2
  59. package/src/runs/shared/parallel-handoff.d.ts +1 -1
  60. package/src/runs/shared/parallel-handoff.js +10 -6
  61. package/src/shared/types.d.ts +1 -1
  62. package/src/workflows/scripted-workflow.js +4 -1
  63. package/workflow-script-worker.cjs +2 -1
package/CHANGELOG.md CHANGED
@@ -2,11 +2,31 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.83.1] - 2026-10-27
6
+
7
+ ### Highlights
8
+
9
+ - Stopping, interrupting, or resuming a subagent can no longer act on the wrong run: an interrupt with no id is refused, and resuming a worktree child while it is still cleaning up no longer runs it in your main checkout.
10
+ - A mission you start on purpose stays open until its result is checked, instead of showing `completed` on the writer's own report.
11
+ - Capability limits registered by session id, as the docs show, now cover background runs and workflow children, not only foreground launches.
12
+ - Agent files with a blank line inside an indented block are read in full, so settings below that line are no longer dropped.
13
+
14
+ ### Fixed
15
+
16
+ - `subagent({ action: "interrupt" })` without an id is now refused with "action='interrupt' requires id.", the same as `stop`, `steer`, and `resume`. Before, it interrupted the last foreground run or the newest background run, so a call that lost its id could interrupt the wrong child. When an id matches no run, `stop`, `interrupt`, and `resume` now name that id in the error. Thanks to [@mannainsect](https://github.com/mannainsect) for the report. (#3081)
17
+ - Resuming a background child that ran in its own worktree (`worktree: true`) no longer continues it in your main checkout. If you resumed it in the few seconds while it was saving its changes and removing its worktree, the child could start in your main checkout and commit or switch branches there, or start in a deleted worktree. That resume is now refused with a message to retry once the run finishes cleaning up. Thanks to [@peskycipher](https://github.com/peskycipher) for the report and [@isjiajia01](https://github.com/isjiajia01) for narrowing it down. (#3083)
18
+ - A mission you start with `mission` or `missionId` no longer becomes `completed` when nothing confirmed its result. Before, a background writer run with only its own report marked its mission `completed`, so a claimed result looked like a proven one. When the run, or any workflow child in the mission, ends with acceptance `review-required`, `rejected`, `claimed`, or `pending`, the mission now stays `waiting`, and `mission.show` lists each child's acceptance status. Close it with `mission.close` after you check the result. A `gate` or `acceptance.verify` command alone does not complete a writer run's mission, because writer runs also need a review; add `review: { required: false }` to the `acceptance` policy when the command is enough ([missions.md](docs/missions.md)). Missions created automatically for ordinary launches still complete as before. Thanks to [@kiote](https://github.com/kiote). (#3078)
19
+ - A capability ceiling registered the way the docs show, with `ctx.sessionManager.getSessionId()`, now applies in saved sessions. Before, most checks looked it up by session file path, so background launches, workflow children, and `{ action: "list" }` ignored it and only foreground launches were blocked. Every check now uses the session id, so a ceiling registered by session file path no longer applies. Thanks to [@corobis](https://github.com/corobis) for the report. (#3087)
20
+ - A blank line inside an indented block in an agent file's frontmatter, such as an `external-cli` script argument with an empty line, cut the value off there and dropped every setting below it. The whole block is now read. Lists that used to stop at a blank line, such as `tools:`, now include their later entries, so an agent can get tools it did not get before. `|` and `>` blocks are unchanged. Thanks to [@jbachorik](https://github.com/jbachorik). (#3089)
21
+ - A workflow script that called `runs.run({ key, agent, task })` with a single object passed validation and then failed with "runs.run has an invalid key.". Validation now rejects that call, and both the validation error and the running script show the right forms: `runs.run("plan", { agent, task })` or `runs.all([{ key, agent, task }])`. Thanks to [@brunovcosta](https://github.com/brunovcosta) for the report. (#3088)
22
+ - In a project you have not trusted, agent lookup no longer scans the project's `.git`, `.pi`, and `.agents` folders on every call. It already ignored what was in them, but it still listed them to decide when to refresh, so ordinary git activity made it rebuild its agent list. Thanks to [@ArietidsZ](https://github.com/ArietidsZ). (#3080)
23
+ - Long errors and verdicts in the `runs.lanes` result are now cut at a whole character, so they no longer end in a broken character or go over the 256-byte limit. Thanks to [@XLi-hub](https://github.com/XLi-hub). (#3097)
24
+
5
25
  ## [0.83.0] - 2026-10-25
6
26
 
7
27
  ### Highlights
8
28
 
9
- - Subagents no longer break your session's prompt cache on models that take system messages mid-conversation, so each turn after a subagent returns is cheaper and faster. A child that runs its own subagents keeps its cache too.
29
+ - When an extension or tool search changes the system prompt or tools during a session, subagent results no longer make every later turn miss the prompt cache, so those turns are cheaper and faster again. A child that runs its own subagents keeps its cache too.
10
30
  - Subagents that finished their work always report it: background runs no longer end as "exited with code 0 before writing a result", and foreground calls no longer hang when the child stops after its final reply.
11
31
  - Children placed on another machine (a Rex tab, Rex over SSH, or a Herdr pane) launch instead of being refused, and workflows no longer crash on Windows standalone Pi builds.
12
32
  - Extensions and editors that show subagent activity can refresh on a new event instead of polling, and `bg_wait` now waits for background jobs that other extensions report, such as surf-cli's.
@@ -18,7 +38,7 @@
18
38
 
19
39
  ### Fixed
20
40
 
21
- - On models that take system messages mid-conversation, the first request of every new turn after the first subagent notice missed the prompt cache, so most of the context was sent uncached again each turn. A child that had called `subagent` missed it on every later request. The way pi-subagents marked its notices and removed parent-only subagent history made Pi move every mid-conversation system message to the start of the prompt; both now leave those messages where they are. Thanks to [@adameq](https://github.com/adameq) for the report. (#3058, #3063)
41
+ - When an extension or tool search changed the system prompt or tools during a session, the first request of every new turn after the first subagent notice missed the prompt cache, so most of the context was sent uncached again each turn. A child that had called `subagent` missed it on every later request. On models where Pi adds those changes further down the conversation instead of rewriting the start of the prompt (Anthropic and OpenAI models, among others), the way pi-subagents marked its notices and removed parent-only subagent history made Pi move them all back into the start of the prompt, which then changed every turn. Both now leave those changes where they are. Thanks to [@adameq](https://github.com/adameq) for the report. (#3058, #3063)
22
42
  - Background subagents that finished their work no longer end as "exited with code 0 before writing a result". When a child stopped after its final reply without reporting that it had settled, or when one of its extensions hung on shutdown, the background runner process exited with the result still unwritten. It now ends the child after its final reply, waits for any compaction that runs after that reply, and waits at most 5 seconds for shutdown handlers. A foreground subagent whose child stops the same way now returns its reply too, instead of the call never returning. Thanks to [@perriea](https://github.com/perriea). (#3051)
23
43
  - Background jobs that other extensions report to `bg_wait`, such as surf-cli's or pi-agent-wait's, are now waited for in saved sessions. Before, `bg_wait` and the wait at the end of a `pi -p` run matched a job only when the extension named the session by its file path, so a job named by the session id was ignored and they returned while it was still running. Both forms are now accepted. Thanks to [@cad0p](https://github.com/cad0p) for the report. (#3071)
24
44
  - With features turned off in `disabledFeatures`, every `guide` topic now starts with a notice listing what is disabled, and every section with a one-line pointer to that list, not only the `tool-reference` topic. Before, an agent reading the workflow guide with `workflow-scripts` disabled was taught `workflow: true` and `args`, and its call was rejected. With workflow scripts disabled, the notice also says to use the top-level `tasks` or `chain` fields instead. Thanks to [@jefftheai](https://github.com/jefftheai) for the report. (#3057)
package/bundle/agents.js CHANGED
@@ -2,14 +2,14 @@ import {
2
2
  RUNTIME_AGENT_REGISTER_EVENT,
3
3
  RUNTIME_AGENT_REGISTER_VERSION,
4
4
  registerAgentViaEvents
5
- } from "./chunk-MBDOYZ2V.js";
5
+ } from "./chunk-2S4K53MV.js";
6
6
  import {
7
7
  registerRuntimeAgent
8
- } from "./chunk-JHZ6DZ5M.js";
9
- import "./chunk-7F5SK2U3.js";
8
+ } from "./chunk-G2Z6ZH26.js";
9
+ import "./chunk-LNRJCP2Y.js";
10
10
  import "./chunk-JEZOSEWG.js";
11
11
  import "./chunk-YFCK7H2S.js";
12
- import "./chunk-Z7KVHQHL.js";
12
+ import "./chunk-QXASAHIA.js";
13
13
  export {
14
14
  RUNTIME_AGENT_REGISTER_EVENT,
15
15
  RUNTIME_AGENT_REGISTER_VERSION,
@@ -8,7 +8,7 @@ import {
8
8
  registerSubagentCapabilityCeiling,
9
9
  resolveCurrentSubagentCapabilityCeiling,
10
10
  resolveSubagentCapabilityCeiling
11
- } from "./chunk-Z7KVHQHL.js";
11
+ } from "./chunk-QXASAHIA.js";
12
12
  export {
13
13
  SUBAGENT_CAPABILITY_CEILING_REGISTRY_KEY,
14
14
  SUBAGENT_CAPABILITY_CEILING_VERSION,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  resolvePiLaunchToolPlan
3
- } from "./chunk-CSSZRTKY.js";
3
+ } from "./chunk-V2BZYLEP.js";
4
4
  import "./chunk-CTPAE36Y.js";
5
- import "./chunk-7F5SK2U3.js";
5
+ import "./chunk-LNRJCP2Y.js";
6
6
  import "./chunk-JEZOSEWG.js";
7
7
  import "./chunk-YFCK7H2S.js";
8
- import "./chunk-Z7KVHQHL.js";
8
+ import "./chunk-QXASAHIA.js";
9
9
  export {
10
10
  resolvePiLaunchToolPlan
11
11
  };
@@ -2,7 +2,7 @@ import {
2
2
  CODE_OWNED_EXTERNAL_CLI_ADAPTER_IDS,
3
3
  getAgentDir,
4
4
  getProjectConfigDir
5
- } from "./chunk-7F5SK2U3.js";
5
+ } from "./chunk-LNRJCP2Y.js";
6
6
 
7
7
  // src/runs/shared/rex-machine.ts
8
8
  import { spawnSync } from "node:child_process";
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-7J4ZXMY7.js";
4
4
  import {
5
5
  getProjectSubagentsDir
6
- } from "./chunk-VTMNBPCQ.js";
6
+ } from "./chunk-D3JAFGMO.js";
7
7
  import {
8
8
  getPiSpawnCommand,
9
9
  writeAtomicJson
10
- } from "./chunk-7F5SK2U3.js";
10
+ } from "./chunk-LNRJCP2Y.js";
11
11
 
12
12
  // src/inspectors/herdr/project-panes.ts
13
13
  import * as fs from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  registerRuntimeAgent
3
- } from "./chunk-JHZ6DZ5M.js";
3
+ } from "./chunk-G2Z6ZH26.js";
4
4
 
5
5
  // src/agents/runtime-agent-events.ts
6
6
  var RUNTIME_AGENT_REGISTER_EVENT = "pi-subagents:runtime-agent-register:v1";
@@ -10,10 +10,10 @@ import {
10
10
  setInlineWorkflowCoverage,
11
11
  setMainThinkingLevelSource,
12
12
  widgetRenderKey
13
- } from "./chunk-HXVKGS33.js";
13
+ } from "./chunk-ZVOAMTUQ.js";
14
14
  import {
15
15
  package_default
16
- } from "./chunk-6B4ITO2W.js";
16
+ } from "./chunk-MABL3FUM.js";
17
17
  import {
18
18
  EXTERNAL_JOB_BRIDGE_REQUEST_DIR,
19
19
  REVIVAL_ORIGIN_FILE,
@@ -61,7 +61,7 @@ import {
61
61
  snapshotProviderDiagnostics,
62
62
  workflowResumeClaimState,
63
63
  workflowResumeRefusal
64
- } from "./chunk-CDI3GMNV.js";
64
+ } from "./chunk-F5DBXJ2G.js";
65
65
  import {
66
66
  CONTACT_SUPERVISOR_TOOL_NAME,
67
67
  NATIVE_SUPERVISOR_TOOL_NAME,
@@ -89,14 +89,14 @@ import {
89
89
  resolveWaitToolConfig,
90
90
  setDeclarationPinning,
91
91
  topLevelSupervisorTool
92
- } from "./chunk-CZTMUBUI.js";
92
+ } from "./chunk-UFL7IYCW.js";
93
93
  import {
94
94
  deliverAsyncRunStop,
95
95
  ownerConfirmedDead,
96
96
  readSessionMessagesTail,
97
97
  resolveSubagentRunId,
98
98
  restoreForegroundRunHistory
99
- } from "./chunk-4BW55BTL.js";
99
+ } from "./chunk-VLFZIN6D.js";
100
100
  import {
101
101
  ASYNC_STATUS_SNAPSHOT_KIND,
102
102
  ASYNC_STATUS_SNAPSHOT_VERSION,
@@ -118,7 +118,7 @@ import {
118
118
  resolveAsyncStatusChild,
119
119
  stopStoppableAsyncStatusChildren,
120
120
  withCachedUiContext
121
- } from "./chunk-OOFW75PV.js";
121
+ } from "./chunk-UYK5MZWE.js";
122
122
  import "./chunk-NF7IEKBH.js";
123
123
  import {
124
124
  disabledFeatureUseError,
@@ -129,7 +129,7 @@ import {
129
129
  resolveDisabledFeatureSurface,
130
130
  resolveMaxActiveAsyncRunsPerSession,
131
131
  resolveScheduledStoreRoot
132
- } from "./chunk-RZJN63GU.js";
132
+ } from "./chunk-QP5ZWNIS.js";
133
133
  import {
134
134
  ACTIVE_RUN_INDEX_DIR,
135
135
  MissionNotFoundError,
@@ -178,28 +178,28 @@ import {
178
178
  withWorkflowChildRunModel,
179
179
  writeAsyncResultFile,
180
180
  writeResultIndexForData
181
- } from "./chunk-5ESXK62X.js";
182
- import "./chunk-BKFWQ642.js";
181
+ } from "./chunk-RNIZLSEA.js";
182
+ import "./chunk-F4ASL6OV.js";
183
183
  import {
184
184
  shouldUseNativeFsWatch
185
185
  } from "./chunk-NIXWDZZV.js";
186
186
  import {
187
187
  validateIntercomBridgeConfig
188
- } from "./chunk-MHX22USZ.js";
188
+ } from "./chunk-C5P5CHYK.js";
189
189
  import "./chunk-7F6RKT6W.js";
190
- import "./chunk-CSSZRTKY.js";
190
+ import "./chunk-V2BZYLEP.js";
191
191
  import "./chunk-CTPAE36Y.js";
192
192
  import {
193
193
  listHerdrProjectPaneRoots,
194
194
  restoreHerdrProjectPaneSnapshots
195
- } from "./chunk-WG2OTTAK.js";
195
+ } from "./chunk-2DHZTCOL.js";
196
196
  import "./chunk-7J4ZXMY7.js";
197
197
  import {
198
198
  cleanupAllArtifactDirs,
199
199
  cleanupOldArtifacts,
200
200
  getArtifactPaths,
201
201
  getArtifactsDir
202
- } from "./chunk-VTMNBPCQ.js";
202
+ } from "./chunk-D3JAFGMO.js";
203
203
  import {
204
204
  listBackgroundWorkProviders
205
205
  } from "./chunk-XA3DY6UG.js";
@@ -207,12 +207,12 @@ import "./chunk-YYREO77V.js";
207
207
  import "./chunk-UKG4V45O.js";
208
208
  import {
209
209
  registerRuntimeAgentEventListener
210
- } from "./chunk-MBDOYZ2V.js";
210
+ } from "./chunk-2S4K53MV.js";
211
211
  import {
212
212
  clearRuntimeAgentsForPi,
213
213
  listRuntimeAgentConfigs,
214
214
  mergeRuntimeAgents
215
- } from "./chunk-JHZ6DZ5M.js";
215
+ } from "./chunk-G2Z6ZH26.js";
216
216
  import {
217
217
  DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
218
218
  EXTRA_AGENT_DIRS_ENV,
@@ -252,7 +252,7 @@ import {
252
252
  waitForFileSystemRetry,
253
253
  withSettingsFileLease,
254
254
  writeAtomicJson
255
- } from "./chunk-7F5SK2U3.js";
255
+ } from "./chunk-LNRJCP2Y.js";
256
256
  import {
257
257
  DEFAULT_ARTIFACT_CONFIG,
258
258
  DIRS,
@@ -293,7 +293,7 @@ import {
293
293
  import {
294
294
  isAgentAllowedByCapabilityCeiling,
295
295
  resolveCurrentSubagentCapabilityCeiling
296
- } from "./chunk-Z7KVHQHL.js";
296
+ } from "./chunk-QXASAHIA.js";
297
297
 
298
298
  // src/extension/index.ts
299
299
  import { randomUUID as randomUUID3 } from "node:crypto";
@@ -5182,7 +5182,7 @@ function registerSlashCommands(pi, state, options = {}) {
5182
5182
  }
5183
5183
  fleetOpen = true;
5184
5184
  try {
5185
- const { openSubagentFleet } = await import("./chunk-TJQJ3MEA.js");
5185
+ const { openSubagentFleet } = await import("./chunk-IPGZMQXV.js");
5186
5186
  await openSubagentFleet(ctx, state, { asyncDirRoot: DIRS.async, inspectorPlugins: () => getInspectorPlugins(pi), resultsDir: DIRS.results, fleetKeybindings: options.fleetKeybindings });
5187
5187
  } finally {
5188
5188
  fleetOpen = false;
@@ -8571,7 +8571,7 @@ function registerSubagentExtension(pi) {
8571
8571
  const ctx = withLastUiContext((current) => current);
8572
8572
  if (!ctx) return;
8573
8573
  try {
8574
- const { openSubagentFleet } = await import("./chunk-TJQJ3MEA.js");
8574
+ const { openSubagentFleet } = await import("./chunk-IPGZMQXV.js");
8575
8575
  await openSubagentFleet(ctx, state, { initialKey: itemKey, asyncDirRoot: DIRS.async, resultsDir: DIRS.results, fleetKeybindings: config.fleetKeybindings, inspectorPlugins: () => getInspectorPlugins(pi) });
8576
8576
  } catch (error) {
8577
8577
  if (isStaleExtensionContextError(error)) {
@@ -8767,7 +8767,7 @@ function registerSubagentExtension(pi) {
8767
8767
  let executor;
8768
8768
  let executorPromise;
8769
8769
  let executorModulePromise;
8770
- const loadExecutorModule = () => executorModulePromise ??= import("./chunk-LDMXJIA6.js");
8770
+ const loadExecutorModule = () => executorModulePromise ??= import("./chunk-UUP372DR.js");
8771
8771
  const getExecutor = () => {
8772
8772
  executorPromise ??= loadExecutorModule().then(({ createSubagentExecutor }) => {
8773
8773
  executor = createSubagentExecutor(executorDeps);
@@ -8781,7 +8781,7 @@ function registerSubagentExtension(pi) {
8781
8781
  modulePreloadTimer = setTimeout(() => {
8782
8782
  loadExecutorModule().catch(() => {
8783
8783
  });
8784
- if (fleetViewEnabled) import("./chunk-TJQJ3MEA.js").catch(() => {
8784
+ if (fleetViewEnabled) import("./chunk-IPGZMQXV.js").catch(() => {
8785
8785
  });
8786
8786
  }, MODULE_PRELOAD_DELAY_MS);
8787
8787
  modulePreloadTimer.unref?.();
@@ -8947,7 +8947,7 @@ ${close}` }]
8947
8947
  const activeRuns = config.activeRunsPrompt === true ? buildActiveRunsSection(state.asyncJobs.values(), sessionId) : void 0;
8948
8948
  if (activeRuns) event.systemPromptOptions.sections.active_subagents = activeRuns;
8949
8949
  if (!event.systemPromptOptions.selectedTools.includes("subagent")) return;
8950
- const catalog = buildAdvertisedAgentCatalog(advertisedAgents, resolveCurrentSubagentCapabilityCeiling(sessionId), recordedPromptSection(pi, "advertised_subagents"));
8950
+ const catalog = buildAdvertisedAgentCatalog(advertisedAgents, resolveCurrentSubagentCapabilityCeiling(ctx.sessionManager.getSessionId() ?? void 0), recordedPromptSection(pi, "advertised_subagents"));
8951
8951
  if (catalog) event.systemPromptOptions.sections.advertised_subagents = catalog;
8952
8952
  });
8953
8953
  registerWaitTool(pi, state, waitToolConfig.enabled, waitSubscriptionManager, waitToolConfig.defaultTimeoutMs, void 0, supervisorChannel.hasPendingRequests);
@@ -9361,7 +9361,7 @@ ${close}` }]
9361
9361
  hasPendingSupervisorRequest: () => [...supervisorChannel.pending.values()].some((request) => request.expectsReply),
9362
9362
  advertisedPrompt: async () => {
9363
9363
  await waitForAdvertisement();
9364
- return buildAdvertisedAgentPrompt(advertisedAgents, resolveCurrentSubagentCapabilityCeiling(state.currentSessionId ?? void 0));
9364
+ return buildAdvertisedAgentPrompt(advertisedAgents, resolveCurrentSubagentCapabilityCeiling(state.supervisorOwnerSessionId ?? void 0));
9365
9365
  }
9366
9366
  });
9367
9367
  }
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  rewriteSubagentPrompt
3
- } from "./chunk-CGXWSNPA.js";
3
+ } from "./chunk-NPIYWVOD.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-6B4ITO2W.js";
7
- import "./chunk-CZTMUBUI.js";
6
+ } from "./chunk-MABL3FUM.js";
7
+ import "./chunk-UFL7IYCW.js";
8
8
  import {
9
9
  MODEL_ONLY_TOOL
10
- } from "./chunk-OOFW75PV.js";
10
+ } from "./chunk-UYK5MZWE.js";
11
11
  import "./chunk-NF7IEKBH.js";
12
12
  import {
13
13
  appendAgentRefinementOverlay
14
- } from "./chunk-Y3I6H6DV.js";
15
- import "./chunk-5ESXK62X.js";
14
+ } from "./chunk-LFDBD4PW.js";
15
+ import "./chunk-RNIZLSEA.js";
16
16
  import "./chunk-NIXWDZZV.js";
17
- import "./chunk-MHX22USZ.js";
17
+ import "./chunk-C5P5CHYK.js";
18
18
  import "./chunk-7F6RKT6W.js";
19
19
  import {
20
20
  assertNoToolModifierEntries
21
- } from "./chunk-CSSZRTKY.js";
21
+ } from "./chunk-V2BZYLEP.js";
22
22
  import "./chunk-CTPAE36Y.js";
23
- import "./chunk-VTMNBPCQ.js";
23
+ import "./chunk-D3JAFGMO.js";
24
24
  import {
25
25
  HERDR_PI_MAX_FRAME_BYTES,
26
26
  HERDR_PI_PROTOCOL,
@@ -37,10 +37,10 @@ import {
37
37
  discoverAgents,
38
38
  resolveExistingReadPaths,
39
39
  resolveSkills
40
- } from "./chunk-7F5SK2U3.js";
40
+ } from "./chunk-LNRJCP2Y.js";
41
41
  import "./chunk-JEZOSEWG.js";
42
42
  import "./chunk-YFCK7H2S.js";
43
- import "./chunk-Z7KVHQHL.js";
43
+ import "./chunk-QXASAHIA.js";
44
44
 
45
45
  // src/extension/herdr-pi-bridge.ts
46
46
  import { spawnSync } from "node:child_process";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-7F6RKT6W.js";
4
4
  import {
5
5
  getAgentDir
6
- } from "./chunk-7F5SK2U3.js";
6
+ } from "./chunk-LNRJCP2Y.js";
7
7
 
8
8
  // src/intercom/intercom-bridge.ts
9
9
  import * as fs from "node:fs";
@@ -13,10 +13,10 @@ import {
13
13
  rexGlobalArgs,
14
14
  runBoundedCommand,
15
15
  sshMachineAccess
16
- } from "./chunk-P2NCCTZP.js";
16
+ } from "./chunk-2D52JFLF.js";
17
17
  import {
18
18
  package_default
19
- } from "./chunk-6B4ITO2W.js";
19
+ } from "./chunk-MABL3FUM.js";
20
20
  import {
21
21
  HERDR_PI_MODE_ENV,
22
22
  HERDR_PI_PROTOCOL,
@@ -29,10 +29,10 @@ import {
29
29
  import {
30
30
  getAgentDir,
31
31
  getPiSpawnCommand
32
- } from "./chunk-7F5SK2U3.js";
32
+ } from "./chunk-LNRJCP2Y.js";
33
33
  import "./chunk-JEZOSEWG.js";
34
34
  import "./chunk-YFCK7H2S.js";
35
- import "./chunk-Z7KVHQHL.js";
35
+ import "./chunk-QXASAHIA.js";
36
36
 
37
37
  // src/runs/shared/herdr-placed-run.ts
38
38
  import { randomBytes as randomBytes2 } from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAgentDir
3
- } from "./chunk-7F5SK2U3.js";
3
+ } from "./chunk-LNRJCP2Y.js";
4
4
  import {
5
5
  TEMP_ARTIFACTS_DIR
6
6
  } from "./chunk-JEZOSEWG.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveWatchPath,
6
6
  writeAtomicJson
7
- } from "./chunk-7F5SK2U3.js";
7
+ } from "./chunk-LNRJCP2Y.js";
8
8
  import {
9
9
  POLL_INTERVAL_MS
10
10
  } from "./chunk-JEZOSEWG.js";
@@ -11,10 +11,10 @@ import {
11
11
  startWatchdogDiffBaselineCapture,
12
12
  writeUserWatchdogEnabled,
13
13
  writeWatchdogModelSettings
14
- } from "./chunk-CZTMUBUI.js";
14
+ } from "./chunk-UFL7IYCW.js";
15
15
  import {
16
16
  resolveGitRepositoryIdentity
17
- } from "./chunk-4BW55BTL.js";
17
+ } from "./chunk-VLFZIN6D.js";
18
18
  import {
19
19
  listAsyncRuns,
20
20
  ownsRun,
@@ -22,7 +22,7 @@ import {
22
22
  parseWorkflowChildSummary,
23
23
  readAsyncRecoveryDescriptor,
24
24
  resolveRetainedWorktreeCwd
25
- } from "./chunk-OOFW75PV.js";
25
+ } from "./chunk-UYK5MZWE.js";
26
26
  import {
27
27
  deepFreezeWorkflowArgs,
28
28
  normalizeWorkflowArgs
@@ -50,21 +50,21 @@ import {
50
50
  resolveMissionStoreLocation,
51
51
  validateMissionId,
52
52
  workflowRunParamsFingerprint
53
- } from "./chunk-5ESXK62X.js";
53
+ } from "./chunk-RNIZLSEA.js";
54
54
  import {
55
55
  requestAsyncCommand,
56
56
  watchAsyncControlInbox
57
- } from "./chunk-BKFWQ642.js";
57
+ } from "./chunk-F4ASL6OV.js";
58
58
  import {
59
59
  supervisorChannelDir
60
- } from "./chunk-CSSZRTKY.js";
60
+ } from "./chunk-V2BZYLEP.js";
61
61
  import {
62
62
  createHerdrClient,
63
63
  detectHerdr
64
- } from "./chunk-WG2OTTAK.js";
64
+ } from "./chunk-2DHZTCOL.js";
65
65
  import {
66
66
  getProjectSubagentsDir
67
- } from "./chunk-VTMNBPCQ.js";
67
+ } from "./chunk-D3JAFGMO.js";
68
68
  import {
69
69
  ExternalJobProviderError,
70
70
  getExternalJobProvider,
@@ -74,7 +74,7 @@ import {
74
74
  } from "./chunk-YYREO77V.js";
75
75
  import {
76
76
  mergeRuntimeAgents
77
- } from "./chunk-JHZ6DZ5M.js";
77
+ } from "./chunk-G2Z6ZH26.js";
78
78
  import {
79
79
  CODE_OWNED_EXTERNAL_CLI_ADAPTER_LABEL,
80
80
  PI_CODING_AGENT_PACKAGE,
@@ -129,7 +129,7 @@ import {
129
129
  withFileLease,
130
130
  writeAtomicJson,
131
131
  writePrivateAtomicJson
132
- } from "./chunk-7F5SK2U3.js";
132
+ } from "./chunk-LNRJCP2Y.js";
133
133
  import {
134
134
  DIRS,
135
135
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -155,7 +155,7 @@ import {
155
155
  capabilityCeilingAgentRestrictionSources,
156
156
  isAgentAllowedByCapabilityCeiling,
157
157
  resolveCurrentSubagentCapabilityCeiling
158
- } from "./chunk-Z7KVHQHL.js";
158
+ } from "./chunk-QXASAHIA.js";
159
159
 
160
160
  // src/inspectors/herdr/actions.ts
161
161
  import * as fs from "node:fs";
@@ -3757,7 +3757,7 @@ function handleList(params, ctx) {
3757
3757
  const d = discoverCatalog(ctx, ctx.cwd, ctx.model?.provider);
3758
3758
  let scopedAgents = effectiveAgentsForScope(scope, d, ctx.runtimeAgentOwner, ctx.model?.provider);
3759
3759
  scopedAgents = scopedAgents.sort((a, b) => a.name.localeCompare(b.name));
3760
- const capabilityCeiling = resolveCurrentSubagentCapabilityCeiling(ctx.currentSessionId);
3760
+ const capabilityCeiling = resolveCurrentSubagentCapabilityCeiling(ctx.piSessionId);
3761
3761
  const visibleAgents = scopedAgents.filter((a) => !a.disabled);
3762
3762
  const agents = visibleAgents.filter((a) => isAgentAllowedByCapabilityCeiling(a.name, capabilityCeiling));
3763
3763
  const restrictedAgents = visibleAgents.filter((a) => !isAgentAllowedByCapabilityCeiling(a.name, capabilityCeiling));
@@ -3809,7 +3809,7 @@ function handleModels(params, ctx) {
3809
3809
  const availableModels = ctx.modelRegistry.getAvailable().map(toModelInfo);
3810
3810
  const currentModel = ctx.model ? { provider: ctx.model.provider, id: ctx.model.id } : void 0;
3811
3811
  const preferredProvider = ctx.model?.provider;
3812
- const capabilityCeiling = resolveCurrentSubagentCapabilityCeiling(ctx.currentSessionId);
3812
+ const capabilityCeiling = resolveCurrentSubagentCapabilityCeiling(ctx.piSessionId);
3813
3813
  let selectedAgents = effectiveAgents;
3814
3814
  if (requestedAgent) {
3815
3815
  const matches = findAgentsInDiscovery(requestedAgent, discovered, scope, ctx.runtimeAgentOwner, ctx.model?.provider);
@@ -7718,7 +7718,7 @@ function childSessionFactory() {
7718
7718
  }
7719
7719
  function createLazyPlacementFactory(local) {
7720
7720
  let placed;
7721
- const factory = async () => placed ??= (await import("./chunk-XXKG3P2W.js")).createPlacementAwareChildSessionFactory(local);
7721
+ const factory = async () => placed ??= (await import("./chunk-C7JMPU5F.js")).createPlacementAwareChildSessionFactory(local);
7722
7722
  return {
7723
7723
  async create(launch) {
7724
7724
  return launch.machine ? (await factory()).create(launch) : local.create(launch);
@@ -8026,7 +8026,7 @@ function childResumability(run, step) {
8026
8026
  }
8027
8027
  let requiredCwd;
8028
8028
  try {
8029
- requiredCwd = resolveRetainedWorktreeCwd(parallelHandoffPath(run.asyncDir), run.id, step.index) ?? recoveryDescriptor.cwd ?? run.cwd;
8029
+ requiredCwd = resolveRetainedWorktreeCwd(parallelHandoffPath(run.asyncDir), run.id, step.index, step.worktreePath) ?? recoveryDescriptor.cwd ?? run.cwd;
8030
8030
  if (!requiredCwd || !fs16.statSync(requiredCwd).isDirectory()) return { state: "not-resumable", reason: `required cwd is missing: ${requiredCwd ?? "unknown"}` };
8031
8031
  } catch (error2) {
8032
8032
  return { state: "not-resumable", reason: `resume dependency unavailable: ${error2 instanceof Error ? error2.message : String(error2)}` };
@@ -8,7 +8,7 @@ import {
8
8
  validateCodeOwnedProfileRunner,
9
9
  validatePermissionRules,
10
10
  validateToolBudgetConfig
11
- } from "./chunk-7F5SK2U3.js";
11
+ } from "./chunk-LNRJCP2Y.js";
12
12
 
13
13
  // src/agents/runtime-agent-registry.ts
14
14
  var RUNTIME_AGENT_REGISTRY_KEY = "pi-subagents.runtime-agents.v1";
@@ -6,35 +6,35 @@ import {
6
6
  resolveWorkflowForegroundSteeringTarget,
7
7
  steerAsyncRun,
8
8
  steerWorkflowForegroundTarget
9
- } from "./chunk-527E3D2J.js";
9
+ } from "./chunk-YXFJVCOL.js";
10
10
  import {
11
11
  FLEET_STATUS_WIDGET_KEY,
12
12
  reportFleetWarning,
13
13
  runningTone,
14
14
  stepTaskSummary
15
- } from "./chunk-HXVKGS33.js";
15
+ } from "./chunk-ZVOAMTUQ.js";
16
16
  import {
17
17
  foregroundChildStateLabel,
18
18
  formatAsyncRunTranscript,
19
19
  stopAsyncRun
20
- } from "./chunk-4BW55BTL.js";
20
+ } from "./chunk-VLFZIN6D.js";
21
21
  import {
22
22
  contextModeBadge,
23
23
  contextModeLabel,
24
24
  decodeUtf8Tail,
25
25
  listAsyncRuns
26
- } from "./chunk-OOFW75PV.js";
27
- import "./chunk-5ESXK62X.js";
28
- import "./chunk-BKFWQ642.js";
26
+ } from "./chunk-UYK5MZWE.js";
27
+ import "./chunk-RNIZLSEA.js";
28
+ import "./chunk-F4ASL6OV.js";
29
29
  import "./chunk-NIXWDZZV.js";
30
- import "./chunk-MHX22USZ.js";
30
+ import "./chunk-C5P5CHYK.js";
31
31
  import "./chunk-7F6RKT6W.js";
32
32
  import "./chunk-CTPAE36Y.js";
33
33
  import "./chunk-7J4ZXMY7.js";
34
34
  import {
35
35
  getArtifactPaths,
36
36
  getArtifactsDir
37
- } from "./chunk-VTMNBPCQ.js";
37
+ } from "./chunk-D3JAFGMO.js";
38
38
  import {
39
39
  snapshotExternalRuns
40
40
  } from "./chunk-UKG4V45O.js";
@@ -46,12 +46,12 @@ import {
46
46
  formatTokens,
47
47
  readStatus,
48
48
  shortenPath
49
- } from "./chunk-7F5SK2U3.js";
49
+ } from "./chunk-LNRJCP2Y.js";
50
50
  import {
51
51
  DIRS
52
52
  } from "./chunk-JEZOSEWG.js";
53
53
  import "./chunk-YFCK7H2S.js";
54
- import "./chunk-Z7KVHQHL.js";
54
+ import "./chunk-QXASAHIA.js";
55
55
 
56
56
  // src/tui/fleet.ts
57
57
  import * as fs from "node:fs";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getProjectSubagentsDir
3
- } from "./chunk-VTMNBPCQ.js";
3
+ } from "./chunk-D3JAFGMO.js";
4
4
  import {
5
5
  discoverAgents,
6
6
  formatUnknownAgentError,
7
7
  resolveAgentName,
8
8
  unknownAgentDiagnosticContext
9
- } from "./chunk-7F5SK2U3.js";
9
+ } from "./chunk-LNRJCP2Y.js";
10
10
 
11
11
  // src/agents/agent-refinements.ts
12
12
  import { createHash, randomUUID } from "node:crypto";