oira666_pi-subagent 0.2.13 → 0.2.15
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/package.json +1 -1
- package/resume.ts +1 -1
- package/runner.ts +2 -30
package/package.json
CHANGED
package/resume.ts
CHANGED
|
@@ -23,7 +23,7 @@ export function getDefaultSubagentSessionRoot(ctx: ExtensionContext): string {
|
|
|
23
23
|
|
|
24
24
|
const mainSessionDir = ctx.sessionManager.getSessionDir?.();
|
|
25
25
|
if (typeof mainSessionDir === "string" && mainSessionDir.length > 0) {
|
|
26
|
-
return path.join(
|
|
26
|
+
return path.join(mainSessionDir, "subagents");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
throw new Error("Cannot determine subagent session root: sessionManager.getSessionDir() is unavailable.");
|
package/runner.ts
CHANGED
|
@@ -224,7 +224,7 @@ function parseInheritedCliArgs(argv: string[]): InheritedCliArgs {
|
|
|
224
224
|
|
|
225
225
|
// ── ALWAYS-PROXY: known value flags ──────────────────────────────────────
|
|
226
226
|
if ([
|
|
227
|
-
"--provider", "--api-key", "--system-prompt",
|
|
227
|
+
"--provider", "--api-key", "--system-prompt",
|
|
228
228
|
"--models", "--skill", "--prompt-template", "--theme",
|
|
229
229
|
].includes(flagName)) {
|
|
230
230
|
const [value, skip] = getVal();
|
|
@@ -311,11 +311,6 @@ function hasMessage(result: SingleResult, message: Message): boolean {
|
|
|
311
311
|
return result.messages.some((existing) => messageDedupKey(existing) === key);
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
function resultHasStarted(result: SingleResult | undefined): boolean {
|
|
315
|
-
if (!result) return false;
|
|
316
|
-
return result.messages.length > 0 || result.completedTurns > 0 || result.liveLog.length > 0 || Object.keys(result.toolCalls).length > 0;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
314
|
function sessionDirExists(dir: string | undefined): boolean {
|
|
320
315
|
if (!dir) return false;
|
|
321
316
|
try {
|
|
@@ -550,30 +545,7 @@ export async function runAgentSubprocess(opts: RunAgentOptions): Promise<SingleR
|
|
|
550
545
|
};
|
|
551
546
|
}
|
|
552
547
|
|
|
553
|
-
|
|
554
|
-
if (resumeSession && sessionDir && !sessionDirExists(sessionDir)) {
|
|
555
|
-
if (resultHasStarted(initialResult)) {
|
|
556
|
-
const errorMessage = `Cannot resume subagent session: session directory does not exist: ${sessionDir}`;
|
|
557
|
-
return {
|
|
558
|
-
agent: agentName,
|
|
559
|
-
agentSource: agent.source,
|
|
560
|
-
task,
|
|
561
|
-
exitCode: 1,
|
|
562
|
-
messages: initialResult?.messages ? [...initialResult.messages] : [],
|
|
563
|
-
stderr: errorMessage,
|
|
564
|
-
usage: initialResult?.usage ? { ...initialResult.usage } : emptyUsage(),
|
|
565
|
-
toolCalls: initialResult?.toolCalls ? { ...initialResult.toolCalls } : {},
|
|
566
|
-
model: initialResult?.model ?? agent.model,
|
|
567
|
-
stopReason: "error",
|
|
568
|
-
errorMessage,
|
|
569
|
-
completedTurns: initialResult?.completedTurns ?? 0,
|
|
570
|
-
turnInProgress: false,
|
|
571
|
-
liveLog: initialResult?.liveLog ? [...initialResult.liveLog] : [],
|
|
572
|
-
sessionDir,
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
shouldContinueSession = false;
|
|
576
|
-
}
|
|
548
|
+
const shouldContinueSession = resumeSession && (!sessionDir || sessionDirExists(sessionDir));
|
|
577
549
|
|
|
578
550
|
const result: SingleResult = {
|
|
579
551
|
agent: agentName,
|