pi-subagents 0.83.1 → 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 +17 -0
- package/bundle/{chunk-5YIITCPD.js → chunk-235AWJUQ.js} +24 -21
- package/bundle/{chunk-YXFJVCOL.js → chunk-4E7BKDTX.js} +3 -3
- package/bundle/{chunk-UFL7IYCW.js → chunk-7BWGNDNK.js} +2 -2
- package/bundle/{chunk-ZVOAMTUQ.js → chunk-AKOIVLA5.js} +3 -3
- package/bundle/{chunk-RNIZLSEA.js → chunk-CGN2TVE7.js} +1 -0
- package/bundle/{chunk-F5DBXJ2G.js → chunk-DZDETGRJ.js} +8 -5
- package/bundle/{chunk-C7JMPU5F.js → chunk-J5YL7LYR.js} +1 -1
- package/bundle/{chunk-UUP372DR.js → chunk-JG4QKI5M.js} +22 -8
- package/bundle/{chunk-UYK5MZWE.js → chunk-L3WFKBEI.js} +1 -1
- package/bundle/{chunk-VLFZIN6D.js → chunk-NENDSQUY.js} +2 -2
- package/bundle/{chunk-MABL3FUM.js → chunk-NKQ6JNAS.js} +1 -1
- package/bundle/{chunk-QP5ZWNIS.js → chunk-PALJGGYC.js} +1 -1
- package/bundle/{chunk-IPGZMQXV.js → chunk-PV63UFUR.js} +5 -5
- package/bundle/{chunk-AHIFYGR3.js → chunk-VQVVHSY6.js} +5 -5
- package/bundle/{chunk-NPIYWVOD.js → chunk-XDQORLZ5.js} +3 -3
- package/bundle/index.js +1 -1
- package/bundle/preflight.js +2 -2
- package/package.json +1 -1
- package/src/runs/background/async-execution.d.ts +3 -0
- package/src/runs/background/async-execution.js +15 -0
- package/src/runs/background/async-retention.d.ts +1 -0
- package/src/runs/background/async-retention.js +16 -10
- 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 +5 -0
- 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-utils.d.ts +2 -0
- package/src/workflows/scripted-workflow.js +2 -0
- package/workflow-script-worker.cjs +449 -175
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.84.0] - 2026-10-28
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
|
|
9
|
+
- Security fix: workflow scripts can no longer reach the Pi process outside their sandbox. Upgrade if you use workflow scripts.
|
|
10
|
+
- A locked-down background agent that fails because one of your extensions' providers did not load in it now says which provider and how to load it.
|
|
11
|
+
- Old background runs are now actually deleted from disk.
|
|
12
|
+
|
|
13
|
+
### Security
|
|
14
|
+
|
|
15
|
+
- Workflow scripts could reach the Pi process outside their sandbox. Upgrade to this version; see [GHSA-6v8j-6w28-2w8r](https://github.com/nicobailon/pi-subagents/security/advisories/GHSA-6v8j-6w28-2w8r) for affected versions and a workaround. Workflow scripts can no longer set `Error.prepareStackTrace`, and a script that calls `import()`, which always failed inside a workflow, is now rejected before it runs.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Old background runs are now deleted from disk. Background runs are meant to be removed 30 days after they finish, but a run was kept forever while its Pi session file still existed, and session files are never deleted, so almost no run was ever removed. A run whose session still exists is now kept for 90 days, so you can still resume it for that long, and is then removed like any other finished run. Thanks to [@LCorleone](https://github.com/LCorleone) for the report and fix, and [@isjiajia01](https://github.com/isjiajia01) for reproducing it. (#3098)
|
|
20
|
+
- A background agent that loads no ambient extensions (for example one with `extensions: []`) now says so when it fails on a model whose provider one of your extensions registers or overrides. That extension never loaded in the child, so the child sent its requests through the built-in provider of the same name and failed with an unrelated provider error. The failure now names the provider and how to load its extension for that agent. Thanks to [@Yivas](https://github.com/Yivas) for the report. (#3100)
|
|
21
|
+
|
|
5
22
|
## [0.83.1] - 2026-10-27
|
|
6
23
|
|
|
7
24
|
### Highlights
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
setInlineWorkflowCoverage,
|
|
11
11
|
setMainThinkingLevelSource,
|
|
12
12
|
widgetRenderKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AKOIVLA5.js";
|
|
14
14
|
import {
|
|
15
15
|
package_default
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NKQ6JNAS.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-
|
|
64
|
+
} from "./chunk-DZDETGRJ.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-
|
|
92
|
+
} from "./chunk-7BWGNDNK.js";
|
|
93
93
|
import {
|
|
94
94
|
deliverAsyncRunStop,
|
|
95
95
|
ownerConfirmedDead,
|
|
96
96
|
readSessionMessagesTail,
|
|
97
97
|
resolveSubagentRunId,
|
|
98
98
|
restoreForegroundRunHistory
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-NENDSQUY.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-
|
|
121
|
+
} from "./chunk-L3WFKBEI.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-
|
|
132
|
+
} from "./chunk-PALJGGYC.js";
|
|
133
133
|
import {
|
|
134
134
|
ACTIVE_RUN_INDEX_DIR,
|
|
135
135
|
MissionNotFoundError,
|
|
@@ -178,7 +178,7 @@ import {
|
|
|
178
178
|
withWorkflowChildRunModel,
|
|
179
179
|
writeAsyncResultFile,
|
|
180
180
|
writeResultIndexForData
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-CGN2TVE7.js";
|
|
182
182
|
import "./chunk-F4ASL6OV.js";
|
|
183
183
|
import {
|
|
184
184
|
shouldUseNativeFsWatch
|
|
@@ -1215,7 +1215,9 @@ var ASYNC_RETENTION_DAYS = 30;
|
|
|
1215
1215
|
var ASYNC_RETENTION_BATCH_SIZE = 100;
|
|
1216
1216
|
var ASYNC_RETENTION_DELAY_MS = 6e4;
|
|
1217
1217
|
var ASYNC_RETENTION_TOMBSTONE_GRACE_MS = 24 * 60 * 60 * 1e3;
|
|
1218
|
+
var RESUMABLE_RETENTION_DAYS = 90;
|
|
1218
1219
|
var RETENTION_MS = ASYNC_RETENTION_DAYS * 24 * 60 * 60 * 1e3;
|
|
1220
|
+
var RESUMABLE_RETENTION_MS = RESUMABLE_RETENTION_DAYS * 24 * 60 * 60 * 1e3;
|
|
1219
1221
|
var LOCK_NAME = ".async-retention.lock";
|
|
1220
1222
|
var CURSOR_NAME = ".async-retention-cursor.json";
|
|
1221
1223
|
var LOG_NAME = "async-retention-maintenance.jsonl";
|
|
@@ -1389,8 +1391,8 @@ function runSkipReason(input) {
|
|
|
1389
1391
|
if (hasNestedReferences(status)) return "nested-reference";
|
|
1390
1392
|
if (missionReferenceBlocksReclaim(runDir, input.resultsDir, status.runId)) return "mission-reference";
|
|
1391
1393
|
if (hasUnresolvedRunHandoff(runDir, status)) return "handoff-reference";
|
|
1392
|
-
if (hasResumableContract(runDir, status)) return "resumable";
|
|
1393
1394
|
const timestamp = statusTimestamp(status, runDir);
|
|
1395
|
+
if (hasResumableContract(runDir, status) && (timestamp === void 0 || timestamp > input.resumableCutoff)) return "resumable";
|
|
1394
1396
|
if (timestamp === void 0) return "unknown-age";
|
|
1395
1397
|
if (timestamp > input.cutoff) return "recent";
|
|
1396
1398
|
return void 0;
|
|
@@ -1558,10 +1560,10 @@ function resultSkipReason(input) {
|
|
|
1558
1560
|
if (missionObserverIndexExists(input.resultsDir, runId)) return "mission-reference";
|
|
1559
1561
|
if (input.data.mode === "workflow" || completionMode(input.data) === "workflow" || typeof input.data.parentWorkflowRunId === "string" || typeof input.data.workflowKey === "string") return "workflow-reference";
|
|
1560
1562
|
if (hasUnresolvedResultHandoff(input.data)) return "handoff-reference";
|
|
1561
|
-
|
|
1563
|
+
const timestamp = resultTimestamp(input.data, input.candidate.path);
|
|
1564
|
+
if (resultHasResumableSession(input.data) && (timestamp === void 0 || timestamp > input.resumableCutoff)) return "resumable";
|
|
1562
1565
|
if (input.candidate.kind === "archive" && fs4.existsSync(path3.join(input.resultsDir, "completion-replay", `${encodeURIComponent(runId)}.json`))) return "replay-reference";
|
|
1563
1566
|
if (!terminalResult(input.data) && input.candidate.kind !== "replay" && input.candidate.kind !== "archive" && input.candidate.kind !== "tombstone") return "non-terminal-result";
|
|
1564
|
-
const timestamp = resultTimestamp(input.data, input.candidate.path);
|
|
1565
1567
|
if (timestamp === void 0) return "unknown-age";
|
|
1566
1568
|
if (timestamp > input.cutoff) return "recent";
|
|
1567
1569
|
return void 0;
|
|
@@ -1747,6 +1749,7 @@ async function cleanupAsyncRetention(options) {
|
|
|
1747
1749
|
if (markCancelled()) return finish();
|
|
1748
1750
|
const protectedRunIds = new Set(options.protectedRunIds ?? []);
|
|
1749
1751
|
const cutoff = currentTime - retentionMs;
|
|
1752
|
+
const resumableCutoff = currentTime - RESUMABLE_RETENTION_MS;
|
|
1750
1753
|
const cursor = readCursor(maintenanceRoot);
|
|
1751
1754
|
const runBudget = Math.ceil(batchSize / 2);
|
|
1752
1755
|
const resultBudget = batchSize - runBudget;
|
|
@@ -1811,7 +1814,7 @@ async function cleanupAsyncRetention(options) {
|
|
|
1811
1814
|
status = reconciliation.status ?? void 0;
|
|
1812
1815
|
if (reconciliation.repaired) result.repairedRuns += 1;
|
|
1813
1816
|
}
|
|
1814
|
-
const initialReason = runSkipReason({ runDir, status, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, cutoff, protectedRunIds, waitRunIds: waitReferences.runIds });
|
|
1817
|
+
const initialReason = runSkipReason({ runDir, status, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, cutoff, resumableCutoff, protectedRunIds, waitRunIds: waitReferences.runIds });
|
|
1815
1818
|
if (initialReason) {
|
|
1816
1819
|
increment(result.skipped, initialReason);
|
|
1817
1820
|
continue;
|
|
@@ -1826,7 +1829,7 @@ async function cleanupAsyncRetention(options) {
|
|
|
1826
1829
|
continue;
|
|
1827
1830
|
}
|
|
1828
1831
|
const freshWaitReferences2 = parseWaitRunIds(waitSubscriptionsDir);
|
|
1829
|
-
const finalReason = freshWaitReferences2.safe ? runSkipReason({ runDir, status, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, cutoff, protectedRunIds, waitRunIds: freshWaitReferences2.runIds }) : "wait-references-unknown";
|
|
1832
|
+
const finalReason = freshWaitReferences2.safe ? runSkipReason({ runDir, status, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, cutoff, resumableCutoff, protectedRunIds, waitRunIds: freshWaitReferences2.runIds }) : "wait-references-unknown";
|
|
1830
1833
|
if (finalReason) {
|
|
1831
1834
|
increment(result.skipped, `recheck-${finalReason}`);
|
|
1832
1835
|
continue;
|
|
@@ -1850,7 +1853,7 @@ async function cleanupAsyncRetention(options) {
|
|
|
1850
1853
|
}
|
|
1851
1854
|
const recheckStatus = readStatus2(tombstone);
|
|
1852
1855
|
const freshWaitReferences = parseWaitRunIds(waitSubscriptionsDir);
|
|
1853
|
-
const recheckReason = freshWaitReferences.safe ? runSkipReason({ runDir: tombstone, status: recheckStatus, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, cutoff, protectedRunIds, waitRunIds: freshWaitReferences.runIds }) : "wait-references-unknown";
|
|
1856
|
+
const recheckReason = freshWaitReferences.safe ? runSkipReason({ runDir: tombstone, status: recheckStatus, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, cutoff, resumableCutoff, protectedRunIds, waitRunIds: freshWaitReferences.runIds }) : "wait-references-unknown";
|
|
1854
1857
|
if (recheckReason) {
|
|
1855
1858
|
if (!fs4.existsSync(runDir)) {
|
|
1856
1859
|
fs4.renameSync(tombstone, runDir);
|
|
@@ -1882,7 +1885,7 @@ async function cleanupAsyncRetention(options) {
|
|
|
1882
1885
|
continue;
|
|
1883
1886
|
}
|
|
1884
1887
|
const data = readJson(candidate.path);
|
|
1885
|
-
const reason = resultSkipReason({ candidate, data, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, maintenanceRoot, cutoff, protectedRunIds, waitRunIds: waitReferences.runIds });
|
|
1888
|
+
const reason = resultSkipReason({ candidate, data, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, maintenanceRoot, cutoff, resumableCutoff, protectedRunIds, waitRunIds: waitReferences.runIds });
|
|
1886
1889
|
if (reason) {
|
|
1887
1890
|
increment(result.skipped, reason);
|
|
1888
1891
|
continue;
|
|
@@ -1893,7 +1896,7 @@ async function cleanupAsyncRetention(options) {
|
|
|
1893
1896
|
continue;
|
|
1894
1897
|
}
|
|
1895
1898
|
const freshWaitReferences2 = parseWaitRunIds(waitSubscriptionsDir);
|
|
1896
|
-
const finalReason = freshWaitReferences2.safe ? resultSkipReason({ candidate, data, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, maintenanceRoot, cutoff, protectedRunIds, waitRunIds: freshWaitReferences2.runIds }) : "wait-references-unknown";
|
|
1899
|
+
const finalReason = freshWaitReferences2.safe ? resultSkipReason({ candidate, data, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, maintenanceRoot, cutoff, resumableCutoff, protectedRunIds, waitRunIds: freshWaitReferences2.runIds }) : "wait-references-unknown";
|
|
1897
1900
|
if (finalReason) {
|
|
1898
1901
|
increment(result.skipped, `recheck-${finalReason}`);
|
|
1899
1902
|
continue;
|
|
@@ -1910,7 +1913,7 @@ async function cleanupAsyncRetention(options) {
|
|
|
1910
1913
|
const tombstoneCandidate = { ...candidate, path: tombstone, kind: "tombstone" };
|
|
1911
1914
|
const recheckData = readJson(tombstone);
|
|
1912
1915
|
const freshWaitReferences = parseWaitRunIds(waitSubscriptionsDir);
|
|
1913
|
-
const recheckReason = freshWaitReferences.safe ? resultSkipReason({ candidate: tombstoneCandidate, data: recheckData, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, maintenanceRoot, cutoff, protectedRunIds, waitRunIds: freshWaitReferences.runIds }) : "wait-references-unknown";
|
|
1916
|
+
const recheckReason = freshWaitReferences.safe ? resultSkipReason({ candidate: tombstoneCandidate, data: recheckData, asyncDirRoot: options.asyncDirRoot, resultsDir: options.resultsDir, maintenanceRoot, cutoff, resumableCutoff, protectedRunIds, waitRunIds: freshWaitReferences.runIds }) : "wait-references-unknown";
|
|
1914
1917
|
if (recheckReason) {
|
|
1915
1918
|
if (!fs4.existsSync(candidate.path)) {
|
|
1916
1919
|
fs4.renameSync(tombstone, candidate.path);
|
|
@@ -5182,7 +5185,7 @@ function registerSlashCommands(pi, state, options = {}) {
|
|
|
5182
5185
|
}
|
|
5183
5186
|
fleetOpen = true;
|
|
5184
5187
|
try {
|
|
5185
|
-
const { openSubagentFleet } = await import("./chunk-
|
|
5188
|
+
const { openSubagentFleet } = await import("./chunk-PV63UFUR.js");
|
|
5186
5189
|
await openSubagentFleet(ctx, state, { asyncDirRoot: DIRS.async, inspectorPlugins: () => getInspectorPlugins(pi), resultsDir: DIRS.results, fleetKeybindings: options.fleetKeybindings });
|
|
5187
5190
|
} finally {
|
|
5188
5191
|
fleetOpen = false;
|
|
@@ -8571,7 +8574,7 @@ function registerSubagentExtension(pi) {
|
|
|
8571
8574
|
const ctx = withLastUiContext((current) => current);
|
|
8572
8575
|
if (!ctx) return;
|
|
8573
8576
|
try {
|
|
8574
|
-
const { openSubagentFleet } = await import("./chunk-
|
|
8577
|
+
const { openSubagentFleet } = await import("./chunk-PV63UFUR.js");
|
|
8575
8578
|
await openSubagentFleet(ctx, state, { initialKey: itemKey, asyncDirRoot: DIRS.async, resultsDir: DIRS.results, fleetKeybindings: config.fleetKeybindings, inspectorPlugins: () => getInspectorPlugins(pi) });
|
|
8576
8579
|
} catch (error) {
|
|
8577
8580
|
if (isStaleExtensionContextError(error)) {
|
|
@@ -8767,7 +8770,7 @@ function registerSubagentExtension(pi) {
|
|
|
8767
8770
|
let executor;
|
|
8768
8771
|
let executorPromise;
|
|
8769
8772
|
let executorModulePromise;
|
|
8770
|
-
const loadExecutorModule = () => executorModulePromise ??= import("./chunk-
|
|
8773
|
+
const loadExecutorModule = () => executorModulePromise ??= import("./chunk-JG4QKI5M.js");
|
|
8771
8774
|
const getExecutor = () => {
|
|
8772
8775
|
executorPromise ??= loadExecutorModule().then(({ createSubagentExecutor }) => {
|
|
8773
8776
|
executor = createSubagentExecutor(executorDeps);
|
|
@@ -8781,7 +8784,7 @@ function registerSubagentExtension(pi) {
|
|
|
8781
8784
|
modulePreloadTimer = setTimeout(() => {
|
|
8782
8785
|
loadExecutorModule().catch(() => {
|
|
8783
8786
|
});
|
|
8784
|
-
if (fleetViewEnabled) import("./chunk-
|
|
8787
|
+
if (fleetViewEnabled) import("./chunk-PV63UFUR.js").catch(() => {
|
|
8785
8788
|
});
|
|
8786
8789
|
}, MODULE_PRELOAD_DELAY_MS);
|
|
8787
8790
|
modulePreloadTimer.unref?.();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isTrustedRecordedSessionFile,
|
|
3
3
|
resolveSubagentRunId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NENDSQUY.js";
|
|
5
5
|
import {
|
|
6
6
|
agentStreamOptions,
|
|
7
7
|
opencodeSessionHeaders,
|
|
8
8
|
ownsRun,
|
|
9
9
|
resolveAsyncResumeTarget
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-L3WFKBEI.js";
|
|
11
11
|
import {
|
|
12
12
|
currentCompletionOwnerId,
|
|
13
13
|
listMissions,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
reconcileAsyncRun,
|
|
17
17
|
resolveAuthorityDecision,
|
|
18
18
|
resolveMissionStoreLocation
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CGN2TVE7.js";
|
|
20
20
|
import {
|
|
21
21
|
deliverInterruptRequest,
|
|
22
22
|
queueRevivalBrief,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
projectTimeoutRecovery,
|
|
12
12
|
readAsyncRecoveryDescriptor,
|
|
13
13
|
utf8Tail
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-L3WFKBEI.js";
|
|
15
15
|
import {
|
|
16
16
|
MAX_ARGS_BYTES,
|
|
17
17
|
MAX_ARGS_DEPTH,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
resultFilePath,
|
|
25
25
|
resultPayloadMatchesSessionRun,
|
|
26
26
|
resultPayloadPathForSessionRun
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CGN2TVE7.js";
|
|
28
28
|
import {
|
|
29
29
|
shouldUseNativeFsWatch
|
|
30
30
|
} from "./chunk-NIXWDZZV.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildWorkflowChatProgressRows
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NENDSQUY.js";
|
|
4
4
|
import {
|
|
5
5
|
aggregateStepStatus,
|
|
6
6
|
contextModeBadge,
|
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
projectWorkflowChecklist,
|
|
26
26
|
withCachedUiContext,
|
|
27
27
|
workflowGraphStageNodes
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-L3WFKBEI.js";
|
|
29
29
|
import {
|
|
30
30
|
flatToLogicalStepIndex,
|
|
31
31
|
formatWorkflowJsonPreview,
|
|
32
32
|
hostStepReportName,
|
|
33
33
|
hostStepVerdictLabel
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-CGN2TVE7.js";
|
|
35
35
|
import {
|
|
36
36
|
snapshotExternalRuns
|
|
37
37
|
} from "./chunk-UKG4V45O.js";
|
|
@@ -2517,6 +2517,7 @@ ${script}
|
|
|
2517
2517
|
if (node !== wrapper && node.async === true && (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression")) {
|
|
2518
2518
|
errors.push({ message: "workflowScript does not support nested async functions. Use top-level await, plain helper functions that return runs.run(...), or explicit Promise chains.", ...nodeLocation(node) });
|
|
2519
2519
|
}
|
|
2520
|
+
if (node.type === "ImportExpression") errors.push({ message: "workflowScript cannot load modules with import().", ...nodeLocation(node) });
|
|
2520
2521
|
if (directRunsCall(node, "run")) {
|
|
2521
2522
|
const args = Array.isArray(node.arguments) ? node.arguments : [];
|
|
2522
2523
|
const keyNode = astNode(args[0]) ? args[0] : void 0;
|
|
@@ -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,7 +50,7 @@ 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
|
|
@@ -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);
|
|
@@ -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,7 +25,7 @@ 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,
|
|
@@ -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,
|
|
@@ -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,
|
|
@@ -326,7 +326,7 @@ import {
|
|
|
326
326
|
writeNestedControlRequest,
|
|
327
327
|
writeNestedControlResult,
|
|
328
328
|
writeNestedEvent
|
|
329
|
-
} from "./chunk-
|
|
329
|
+
} from "./chunk-CGN2TVE7.js";
|
|
330
330
|
import {
|
|
331
331
|
closeSteerInbox,
|
|
332
332
|
consumeSteerRequests,
|
|
@@ -1649,6 +1649,11 @@ function sourceUnderNodeModules() {
|
|
|
1649
1649
|
function supportsNativeRunner(nodeExecutable) {
|
|
1650
1650
|
return Boolean(process.features.typescript) && typeof nodeModule.registerHooks === "function" && nodeExecutable === process.execPath && !sourceUnderNodeModules();
|
|
1651
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
|
+
}
|
|
1652
1657
|
var DEFAULT_ASYNC_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
1653
1658
|
function formatAsyncStartedMessage(headline, interactive) {
|
|
1654
1659
|
const guidance = interactive ? [
|
|
@@ -2376,6 +2381,7 @@ function buildAsyncRunnerSteps(id, params) {
|
|
|
2376
2381
|
runtimeSnapshotHost: ctx.pi
|
|
2377
2382
|
});
|
|
2378
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);
|
|
2379
2385
|
if (externalRunner && permissionRules) {
|
|
2380
2386
|
throw new AsyncStartValidationError(`Agent '${a.name}' uses runner.type='${externalRunnerType}', which cannot enforce native Pi child permission rules.`);
|
|
2381
2387
|
}
|
|
@@ -2405,6 +2411,7 @@ function buildAsyncRunnerSteps(id, params) {
|
|
|
2405
2411
|
thinking: resolveEffectiveThinking(selectedModel, effectiveThinking),
|
|
2406
2412
|
...thinkingCeiling ? { thinkingCeiling } : {},
|
|
2407
2413
|
launchResolvedExtensions,
|
|
2414
|
+
...parentExtensionProvider ? { parentExtensionProvider } : {},
|
|
2408
2415
|
...requestedModel ? { requestedModel } : {},
|
|
2409
2416
|
...primaryModelFromParent ? { skipPrimaryModelVerification: true } : {},
|
|
2410
2417
|
...availableModels && availableModels.length > 0 ? { modelVerificationRegistry: availableModels } : {},
|
|
@@ -3161,6 +3168,7 @@ function executeAsyncSingle(id, params) {
|
|
|
3161
3168
|
runtimeSnapshotHost: ctx.pi
|
|
3162
3169
|
});
|
|
3163
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);
|
|
3164
3172
|
const fast = params.fast ?? agentConfig.fast;
|
|
3165
3173
|
const launchThinking = resolveEffectiveThinking(selectedModel, effectiveThinking);
|
|
3166
3174
|
const { definitionDigest, launchContractDigest } = resolveLaunchBinding({
|
|
@@ -3283,6 +3291,7 @@ function executeAsyncSingle(id, params) {
|
|
|
3283
3291
|
...params.fast ?? agentConfig.fast ? { fast: params.fast ?? agentConfig.fast } : {},
|
|
3284
3292
|
thinking: resolveEffectiveThinking(selectedModel, effectiveThinking),
|
|
3285
3293
|
...thinkingCeiling ? { thinkingCeiling } : {},
|
|
3294
|
+
...parentExtensionProvider ? { parentExtensionProvider } : {},
|
|
3286
3295
|
...requestedModel ? { requestedModel } : {},
|
|
3287
3296
|
...modelOrigin === "inherited" ? { skipPrimaryModelVerification: true } : {},
|
|
3288
3297
|
...availableModels && availableModels.length > 0 ? { modelVerificationRegistry: availableModels } : {},
|
|
@@ -10557,6 +10566,7 @@ function appendStepToAsyncChain(input) {
|
|
|
10557
10566
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
10558
10567
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
10559
10568
|
currentModelProvider: parentModel?.provider,
|
|
10569
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
10560
10570
|
currentModel: parentModel,
|
|
10561
10571
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
10562
10572
|
modelScope: discoveredForAppend.modelScope,
|
|
@@ -10959,6 +10969,7 @@ async function resumeExternalJobFollowUp(input) {
|
|
|
10959
10969
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
10960
10970
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
10961
10971
|
currentModelProvider: parentModel?.provider,
|
|
10972
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
10962
10973
|
currentModel: parentModel,
|
|
10963
10974
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
10964
10975
|
modelScope: input.modelScope,
|
|
@@ -11228,6 +11239,7 @@ async function resumeAsyncRun(input) {
|
|
|
11228
11239
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
11229
11240
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
11230
11241
|
currentModelProvider: parentModel2?.provider,
|
|
11242
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
11231
11243
|
currentModel: parentModel2,
|
|
11232
11244
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
11233
11245
|
modelScope,
|
|
@@ -11351,6 +11363,7 @@ async function resumeAsyncRun(input) {
|
|
|
11351
11363
|
parentSessionId: input.ctx.sessionManager.getSessionId() ?? void 0,
|
|
11352
11364
|
parentSessionFile: input.ctx.sessionManager.getSessionFile() ?? void 0,
|
|
11353
11365
|
currentModelProvider: parentModel?.provider,
|
|
11366
|
+
parentProviderRegistry: input.ctx.modelRegistry,
|
|
11354
11367
|
currentModel: parentModel,
|
|
11355
11368
|
scopedModelIds: scopedModelIdsFromContext(input.ctx),
|
|
11356
11369
|
modelScope,
|
|
@@ -12412,6 +12425,7 @@ async function runAsyncPath(data, deps) {
|
|
|
12412
12425
|
parentSessionId: data.parentPiSessionId,
|
|
12413
12426
|
parentSessionFile: ctx.sessionManager.getSessionFile() ?? void 0,
|
|
12414
12427
|
currentModelProvider: parentModel?.provider,
|
|
12428
|
+
parentProviderRegistry: ctx.modelRegistry,
|
|
12415
12429
|
currentModel: parentModel,
|
|
12416
12430
|
scopedModelIds: data.scopedModelIds,
|
|
12417
12431
|
modelScope: data.modelScope,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
summarizeContextModes,
|
|
14
14
|
utf8Tail,
|
|
15
15
|
workflowPreflightLaneForRuntimeKey
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-L3WFKBEI.js";
|
|
17
17
|
import {
|
|
18
18
|
assertSafeNestedId,
|
|
19
19
|
checkRecordedPidLiveness,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
updateActiveRunIndex,
|
|
33
33
|
validateModelResponseAliases,
|
|
34
34
|
writeAsyncResultFile
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-CGN2TVE7.js";
|
|
36
36
|
import {
|
|
37
37
|
deliverStopRequest,
|
|
38
38
|
stopInboxClosedPath
|
|
@@ -6,25 +6,25 @@ import {
|
|
|
6
6
|
resolveWorkflowForegroundSteeringTarget,
|
|
7
7
|
steerAsyncRun,
|
|
8
8
|
steerWorkflowForegroundTarget
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4E7BKDTX.js";
|
|
10
10
|
import {
|
|
11
11
|
FLEET_STATUS_WIDGET_KEY,
|
|
12
12
|
reportFleetWarning,
|
|
13
13
|
runningTone,
|
|
14
14
|
stepTaskSummary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AKOIVLA5.js";
|
|
16
16
|
import {
|
|
17
17
|
foregroundChildStateLabel,
|
|
18
18
|
formatAsyncRunTranscript,
|
|
19
19
|
stopAsyncRun
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NENDSQUY.js";
|
|
21
21
|
import {
|
|
22
22
|
contextModeBadge,
|
|
23
23
|
contextModeLabel,
|
|
24
24
|
decodeUtf8Tail,
|
|
25
25
|
listAsyncRuns
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-L3WFKBEI.js";
|
|
27
|
+
import "./chunk-CGN2TVE7.js";
|
|
28
28
|
import "./chunk-F4ASL6OV.js";
|
|
29
29
|
import "./chunk-NIXWDZZV.js";
|
|
30
30
|
import "./chunk-C5P5CHYK.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rewriteSubagentPrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XDQORLZ5.js";
|
|
4
4
|
import {
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-NKQ6JNAS.js";
|
|
7
|
+
import "./chunk-7BWGNDNK.js";
|
|
8
8
|
import {
|
|
9
9
|
MODEL_ONLY_TOOL
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-L3WFKBEI.js";
|
|
11
11
|
import "./chunk-NF7IEKBH.js";
|
|
12
12
|
import {
|
|
13
13
|
appendAgentRefinementOverlay
|
|
14
14
|
} from "./chunk-LFDBD4PW.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-CGN2TVE7.js";
|
|
16
16
|
import "./chunk-NIXWDZZV.js";
|
|
17
17
|
import "./chunk-C5P5CHYK.js";
|
|
18
18
|
import "./chunk-7F6RKT6W.js";
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
resolveCurrentSessionId,
|
|
16
16
|
resolveWatchdogReviewModel,
|
|
17
17
|
startWatchdogDiffBaselineCapture
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7BWGNDNK.js";
|
|
19
19
|
import {
|
|
20
20
|
MODEL_ONLY_TOOL,
|
|
21
21
|
agentStreamOptions,
|
|
22
22
|
opencodeSessionHeaders
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-L3WFKBEI.js";
|
|
24
24
|
import {
|
|
25
25
|
inheritedNestedRouteOf
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CGN2TVE7.js";
|
|
27
27
|
import {
|
|
28
28
|
CHILD_WATCHDOG_STATUS_EVENT,
|
|
29
29
|
MISSING_STRUCTURED_ACCEPTANCE_REPORT_ERROR,
|
package/bundle/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function readInstalledPackageVersion() {
|
|
|
17
17
|
var loadedPackageVersion = readInstalledPackageVersion();
|
|
18
18
|
|
|
19
19
|
// index.ts
|
|
20
|
-
var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-
|
|
20
|
+
var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-VQVVHSY6.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-235AWJUQ.js")).default;
|
|
21
21
|
function registerSubagentExtension(pi) {
|
|
22
22
|
const installedVersion = readInstalledPackageVersion();
|
|
23
23
|
if (installedVersion !== loadedPackageVersion) {
|
package/bundle/preflight.js
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
import "./chunk-LFDBD4PW.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PALJGGYC.js";
|
|
10
10
|
import {
|
|
11
11
|
nestedResultsPath,
|
|
12
12
|
processTerminalCandidatePath,
|
|
13
13
|
processTerminalPath,
|
|
14
14
|
resultFilePath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CGN2TVE7.js";
|
|
16
16
|
import {
|
|
17
17
|
applyIntercomBridgeToAgent,
|
|
18
18
|
resolveIntercomBridge,
|