pi-subagents 0.83.0 → 0.84.0
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 +39 -2
- package/bundle/agents.js +4 -4
- package/bundle/capability-ceiling.js +1 -1
- package/bundle/child-tool-plan.js +3 -3
- package/bundle/{chunk-HJJAVHFB.js → chunk-235AWJUQ.js} +35 -32
- package/bundle/{chunk-P2NCCTZP.js → chunk-2D52JFLF.js} +1 -1
- package/bundle/{chunk-WG2OTTAK.js → chunk-2DHZTCOL.js} +2 -2
- package/bundle/{chunk-MBDOYZ2V.js → chunk-2S4K53MV.js} +1 -1
- package/bundle/{chunk-527E3D2J.js → chunk-4E7BKDTX.js} +5 -5
- package/bundle/{chunk-CZTMUBUI.js → chunk-7BWGNDNK.js} +4 -4
- package/bundle/{chunk-HXVKGS33.js → chunk-AKOIVLA5.js} +4 -4
- package/bundle/{chunk-MHX22USZ.js → chunk-C5P5CHYK.js} +1 -1
- package/bundle/{chunk-5ESXK62X.js → chunk-CGN2TVE7.js} +417 -389
- package/bundle/{chunk-VTMNBPCQ.js → chunk-D3JAFGMO.js} +1 -1
- package/bundle/{chunk-CDI3GMNV.js → chunk-DZDETGRJ.js} +18 -15
- package/bundle/{chunk-BKFWQ642.js → chunk-F4ASL6OV.js} +1 -1
- package/bundle/{chunk-JHZ6DZ5M.js → chunk-G2Z6ZH26.js} +1 -1
- package/bundle/{chunk-XXKG3P2W.js → chunk-J5YL7LYR.js} +4 -4
- package/bundle/{chunk-LDMXJIA6.js → chunk-JG4QKI5M.js} +58 -67
- package/bundle/{chunk-OOFW75PV.js → chunk-L3WFKBEI.js} +15 -11
- package/bundle/{chunk-Y3I6H6DV.js → chunk-LFDBD4PW.js} +2 -2
- package/bundle/{chunk-7F5SK2U3.js → chunk-LNRJCP2Y.js} +17 -14
- package/bundle/{chunk-4BW55BTL.js → chunk-NENDSQUY.js} +4 -4
- package/bundle/{chunk-6B4ITO2W.js → chunk-NKQ6JNAS.js} +1 -1
- package/bundle/{chunk-RZJN63GU.js → chunk-PALJGGYC.js} +2 -2
- package/bundle/{chunk-TJQJ3MEA.js → chunk-PV63UFUR.js} +10 -10
- package/bundle/{chunk-Z7KVHQHL.js → chunk-QXASAHIA.js} +2 -2
- package/bundle/{chunk-HLE22FSH.js → chunk-SSG7IEP5.js} +2 -2
- package/bundle/{chunk-CSSZRTKY.js → chunk-V2BZYLEP.js} +2 -2
- package/bundle/{chunk-CNLDYEH4.js → chunk-VQVVHSY6.js} +11 -11
- package/bundle/{chunk-CGXWSNPA.js → chunk-XDQORLZ5.js} +4 -4
- package/bundle/control-channel.js +3 -3
- package/bundle/index.js +1 -1
- package/bundle/intercom-bridge.js +3 -3
- package/bundle/preflight.js +9 -9
- package/bundle/project-panes.js +4 -4
- package/docs/configuration.md +12 -1
- package/docs/extension-api.md +2 -0
- package/docs/missions.md +2 -0
- package/docs/tool-reference.md +1 -1
- package/package.json +1 -1
- package/src/agents/agent-management.d.ts +1 -1
- package/src/agents/agent-management.js +2 -2
- package/src/agents/agents.js +1 -2
- package/src/agents/frontmatter.js +22 -18
- package/src/extension/index.js +2 -2
- package/src/missions/actions.js +7 -2
- package/src/missions/lifecycle.d.ts +11 -0
- package/src/missions/lifecycle.js +37 -6
- package/src/missions/store.js +1 -0
- package/src/missions/types.d.ts +2 -0
- package/src/runs/background/async-execution.d.ts +4 -1
- package/src/runs/background/async-execution.js +18 -3
- package/src/runs/background/async-resume.js +3 -2
- package/src/runs/background/async-retention.d.ts +1 -0
- package/src/runs/background/async-retention.js +16 -10
- package/src/runs/background/retained-children.js +1 -1
- package/src/runs/background/run-child-session.d.ts +2 -0
- package/src/runs/background/run-child-session.js +9 -1
- package/src/runs/background/subagent-runner.js +1 -0
- package/src/runs/foreground/subagent-executor.js +29 -51
- package/src/runs/shared/capability-ceiling.d.ts +2 -1
- package/src/runs/shared/capability-ceiling.js +3 -2
- package/src/runs/shared/child-session.d.ts +2 -0
- package/src/runs/shared/child-session.js +1 -0
- package/src/runs/shared/model-resolution-diagnostic.d.ts +11 -0
- package/src/runs/shared/model-resolution-diagnostic.js +25 -0
- package/src/runs/shared/parallel-handoff.d.ts +1 -1
- package/src/runs/shared/parallel-handoff.js +10 -6
- package/src/runs/shared/parallel-utils.d.ts +2 -0
- package/src/shared/types.d.ts +1 -1
- package/src/workflows/scripted-workflow.js +6 -1
- package/workflow-script-worker.cjs +450 -175
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
startWatchdogDiffBaselineCapture,
|
|
12
12
|
writeUserWatchdogEnabled,
|
|
13
13
|
writeWatchdogModelSettings
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7BWGNDNK.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveGitRepositoryIdentity
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NENDSQUY.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-
|
|
25
|
+
} from "./chunk-L3WFKBEI.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-
|
|
53
|
+
} from "./chunk-CGN2TVE7.js";
|
|
54
54
|
import {
|
|
55
55
|
requestAsyncCommand,
|
|
56
56
|
watchAsyncControlInbox
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-F4ASL6OV.js";
|
|
58
58
|
import {
|
|
59
59
|
supervisorChannelDir
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-V2BZYLEP.js";
|
|
61
61
|
import {
|
|
62
62
|
createHerdrClient,
|
|
63
63
|
detectHerdr
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-2DHZTCOL.js";
|
|
65
65
|
import {
|
|
66
66
|
getProjectSubagentsDir
|
|
67
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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.
|
|
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);
|
|
@@ -7683,6 +7683,9 @@ function createDefaultChildSessionFactory(options = {}) {
|
|
|
7683
7683
|
get inheritedProvider() {
|
|
7684
7684
|
return session.model && inheritedProviders.has(session.model.provider) ? session.model.provider : void 0;
|
|
7685
7685
|
},
|
|
7686
|
+
get claimedProvider() {
|
|
7687
|
+
return session.model && !inheritedProviders.has(session.model.provider) && modelRuntime.getRegisteredProviderIds().includes(session.model.provider) ? session.model.provider : void 0;
|
|
7688
|
+
},
|
|
7686
7689
|
get virtualModelId() {
|
|
7687
7690
|
return session.model?.api === "pi-virtual" ? `${session.model.provider}/${session.model.id}` : void 0;
|
|
7688
7691
|
},
|
|
@@ -7718,7 +7721,7 @@ function childSessionFactory() {
|
|
|
7718
7721
|
}
|
|
7719
7722
|
function createLazyPlacementFactory(local) {
|
|
7720
7723
|
let placed;
|
|
7721
|
-
const factory = async () => placed ??= (await import("./chunk-
|
|
7724
|
+
const factory = async () => placed ??= (await import("./chunk-J5YL7LYR.js")).createPlacementAwareChildSessionFactory(local);
|
|
7722
7725
|
return {
|
|
7723
7726
|
async create(launch) {
|
|
7724
7727
|
return launch.machine ? (await factory()).create(launch) : local.create(launch);
|
|
@@ -8026,7 +8029,7 @@ function childResumability(run, step) {
|
|
|
8026
8029
|
}
|
|
8027
8030
|
let requiredCwd;
|
|
8028
8031
|
try {
|
|
8029
|
-
requiredCwd = resolveRetainedWorktreeCwd(parallelHandoffPath(run.asyncDir), run.id, step.index) ?? recoveryDescriptor.cwd ?? run.cwd;
|
|
8032
|
+
requiredCwd = resolveRetainedWorktreeCwd(parallelHandoffPath(run.asyncDir), run.id, step.index, step.worktreePath) ?? recoveryDescriptor.cwd ?? run.cwd;
|
|
8030
8033
|
if (!requiredCwd || !fs16.statSync(requiredCwd).isDirectory()) return { state: "not-resumable", reason: `required cwd is missing: ${requiredCwd ?? "unknown"}` };
|
|
8031
8034
|
} catch (error2) {
|
|
8032
8035
|
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-
|
|
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";
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
rexGlobalArgs,
|
|
14
14
|
runBoundedCommand,
|
|
15
15
|
sshMachineAccess
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2D52JFLF.js";
|
|
17
17
|
import {
|
|
18
18
|
package_default
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NKQ6JNAS.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-
|
|
32
|
+
} from "./chunk-LNRJCP2Y.js";
|
|
33
33
|
import "./chunk-JEZOSEWG.js";
|
|
34
34
|
import "./chunk-YFCK7H2S.js";
|
|
35
|
-
import "./chunk-
|
|
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";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
projectRuntimeAcknowledgedExtensions,
|
|
4
4
|
registerSubagentPromptBoundary,
|
|
5
5
|
registerSubagentPromptRuntime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XDQORLZ5.js";
|
|
7
7
|
import {
|
|
8
8
|
INSPECTOR_ACTIONS,
|
|
9
9
|
canQueueRetainedAsyncFollowUp,
|
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
updateSteeringTarget,
|
|
26
26
|
waitForSteeringAction,
|
|
27
27
|
workflowAsyncChildSteeringGuidance
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4E7BKDTX.js";
|
|
29
29
|
import {
|
|
30
30
|
PLACED_RESTORE_UNSUPPORTED,
|
|
31
31
|
formatHerdrMachineRunnerUnsupported,
|
|
32
32
|
isRexLocalMachine,
|
|
33
33
|
resolveMachinePlacement
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-2D52JFLF.js";
|
|
35
35
|
import {
|
|
36
36
|
COMPLETION_ACTION,
|
|
37
37
|
DEFAULT_CONTROL_CONFIG,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
workflowStopCause,
|
|
121
121
|
writeWorkflowLaunchRecord,
|
|
122
122
|
writeWorkflowReceipt
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-DZDETGRJ.js";
|
|
124
124
|
import {
|
|
125
125
|
NATIVE_SUPERVISOR_TOOL_NAME,
|
|
126
126
|
SUBAGENT_PARENT_SESSION_ENV,
|
|
@@ -136,7 +136,7 @@ import {
|
|
|
136
136
|
resolveWatchdogConfig,
|
|
137
137
|
sendRuleViolationWarning,
|
|
138
138
|
writeWatchdogModelSettings
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-7BWGNDNK.js";
|
|
140
140
|
import {
|
|
141
141
|
MAX_REMEMBERED_FOREGROUND_RUNS,
|
|
142
142
|
discardRunningForegroundRun,
|
|
@@ -149,7 +149,7 @@ import {
|
|
|
149
149
|
resolveSubagentRunId,
|
|
150
150
|
resolveWorkflowChatProgress,
|
|
151
151
|
stopAsyncRun
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-NENDSQUY.js";
|
|
153
153
|
import {
|
|
154
154
|
MODEL_ONLY_TOOL,
|
|
155
155
|
RunFanoutLimitError,
|
|
@@ -211,7 +211,7 @@ import {
|
|
|
211
211
|
writeParallelHandoffGroup,
|
|
212
212
|
writeRunFanoutBudgetDescriptor,
|
|
213
213
|
writeWorktreeSetupHandoff
|
|
214
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-L3WFKBEI.js";
|
|
215
215
|
import {
|
|
216
216
|
authorizeWorkflowResourceHost,
|
|
217
217
|
claimWorkflowChildPermit,
|
|
@@ -228,10 +228,10 @@ import {
|
|
|
228
228
|
canPreferFork,
|
|
229
229
|
createForkContextResolver,
|
|
230
230
|
resolveSubagentLaunchContext
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-SSG7IEP5.js";
|
|
232
232
|
import {
|
|
233
233
|
handleRefinementAction
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-LFDBD4PW.js";
|
|
235
235
|
import {
|
|
236
236
|
ActiveAsyncCapacityError,
|
|
237
237
|
acquireActiveAsyncCapacity,
|
|
@@ -246,7 +246,7 @@ import {
|
|
|
246
246
|
resolveDisabledFeatureSurface,
|
|
247
247
|
resolveMaxActiveAsyncRunsPerSession,
|
|
248
248
|
transferActiveAsyncCapacity
|
|
249
|
-
} from "./chunk-
|
|
249
|
+
} from "./chunk-PALJGGYC.js";
|
|
250
250
|
import {
|
|
251
251
|
DEFAULT_STALE_TERMINAL_ACTIVE_MARKER_MS,
|
|
252
252
|
MACHINE_DIFF_OPTIONS,
|
|
@@ -280,6 +280,7 @@ import {
|
|
|
280
280
|
inheritedNestedParentAddressOf,
|
|
281
281
|
inheritedNestedRouteOf,
|
|
282
282
|
initializeProcessTerminal,
|
|
283
|
+
missionAcceptanceStatus,
|
|
283
284
|
nestedResultsPath,
|
|
284
285
|
nestedRunNotActiveMessage,
|
|
285
286
|
nestedRunScope,
|
|
@@ -325,7 +326,7 @@ import {
|
|
|
325
326
|
writeNestedControlRequest,
|
|
326
327
|
writeNestedControlResult,
|
|
327
328
|
writeNestedEvent
|
|
328
|
-
} from "./chunk-
|
|
329
|
+
} from "./chunk-CGN2TVE7.js";
|
|
329
330
|
import {
|
|
330
331
|
closeSteerInbox,
|
|
331
332
|
consumeSteerRequests,
|
|
@@ -333,7 +334,7 @@ import {
|
|
|
333
334
|
readRevivalBriefs,
|
|
334
335
|
requestAsyncSteer,
|
|
335
336
|
watchAsyncControlInbox
|
|
336
|
-
} from "./chunk-
|
|
337
|
+
} from "./chunk-F4ASL6OV.js";
|
|
337
338
|
import "./chunk-NIXWDZZV.js";
|
|
338
339
|
import {
|
|
339
340
|
INTERCOM_BRIDGE_MARKER,
|
|
@@ -342,7 +343,7 @@ import {
|
|
|
342
343
|
resolveIntercomBridge,
|
|
343
344
|
resolveIntercomSessionTarget,
|
|
344
345
|
resolveSubagentIntercomTarget
|
|
345
|
-
} from "./chunk-
|
|
346
|
+
} from "./chunk-C5P5CHYK.js";
|
|
346
347
|
import {
|
|
347
348
|
resolveLaunchBinding,
|
|
348
349
|
stableJsonDigest
|
|
@@ -356,7 +357,7 @@ import {
|
|
|
356
357
|
resolvePiLaunchToolPlan,
|
|
357
358
|
resolveRuntimeModulePath,
|
|
358
359
|
supervisorChannelDir
|
|
359
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-V2BZYLEP.js";
|
|
360
361
|
import {
|
|
361
362
|
assertRequiredChildExtensionsAdmitted,
|
|
362
363
|
hasMandatoryRequiredChildExtensions,
|
|
@@ -367,7 +368,7 @@ import {
|
|
|
367
368
|
import {
|
|
368
369
|
HERDR_PROJECT_PANE_ACTIONS,
|
|
369
370
|
handleHerdrProjectPaneAction
|
|
370
|
-
} from "./chunk-
|
|
371
|
+
} from "./chunk-2DHZTCOL.js";
|
|
371
372
|
import "./chunk-7J4ZXMY7.js";
|
|
372
373
|
import {
|
|
373
374
|
PROJECT_SUBAGENTS_RELATIVE_DIR,
|
|
@@ -380,12 +381,12 @@ import {
|
|
|
380
381
|
getProjectSubagentsDir,
|
|
381
382
|
writeArtifact,
|
|
382
383
|
writeMetadata
|
|
383
|
-
} from "./chunk-
|
|
384
|
+
} from "./chunk-D3JAFGMO.js";
|
|
384
385
|
import "./chunk-XA3DY6UG.js";
|
|
385
386
|
import {
|
|
386
387
|
getExternalJobProvider
|
|
387
388
|
} from "./chunk-YYREO77V.js";
|
|
388
|
-
import "./chunk-
|
|
389
|
+
import "./chunk-G2Z6ZH26.js";
|
|
389
390
|
import {
|
|
390
391
|
ChainOutputValidationError,
|
|
391
392
|
MAX_STREAMED_RECENT_TOOLS,
|
|
@@ -531,7 +532,7 @@ import {
|
|
|
531
532
|
writeAtomicJson,
|
|
532
533
|
writeInitialProgressFile,
|
|
533
534
|
writePrivateAtomicJson
|
|
534
|
-
} from "./chunk-
|
|
535
|
+
} from "./chunk-LNRJCP2Y.js";
|
|
535
536
|
import {
|
|
536
537
|
CHAIN_RUNS_DIR,
|
|
537
538
|
DEFAULT_ARTIFACT_CONFIG,
|
|
@@ -569,7 +570,7 @@ import {
|
|
|
569
570
|
assertAgentAllowedByCapabilityCeiling,
|
|
570
571
|
intersectSubagentCapabilityCeilings,
|
|
571
572
|
resolveCurrentSubagentCapabilityCeiling
|
|
572
|
-
} from "./chunk-
|
|
573
|
+
} from "./chunk-QXASAHIA.js";
|
|
573
574
|
|
|
574
575
|
// src/runs/foreground/subagent-executor.ts
|
|
575
576
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
@@ -1648,6 +1649,11 @@ function sourceUnderNodeModules() {
|
|
|
1648
1649
|
function supportsNativeRunner(nodeExecutable) {
|
|
1649
1650
|
return Boolean(process.features.typescript) && typeof nodeModule.registerHooks === "function" && nodeExecutable === process.execPath && !sourceUnderNodeModules();
|
|
1650
1651
|
}
|
|
1652
|
+
function parentExtensionProviderForChild(ctx, disableAmbientExtensions, model, availableModels, preferredProvider) {
|
|
1653
|
+
if (!disableAmbientExtensions || !ctx.parentProviderRegistry) return void 0;
|
|
1654
|
+
const provider = findModelInfo(model, availableModels, preferredProvider)?.provider;
|
|
1655
|
+
return provider && ctx.parentProviderRegistry.getRegisteredProviderIds().includes(provider) ? provider : void 0;
|
|
1656
|
+
}
|
|
1651
1657
|
var DEFAULT_ASYNC_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
1652
1658
|
function formatAsyncStartedMessage(headline, interactive) {
|
|
1653
1659
|
const guidance = interactive ? [
|
|
@@ -2375,6 +2381,7 @@ function buildAsyncRunnerSteps(id, params) {
|
|
|
2375
2381
|
runtimeSnapshotHost: ctx.pi
|
|
2376
2382
|
});
|
|
2377
2383
|
const launchResolvedExtensions = externalRunner ? void 0 : projectLaunchResolvedChildExtensions(toolPlan);
|
|
2384
|
+
const parentExtensionProvider = externalRunner || machine ? void 0 : parentExtensionProviderForChild(ctx, toolPlan.disableAmbientExtensions, selectedModel, availableModels, a.modelProvider ?? ctx.currentModelProvider);
|
|
2378
2385
|
if (externalRunner && permissionRules) {
|
|
2379
2386
|
throw new AsyncStartValidationError(`Agent '${a.name}' uses runner.type='${externalRunnerType}', which cannot enforce native Pi child permission rules.`);
|
|
2380
2387
|
}
|
|
@@ -2404,6 +2411,7 @@ function buildAsyncRunnerSteps(id, params) {
|
|
|
2404
2411
|
thinking: resolveEffectiveThinking(selectedModel, effectiveThinking),
|
|
2405
2412
|
...thinkingCeiling ? { thinkingCeiling } : {},
|
|
2406
2413
|
launchResolvedExtensions,
|
|
2414
|
+
...parentExtensionProvider ? { parentExtensionProvider } : {},
|
|
2407
2415
|
...requestedModel ? { requestedModel } : {},
|
|
2408
2416
|
...primaryModelFromParent ? { skipPrimaryModelVerification: true } : {},
|
|
2409
2417
|
...availableModels && availableModels.length > 0 ? { modelVerificationRegistry: availableModels } : {},
|
|
@@ -2621,7 +2629,8 @@ function executeAsyncChain(id, params) {
|
|
|
2621
2629
|
if (acceptanceErrors.length > 0) return formatAsyncStartError(resultMode, acceptanceErrors.join(" "));
|
|
2622
2630
|
const undefinedLauncher = chain.flatMap(getStepAgents).map((name) => agents.find((agent) => agent.name === name)?.launcher).find((name) => name !== void 0 && !lookupRunnerLauncher(ctx.runnerLaunchers, name));
|
|
2623
2631
|
if (undefinedLauncher !== void 0) return formatAsyncStartError(resultMode, `Launcher '${undefinedLauncher}' used by this ${resultMode} is not defined in runnerLaunchers in the user subagent config.`);
|
|
2624
|
-
const
|
|
2632
|
+
const launchParentSessionId = ctx.parentSessionId ?? ctx.currentSessionId;
|
|
2633
|
+
const capabilityCeiling = params.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(launchParentSessionId);
|
|
2625
2634
|
const inheritedNestedRoute2 = inheritedNestedRouteOf(ctx.childRuntime);
|
|
2626
2635
|
const nestedAddress = inheritedNestedRoute2 ? inheritedNestedParentAddressOf(ctx.childRuntime) : void 0;
|
|
2627
2636
|
const asyncDir = inheritedNestedRoute2 ? path5.join(TEMP_ROOT_DIR, "nested-subagent-runs", inheritedNestedRoute2.rootRunId, id) : path5.join(DIRS.async, id);
|
|
@@ -2713,7 +2722,6 @@ function executeAsyncChain(id, params) {
|
|
|
2713
2722
|
const initialStatusAt = Date.now();
|
|
2714
2723
|
const initialCompletionOwnerId = ctx.completionOwnerId ?? currentCompletionOwnerId();
|
|
2715
2724
|
const completionOwnerProcess = currentRecordedPid();
|
|
2716
|
-
const launchParentSessionId = ctx.parentSessionId ?? ctx.currentSessionId;
|
|
2717
2725
|
try {
|
|
2718
2726
|
writeRetainedRequiredChildExtensions(asyncDir, params.requiredExtensions ?? ctx.childRuntime?.requiredExtensions ?? resolveRequiredChildExtensions(launchParentSessionId ?? void 0));
|
|
2719
2727
|
} catch (error) {
|
|
@@ -2973,7 +2981,7 @@ function executeAsyncSingle(id, params) {
|
|
|
2973
2981
|
if (extensionBindings !== void 0) unsupported.push("extension bindings");
|
|
2974
2982
|
if (unsupported.length > 0) return formatAsyncStartError("single", `Agent '${agentConfig.name}' uses runner.type='${externalRunnerType}' and does not support: ${unsupported.join(", ")}.`);
|
|
2975
2983
|
}
|
|
2976
|
-
const capabilityCeiling = intersectSubagentCapabilityCeilings(params.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(ctx.currentSessionId), ctx.childRuntime?.capabilityCeiling);
|
|
2984
|
+
const capabilityCeiling = intersectSubagentCapabilityCeilings(params.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(ctx.parentSessionId ?? ctx.currentSessionId), ctx.childRuntime?.capabilityCeiling);
|
|
2977
2985
|
try {
|
|
2978
2986
|
assertAgentAllowedByCapabilityCeiling(agentConfig.name, capabilityCeiling);
|
|
2979
2987
|
} catch (error) {
|
|
@@ -3160,6 +3168,7 @@ function executeAsyncSingle(id, params) {
|
|
|
3160
3168
|
runtimeSnapshotHost: ctx.pi
|
|
3161
3169
|
});
|
|
3162
3170
|
const launchResolvedExtensions = externalRunner ? void 0 : projectLaunchResolvedChildExtensions(toolPlan);
|
|
3171
|
+
const parentExtensionProvider = externalRunner || machine ? void 0 : parentExtensionProviderForChild(ctx, toolPlan.disableAmbientExtensions, selectedModel, availableModels, agentConfig.modelProvider ?? ctx.currentModelProvider);
|
|
3163
3172
|
const fast = params.fast ?? agentConfig.fast;
|
|
3164
3173
|
const launchThinking = resolveEffectiveThinking(selectedModel, effectiveThinking);
|
|
3165
3174
|
const { definitionDigest, launchContractDigest } = resolveLaunchBinding({
|
|
@@ -3282,6 +3291,7 @@ function executeAsyncSingle(id, params) {
|
|
|
3282
3291
|
...params.fast ?? agentConfig.fast ? { fast: params.fast ?? agentConfig.fast } : {},
|
|
3283
3292
|
thinking: resolveEffectiveThinking(selectedModel, effectiveThinking),
|
|
3284
3293
|
...thinkingCeiling ? { thinkingCeiling } : {},
|
|
3294
|
+
...parentExtensionProvider ? { parentExtensionProvider } : {},
|
|
3285
3295
|
...requestedModel ? { requestedModel } : {},
|
|
3286
3296
|
...modelOrigin === "inherited" ? { skipPrimaryModelVerification: true } : {},
|
|
3287
3297
|
...availableModels && availableModels.length > 0 ? { modelVerificationRegistry: availableModels } : {},
|
|
@@ -10251,9 +10261,6 @@ function resolveForegroundResumeTarget(params, state, options = {}) {
|
|
|
10251
10261
|
...child.capabilityCeiling ? { capabilityCeiling: child.capabilityCeiling } : {}
|
|
10252
10262
|
};
|
|
10253
10263
|
}
|
|
10254
|
-
function isAsyncRunNotFound(error) {
|
|
10255
|
-
return error instanceof Error && error.message.startsWith("Async run not found.");
|
|
10256
|
-
}
|
|
10257
10264
|
function isMissingExactAsyncStatusFile(error, requested) {
|
|
10258
10265
|
return error instanceof Error && error.message === `Status file not found for async run '${requested}'.`;
|
|
10259
10266
|
}
|
|
@@ -10311,32 +10318,10 @@ function resolveResumeTarget(params, state, options = {}) {
|
|
|
10311
10318
|
if (isResumeAmbiguity(foregroundError) && !resumeTargetExact(asyncTarget, requested)) throw foregroundError;
|
|
10312
10319
|
return asyncTarget;
|
|
10313
10320
|
}
|
|
10314
|
-
if (foregroundError && !isAsyncRunNotFound(asyncError)) throw foregroundError;
|
|
10315
10321
|
if (foregroundError) throw foregroundError;
|
|
10316
10322
|
if (asyncError) throw asyncError;
|
|
10317
10323
|
throw new Error("Run not found. Provide id or runId.");
|
|
10318
10324
|
}
|
|
10319
|
-
function getAsyncInterruptTarget(state, runId, location, options = {}) {
|
|
10320
|
-
if (location?.asyncDir) {
|
|
10321
|
-
return {
|
|
10322
|
-
asyncId: location.resolvedId ?? runId ?? path18.basename(location.asyncDir),
|
|
10323
|
-
asyncDir: location.asyncDir
|
|
10324
|
-
};
|
|
10325
|
-
}
|
|
10326
|
-
if (runId) {
|
|
10327
|
-
const direct = state.asyncJobs.get(runId);
|
|
10328
|
-
if (direct) return { asyncId: direct.asyncId, asyncDir: direct.asyncDir };
|
|
10329
|
-
if (options.fallbackToNewest === false) return void 0;
|
|
10330
|
-
}
|
|
10331
|
-
let newest;
|
|
10332
|
-
for (const job of state.asyncJobs.values()) {
|
|
10333
|
-
if (job.status !== "running") continue;
|
|
10334
|
-
if (!newest || (job.updatedAt ?? 0) > newest.updatedAt) {
|
|
10335
|
-
newest = { asyncId: job.asyncId, asyncDir: job.asyncDir, updatedAt: job.updatedAt ?? 0 };
|
|
10336
|
-
}
|
|
10337
|
-
}
|
|
10338
|
-
return newest ? { asyncId: newest.asyncId, asyncDir: newest.asyncDir } : void 0;
|
|
10339
|
-
}
|
|
10340
10325
|
function isStaleExtensionContextError2(error) {
|
|
10341
10326
|
if (!(error instanceof Error)) return false;
|
|
10342
10327
|
return /extension ctx is stale|stale after session replacement or reload/i.test(error.message);
|
|
@@ -10396,12 +10381,12 @@ function emitControlNotification(input) {
|
|
|
10396
10381
|
}
|
|
10397
10382
|
}
|
|
10398
10383
|
function interruptAsyncRun(state, runId, kill, location) {
|
|
10399
|
-
const target =
|
|
10384
|
+
const target = location?.asyncDir ? { asyncId: location.resolvedId ?? runId, asyncDir: location.asyncDir } : state.asyncJobs.get(runId);
|
|
10400
10385
|
if (!target) return null;
|
|
10401
10386
|
const status = reconcileAsyncRun(target.asyncDir, omitUndefinedProperties({ kill })).status;
|
|
10402
10387
|
if (!status || status.state !== "running" || typeof status.pid !== "number") {
|
|
10403
10388
|
return {
|
|
10404
|
-
content: [{ type: "text", text: `No running async run with an interrupt-capable pid was found for '${runId
|
|
10389
|
+
content: [{ type: "text", text: `No running async run with an interrupt-capable pid was found for '${runId}'.` }],
|
|
10405
10390
|
isError: true,
|
|
10406
10391
|
details: { mode: "management", results: [] }
|
|
10407
10392
|
};
|
|
@@ -10581,6 +10566,7 @@ function appendStepToAsyncChain(input) {
|
|
|
10581
10566
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
10582
10567
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
10583
10568
|
currentModelProvider: parentModel?.provider,
|
|
10569
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
10584
10570
|
currentModel: parentModel,
|
|
10585
10571
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
10586
10572
|
modelScope: discoveredForAppend.modelScope,
|
|
@@ -10618,7 +10604,7 @@ function appendStepToAsyncChain(input) {
|
|
|
10618
10604
|
worktreeBranchPrefix: input.deps.config.worktreeBranchPrefix,
|
|
10619
10605
|
asyncDir: resolved.location.asyncDir,
|
|
10620
10606
|
validateOutputBindings: false,
|
|
10621
|
-
capabilityCeiling: intersectSubagentCapabilityCeilings(status.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(asyncCtx.
|
|
10607
|
+
capabilityCeiling: intersectSubagentCapabilityCeilings(status.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(asyncCtx.parentSessionId)),
|
|
10622
10608
|
requiredExtensions: retainedRequiredExtensions
|
|
10623
10609
|
}));
|
|
10624
10610
|
if ("error" in built) {
|
|
@@ -10983,6 +10969,7 @@ async function resumeExternalJobFollowUp(input) {
|
|
|
10983
10969
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
10984
10970
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
10985
10971
|
currentModelProvider: parentModel?.provider,
|
|
10972
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
10986
10973
|
currentModel: parentModel,
|
|
10987
10974
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
10988
10975
|
modelScope: input.modelScope,
|
|
@@ -11011,7 +10998,7 @@ async function resumeExternalJobFollowUp(input) {
|
|
|
11011
10998
|
availableModels: input.ctx.modelRegistry.getAvailable().map(toModelInfo),
|
|
11012
10999
|
outputBaseDir: resolveSingleRunOutputBaseDir(input.deps, artifactsDir, runId),
|
|
11013
11000
|
...input.absoluteDeadlineAt !== void 0 ? { absoluteDeadlineAt: input.absoluteDeadlineAt } : {},
|
|
11014
|
-
capabilityCeiling: resolveCurrentSubagentCapabilityCeiling(
|
|
11001
|
+
capabilityCeiling: resolveCurrentSubagentCapabilityCeiling(input.ctx.sessionManager.getSessionId() ?? void 0),
|
|
11015
11002
|
runFanoutBudget: createRunFanoutBudget(runId, resolveMaxSubagentSpawnsPerRun(input.deps.config.maxSubagentSpawnsPerRun)),
|
|
11016
11003
|
activeAsyncCapacity,
|
|
11017
11004
|
externalJobFollowUp: { sourceRunId: input.target.runId, sourceStepIndex: input.target.index, parentProviderJobId: externalJob.providerJobId, requestId, requestDigest }
|
|
@@ -11252,6 +11239,7 @@ async function resumeAsyncRun(input) {
|
|
|
11252
11239
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
11253
11240
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
11254
11241
|
currentModelProvider: parentModel2?.provider,
|
|
11242
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
11255
11243
|
currentModel: parentModel2,
|
|
11256
11244
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
11257
11245
|
modelScope,
|
|
@@ -11288,7 +11276,7 @@ async function resumeAsyncRun(input) {
|
|
|
11288
11276
|
childIntercomTarget: intercomBridge.active ? (agent, index) => resolveSubagentIntercomTarget(runId2, agent, index) : void 0,
|
|
11289
11277
|
globalConcurrencyLimit: input.deps.config.globalConcurrencyLimit,
|
|
11290
11278
|
runFanoutBudget: createRunFanoutBudget(runId2, resolveMaxSubagentSpawnsPerRun(input.deps.config.maxSubagentSpawnsPerRun)),
|
|
11291
|
-
capabilityCeiling: intersectSubagentCapabilityCeilings("capabilityCeiling" in target ? target.capabilityCeiling : void 0, resolveCurrentSubagentCapabilityCeiling(input.
|
|
11279
|
+
capabilityCeiling: intersectSubagentCapabilityCeilings("capabilityCeiling" in target ? target.capabilityCeiling : void 0, resolveCurrentSubagentCapabilityCeiling(input.ctx.sessionManager.getSessionId() ?? void 0)),
|
|
11292
11280
|
thinkingCeiling: target.thinkingCeiling,
|
|
11293
11281
|
activeAsyncCapacity: activeAsyncCapacity2
|
|
11294
11282
|
}));
|
|
@@ -11375,6 +11363,7 @@ async function resumeAsyncRun(input) {
|
|
|
11375
11363
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
11376
11364
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
11377
11365
|
currentModelProvider: parentModel?.provider,
|
|
11366
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
11378
11367
|
currentModel: parentModel,
|
|
11379
11368
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
11380
11369
|
modelScope,
|
|
@@ -11440,7 +11429,7 @@ async function resumeAsyncRun(input) {
|
|
|
11440
11429
|
...input.params.toolBudget !== void 0 ? { toolBudget: input.params.toolBudget } : {},
|
|
11441
11430
|
// Recovery descriptors, remembered foreground runs, and current workflow roots
|
|
11442
11431
|
// preserve parent authority before the selected agent's descendant ceiling.
|
|
11443
|
-
capabilityCeiling: intersectSubagentCapabilityCeilings(recoveryDescriptor?.capabilityCeiling ?? (target.source === "foreground" || target.source === "async" && target.mode === "workflow" ? target.capabilityCeiling : void 0), resolveCurrentSubagentCapabilityCeiling(input.
|
|
11432
|
+
capabilityCeiling: intersectSubagentCapabilityCeilings(recoveryDescriptor?.capabilityCeiling ?? (target.source === "foreground" || target.source === "async" && target.mode === "workflow" ? target.capabilityCeiling : void 0), resolveCurrentSubagentCapabilityCeiling(input.ctx.sessionManager.getSessionId() ?? void 0)),
|
|
11444
11433
|
runFanoutBudget: input.params.runFanoutBudget ?? recoveryDescriptor?.runFanoutBudget ?? createRunFanoutBudget(runId, resolveMaxSubagentSpawnsPerRun(input.deps.config.maxSubagentSpawnsPerRun)),
|
|
11445
11434
|
parentWorkflowRunId: input.params.workflowParentRunId,
|
|
11446
11435
|
workflowKey: input.params.workflowKey,
|
|
@@ -12436,6 +12425,7 @@ async function runAsyncPath(data, deps) {
|
|
|
12436
12425
|
parentSessionId: data.parentPiSessionId,
|
|
12437
12426
|
parentSessionFile: ctx.sessionManager.getSessionFile() ?? void 0,
|
|
12438
12427
|
currentModelProvider: parentModel?.provider,
|
|
12428
|
+
parentProviderRegistry: ctx.modelRegistry,
|
|
12439
12429
|
currentModel: parentModel,
|
|
12440
12430
|
scopedModelIds: data.scopedModelIds,
|
|
12441
12431
|
modelScope: data.modelScope,
|
|
@@ -14175,7 +14165,7 @@ function createSubagentExecutor(deps) {
|
|
|
14175
14165
|
const eventsPath = path18.join(asyncDir, "events.jsonl");
|
|
14176
14166
|
const startedAt = Date.now();
|
|
14177
14167
|
const currentSessionId = resolveCurrentSessionId(ctx.sessionManager);
|
|
14178
|
-
const workflowCapabilityCeiling2 = intersectSubagentCapabilityCeilings(requestParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(
|
|
14168
|
+
const workflowCapabilityCeiling2 = intersectSubagentCapabilityCeilings(requestParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(ctx.sessionManager.getSessionId() ?? void 0));
|
|
14179
14169
|
const completionOwnerId = deps2.state.completionOwnerId ?? currentCompletionOwnerId();
|
|
14180
14170
|
deps2.state.completionOwnerId = completionOwnerId;
|
|
14181
14171
|
const workflowScriptSourceDigest = workflowScriptDigest(requestParams.workflowScript);
|
|
@@ -14919,6 +14909,7 @@ Parent action: ${COMPLETION_ACTION}` : content,
|
|
|
14919
14909
|
...result2.details.results[0]?.sessionFile ? { sessionPath: result2.details.results[0].sessionFile } : {},
|
|
14920
14910
|
artifactPaths: child.artifactPaths,
|
|
14921
14911
|
...["completed", "failed"].includes(childStatus) ? { completedAt: (/* @__PURE__ */ new Date()).toISOString() } : {},
|
|
14912
|
+
acceptanceStatus: missionAcceptanceStatus(result2.details.results),
|
|
14922
14913
|
heartbeat: { status: childStatus, ...childPhase ? { phase: childPhase } : {} }
|
|
14923
14914
|
});
|
|
14924
14915
|
if (result2.details.asyncId) {
|
|
@@ -15063,7 +15054,7 @@ Parent action: ${COMPLETION_ACTION}` : content,
|
|
|
15063
15054
|
let lastProgressAt = 0;
|
|
15064
15055
|
let workflowProgressClosed = false;
|
|
15065
15056
|
const workflowDeadlineAt = timeout === void 0 ? void 0 : Date.now() + timeout;
|
|
15066
|
-
const workflowCapabilityCeiling = intersectSubagentCapabilityCeilings(requestParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(
|
|
15057
|
+
const workflowCapabilityCeiling = intersectSubagentCapabilityCeilings(requestParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(ctx.sessionManager.getSessionId() ?? void 0));
|
|
15067
15058
|
const sendWorkflowProgress = () => {
|
|
15068
15059
|
if (workflowProgressClosed) return;
|
|
15069
15060
|
if (activityTimer) clearTimeout(activityTimer);
|
|
@@ -15196,6 +15187,7 @@ Parent action: ${COMPLETION_ACTION}` : content,
|
|
|
15196
15187
|
...result2.details.results[0]?.sessionFile ? { sessionPath: result2.details.results[0].sessionFile } : {},
|
|
15197
15188
|
artifactPaths: child.artifactPaths,
|
|
15198
15189
|
...["completed", "failed"].includes(childStatus) ? { completedAt: (/* @__PURE__ */ new Date()).toISOString() } : {},
|
|
15190
|
+
acceptanceStatus: missionAcceptanceStatus(result2.details.results),
|
|
15199
15191
|
heartbeat: { status: childStatus, ...childPhase ? { phase: childPhase } : {} }
|
|
15200
15192
|
});
|
|
15201
15193
|
return child;
|
|
@@ -15902,21 +15894,20 @@ ${item.text}` } : item)
|
|
|
15902
15894
|
);
|
|
15903
15895
|
if (stopResult) return stopResult;
|
|
15904
15896
|
return {
|
|
15905
|
-
content: [{ type: "text", text:
|
|
15897
|
+
content: [{ type: "text", text: `No stoppable async run found for '${targetRunId}'.` }],
|
|
15906
15898
|
isError: true,
|
|
15907
15899
|
details: { mode: "management", results: [] }
|
|
15908
15900
|
};
|
|
15909
15901
|
}
|
|
15910
15902
|
if (action === "interrupt") {
|
|
15911
15903
|
const targetRunId = paramsWithResolvedCwd.runId ?? paramsWithResolvedCwd.id;
|
|
15904
|
+
if (!targetRunId) return { content: [{ type: "text", text: "action='interrupt' requires id." }], isError: true, details: { mode: "management", results: [] } };
|
|
15912
15905
|
let resolved;
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
|
|
15918
|
-
return { content: [{ type: "text", text: message }], isError: true, details: { mode: "management", results: [] } };
|
|
15919
|
-
}
|
|
15906
|
+
try {
|
|
15907
|
+
resolved = resolveSubagentRunId(targetRunId, omitUndefinedProperties({ state: deps2.state, nested: nestedResolutionScopeForExecutor(deps2) }));
|
|
15908
|
+
} catch (error) {
|
|
15909
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
15910
|
+
return { content: [{ type: "text", text: message }], isError: true, details: { mode: "management", results: [] } };
|
|
15920
15911
|
}
|
|
15921
15912
|
if (resolved?.kind === "nested") return interruptNestedRun(resolved);
|
|
15922
15913
|
const foreground = getForegroundControl(deps2.state, resolved?.kind === "foreground" ? resolved.id : targetRunId);
|
|
@@ -15944,7 +15935,7 @@ ${item.text}` } : item)
|
|
|
15944
15935
|
);
|
|
15945
15936
|
if (asyncInterruptResult) return asyncInterruptResult;
|
|
15946
15937
|
return {
|
|
15947
|
-
content: [{ type: "text", text:
|
|
15938
|
+
content: [{ type: "text", text: `No interrupt-capable run found for '${targetRunId}'.` }],
|
|
15948
15939
|
isError: true,
|
|
15949
15940
|
details: { mode: "management", results: [] }
|
|
15950
15941
|
};
|
|
@@ -15960,7 +15951,7 @@ ${item.text}` } : item)
|
|
|
15960
15951
|
...ctx,
|
|
15961
15952
|
cwd: requestCwd,
|
|
15962
15953
|
config: deps2.config,
|
|
15963
|
-
|
|
15954
|
+
piSessionId: ctx.sessionManager.getSessionId() ?? void 0,
|
|
15964
15955
|
discoverAgentsAll: deps2.discoverAgentsAll,
|
|
15965
15956
|
runtimeAgentOwner: deps2.pi,
|
|
15966
15957
|
onAgentsChanged: deps2.onAgentsChanged
|
|
@@ -16062,7 +16053,7 @@ ${item.text}` } : item)
|
|
|
16062
16053
|
let prepareForkSessionForIndex = async () => {
|
|
16063
16054
|
};
|
|
16064
16055
|
const launchCapabilityCeiling = () => intersectSubagentCapabilityCeilings(
|
|
16065
|
-
intersectSubagentCapabilityCeilings(effectiveParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(
|
|
16056
|
+
intersectSubagentCapabilityCeilings(effectiveParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(requestPiSessionId)),
|
|
16066
16057
|
deps2.childRuntime?.capabilityCeiling
|
|
16067
16058
|
);
|
|
16068
16059
|
const assertLaunchableAgentsAllowedBeforeFork = () => {
|
|
@@ -16308,7 +16299,7 @@ ${item.text}` } : item)
|
|
|
16308
16299
|
scopedModelIds: scopedModelIdsFromContext(ctx),
|
|
16309
16300
|
parentSessionId: requestSessionId,
|
|
16310
16301
|
parentPiSessionId: requestPiSessionId,
|
|
16311
|
-
capabilityCeiling: intersectSubagentCapabilityCeilings(effectiveParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(
|
|
16302
|
+
capabilityCeiling: intersectSubagentCapabilityCeilings(effectiveParams.capabilityCeiling, resolveCurrentSubagentCapabilityCeiling(requestPiSessionId)),
|
|
16312
16303
|
runFanoutBudget,
|
|
16313
16304
|
topLevelAsyncCapacityEligible,
|
|
16314
16305
|
activeAsyncCapacity,
|