pi-better-subagents 0.32.3 → 0.32.5
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/child-operations.ts +2 -1
- package/index.ts +3 -0
- package/operation-bridge-types.ts +5 -0
- package/package.json +1 -1
- package/worker-operations-host.ts +2 -1
package/child-operations.ts
CHANGED
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
findBridgeEnvironmentKey,
|
|
52
52
|
isLaunchTool,
|
|
53
53
|
normalizeWaitForOperationsResult,
|
|
54
|
+
requiresParkCheckpoint,
|
|
54
55
|
parseBridgeEndpoint,
|
|
55
56
|
validateJsonSchemaSupport,
|
|
56
57
|
redactSecret,
|
|
@@ -1012,7 +1013,7 @@ export function installChildOperationBridge(
|
|
|
1012
1013
|
toolCallId,
|
|
1013
1014
|
},
|
|
1014
1015
|
};
|
|
1015
|
-
const shouldPark = normalized.result
|
|
1016
|
+
const shouldPark = requiresParkCheckpoint(normalized.result);
|
|
1016
1017
|
if (shouldPark) {
|
|
1017
1018
|
if (!state.descriptor?.capabilities.parking) {
|
|
1018
1019
|
throw new OperationToolError("the parent asked this worker to park without a parking capability");
|
package/index.ts
CHANGED
|
@@ -2382,7 +2382,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
2382
2382
|
defaultSkills: skills.mode === "inherit" ? null : [...skills.paths],
|
|
2383
2383
|
}),
|
|
2384
2384
|
});
|
|
2385
|
+
const sessionTimeout = timingOverride.maxMinutes;
|
|
2385
2386
|
resetSettings();
|
|
2387
|
+
// The session timeout beats the environment, even after saving defaults.
|
|
2388
|
+
if (sessionTimeout !== undefined) changeTiming("maxMinutes", sessionTimeout);
|
|
2386
2389
|
return { ok: true, message: "Subagent defaults saved." };
|
|
2387
2390
|
} catch (error) {
|
|
2388
2391
|
return { ok: false, message: `Could not save subagent defaults: ${error instanceof Error ? error.message : String(error)}` };
|
|
@@ -959,6 +959,11 @@ export interface NormalizedWaitResult {
|
|
|
959
959
|
continuationNote?: string;
|
|
960
960
|
}
|
|
961
961
|
|
|
962
|
+
/** Settled dependencies do not bypass a checkpoint while the writer is still parking. */
|
|
963
|
+
export function requiresParkCheckpoint(wait: NormalizedWaitResult): boolean {
|
|
964
|
+
return wait.park && (wait.phase === "parking" || !wait.settled);
|
|
965
|
+
}
|
|
966
|
+
|
|
962
967
|
export function normalizeWaitForOperationsResult(value: unknown): { ok: true; result: NormalizedWaitResult } | { ok: false; message: string } {
|
|
963
968
|
if (!value || typeof value !== "object" || Array.isArray(value)) return { ok: false, message: "wait result must be an object" };
|
|
964
969
|
const record = value as JsonRecord;
|
package/package.json
CHANGED
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
isValidTaskId,
|
|
46
46
|
normalizeToolDescriptors,
|
|
47
47
|
normalizeWaitForOperationsResult,
|
|
48
|
+
requiresParkCheckpoint,
|
|
48
49
|
operationBridgeErrorBody,
|
|
49
50
|
redactSecret,
|
|
50
51
|
validateCheckpointParams,
|
|
@@ -890,7 +891,7 @@ export async function createOperationBridgeHost(
|
|
|
890
891
|
if (tool === "wait_for_operations") {
|
|
891
892
|
const wait = normalizeWaitForOperationsResult(cloned);
|
|
892
893
|
if (!wait.ok) throw new OperationBridgeError("response-invalid", wait.message);
|
|
893
|
-
if (wait.result
|
|
894
|
+
if (requiresParkCheckpoint(wait.result)) {
|
|
894
895
|
run.issuedWaits.set(wait.result.waitId, {
|
|
895
896
|
generation: wait.result.generation,
|
|
896
897
|
requestId: envelope.id,
|