@sema-agent/core 1.431.0 → 1.433.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/dist/agents/subagent.js
CHANGED
|
@@ -529,6 +529,7 @@ function makeSubagentResume(deps) {
|
|
|
529
529
|
...(deps.rowName !== undefined ? { name: deps.rowName } : {}),
|
|
530
530
|
sessionId: entry.childSessionId,
|
|
531
531
|
transcriptId: entry.childSessionId,
|
|
532
|
+
...(deps.parentToolCallId !== undefined ? { parentToolCallId: deps.parentToolCallId } : {}),
|
|
532
533
|
...(deps.rowParentTaskId !== undefined ? { parentTaskId: deps.rowParentTaskId } : {}),
|
|
533
534
|
...(deps.rowParentSessionId !== undefined ? { parentSessionId: deps.rowParentSessionId } : {}),
|
|
534
535
|
...(deps.rowRootSessionId !== undefined ? { rootSessionId: deps.rowRootSessionId } : {}),
|
|
@@ -555,6 +556,7 @@ function makeSubagentResume(deps) {
|
|
|
555
556
|
sessionScoped: deps.sessionScoped === true,
|
|
556
557
|
...(deps.rowAgentType !== undefined ? { agentType: deps.rowAgentType } : {}),
|
|
557
558
|
transcriptId: entry.childSessionId,
|
|
559
|
+
...(deps.parentToolCallId !== undefined ? { parentToolCallId: deps.parentToolCallId } : {}),
|
|
558
560
|
progressTaskId: e.taskId,
|
|
559
561
|
...(e.parentTaskId !== undefined ? { progressParentTaskId: e.parentTaskId } : {}),
|
|
560
562
|
...(e.name !== undefined ? { name: e.name } : {}),
|
|
@@ -625,6 +627,7 @@ function makeSubagentResume(deps) {
|
|
|
625
627
|
sessionScoped: deps.sessionScoped === true,
|
|
626
628
|
sessionId: entry.childSessionId,
|
|
627
629
|
transcriptId: entry.childSessionId,
|
|
630
|
+
...(deps.parentToolCallId !== undefined ? { parentToolCallId: deps.parentToolCallId } : {}),
|
|
628
631
|
status,
|
|
629
632
|
seq: entry.cycleSeq,
|
|
630
633
|
...(stoppedByRevive !== undefined ? { stoppedBy: stoppedByRevive } : {}),
|
|
@@ -688,6 +691,7 @@ function makeSubagentResume(deps) {
|
|
|
688
691
|
sessionScoped: deps.sessionScoped === true,
|
|
689
692
|
sessionId: entry.childSessionId,
|
|
690
693
|
transcriptId: entry.childSessionId,
|
|
694
|
+
...(deps.parentToolCallId !== undefined ? { parentToolCallId: deps.parentToolCallId } : {}),
|
|
691
695
|
status: abort.signal.aborted ? "killed" : "failed",
|
|
692
696
|
seq: entry.cycleSeq,
|
|
693
697
|
...(stoppedByReject !== undefined ? { stoppedBy: stoppedByReject } : {}),
|
|
@@ -1691,6 +1695,7 @@ function makeSubagentTool(opts, depth, excluded, extraToolsBudget) {
|
|
|
1691
1695
|
...(agentName !== undefined ? { name: agentName } : {}),
|
|
1692
1696
|
sessionId: forkedId,
|
|
1693
1697
|
transcriptId: forkedId,
|
|
1698
|
+
parentToolCallId: ctx.toolCallId,
|
|
1694
1699
|
...(ctx.taskId !== undefined && ctx.taskId !== ctx.sessionId ? { parentTaskId: ctx.taskId } : {}),
|
|
1695
1700
|
...(ctx.sessionId !== undefined ? { parentSessionId: ctx.sessionId } : {}),
|
|
1696
1701
|
...((ctx.rootSessionId ?? ctx.sessionId) !== undefined ? { rootSessionId: ctx.rootSessionId ?? ctx.sessionId } : {}),
|
|
@@ -1722,6 +1727,7 @@ function makeSubagentTool(opts, depth, excluded, extraToolsBudget) {
|
|
|
1722
1727
|
taskId,
|
|
1723
1728
|
sessionScoped: sessionScopedBg === true,
|
|
1724
1729
|
transcriptId: forkedId,
|
|
1730
|
+
parentToolCallId: ctx.toolCallId,
|
|
1725
1731
|
progressTaskId: e.taskId,
|
|
1726
1732
|
...(e.parentTaskId !== undefined ? { progressParentTaskId: e.parentTaskId } : {}),
|
|
1727
1733
|
agentType: spawnAgentType,
|
|
@@ -1786,6 +1792,7 @@ function makeSubagentTool(opts, depth, excluded, extraToolsBudget) {
|
|
|
1786
1792
|
sessionScoped: sessionScopedBg === true,
|
|
1787
1793
|
sessionId: forkTranscriptId,
|
|
1788
1794
|
...(stillbornFork ? {} : { transcriptId: forkTranscriptId }),
|
|
1795
|
+
parentToolCallId: ctx.toolCallId,
|
|
1789
1796
|
status: settledBg,
|
|
1790
1797
|
...(stoppedByBg !== undefined ? { stoppedBy: stoppedByBg } : {}),
|
|
1791
1798
|
summary: `${ccCompletionText(shortDesc, settledBg, String(child.status), Date.now() - forkBgStartedAt)}`,
|
|
@@ -1828,6 +1835,7 @@ function makeSubagentTool(opts, depth, excluded, extraToolsBudget) {
|
|
|
1828
1835
|
sessionScoped: sessionScopedBg === true,
|
|
1829
1836
|
sessionId: forkedId,
|
|
1830
1837
|
transcriptId: forkedId,
|
|
1838
|
+
parentToolCallId: ctx.toolCallId,
|
|
1831
1839
|
status: settledBg,
|
|
1832
1840
|
...(stoppedByBg !== undefined ? { stoppedBy: stoppedByBg } : {}),
|
|
1833
1841
|
summary: summaryBg,
|
|
@@ -2045,6 +2053,7 @@ task_id: ${taskId}
|
|
|
2045
2053
|
...(agentName !== undefined ? { name: agentName } : {}),
|
|
2046
2054
|
sessionId: bgChildSessionId,
|
|
2047
2055
|
transcriptId: bgChildSessionId,
|
|
2056
|
+
parentToolCallId: ctx.toolCallId,
|
|
2048
2057
|
...(reviveRow !== undefined
|
|
2049
2058
|
? {
|
|
2050
2059
|
...(reviveRow.parentTaskId !== undefined ? { parentTaskId: reviveRow.parentTaskId } : {}),
|
|
@@ -2116,6 +2125,7 @@ task_id: ${taskId}
|
|
|
2116
2125
|
taskId,
|
|
2117
2126
|
sessionScoped: sessionScopedBg === true,
|
|
2118
2127
|
transcriptId: bgChildSessionId,
|
|
2128
|
+
parentToolCallId: ctx.toolCallId,
|
|
2119
2129
|
progressTaskId: e.taskId,
|
|
2120
2130
|
...(e.parentTaskId !== undefined ? { progressParentTaskId: e.parentTaskId } : {}),
|
|
2121
2131
|
agentType: spawnAgentType,
|
|
@@ -2358,6 +2368,7 @@ task_id: ${taskId}
|
|
|
2358
2368
|
taskId,
|
|
2359
2369
|
sessionScoped: sessionScopedBg === true,
|
|
2360
2370
|
...(child.sessionId ? { sessionId: child.sessionId, transcriptId: child.sessionId } : {}),
|
|
2371
|
+
parentToolCallId: ctx.toolCallId,
|
|
2361
2372
|
status: settled,
|
|
2362
2373
|
...(seqAtSettle !== undefined ? { seq: seqAtSettle } : {}),
|
|
2363
2374
|
...(stoppedBy !== undefined ? { stoppedBy } : {}),
|
|
@@ -2431,6 +2442,7 @@ task_id: ${taskId}
|
|
|
2431
2442
|
sessionScoped: sessionScopedBg === true,
|
|
2432
2443
|
sessionId: bgChildSessionId,
|
|
2433
2444
|
transcriptId: bgChildSessionId,
|
|
2445
|
+
parentToolCallId: ctx.toolCallId,
|
|
2434
2446
|
status: settled,
|
|
2435
2447
|
...(seqAtSettle !== undefined ? { seq: seqAtSettle } : {}),
|
|
2436
2448
|
...(stoppedBy !== undefined ? { stoppedBy } : {}),
|
package/dist/core/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export function killProcessTree(pid, opts) {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
const graceMs = normalizeGraceMs(opts?.graceMs);
|
|
19
|
-
killProcessTreeWindows(pid, graceMs,
|
|
19
|
+
killProcessTreeWindows(pid, graceMs, undefined);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const useGroupKill = opts?.detached !== false;
|
|
@@ -331,7 +331,8 @@ export class NodeExecutionEnv {
|
|
|
331
331
|
const onAbort = () => {
|
|
332
332
|
abortKillInFlight = true;
|
|
333
333
|
if (child?.pid) {
|
|
334
|
-
|
|
334
|
+
const abortTarget = child;
|
|
335
|
+
killProcessTree(child.pid, { stillRunning: () => abortTarget.exitCode === null && abortTarget.signalCode === null });
|
|
335
336
|
}
|
|
336
337
|
if (callbackError) {
|
|
337
338
|
const p = partialOutput();
|
|
@@ -440,7 +441,8 @@ export class NodeExecutionEnv {
|
|
|
440
441
|
}
|
|
441
442
|
timedOut = true;
|
|
442
443
|
if (child?.pid) {
|
|
443
|
-
|
|
444
|
+
const timeoutTarget = child;
|
|
445
|
+
killProcessTree(child.pid, { stillRunning: () => timeoutTarget.exitCode === null && timeoutTarget.signalCode === null });
|
|
444
446
|
}
|
|
445
447
|
armForceSettle(err(new ExecutionError("timeout", `timeout:${options?.timeout}`, undefined, partialOutput())));
|
|
446
448
|
}, timeoutMs);
|
|
@@ -578,8 +580,10 @@ export class NodeExecutionEnv {
|
|
|
578
580
|
if (onDetach("timeout"))
|
|
579
581
|
return;
|
|
580
582
|
timedOut = true;
|
|
581
|
-
if (child?.pid)
|
|
582
|
-
|
|
583
|
+
if (child?.pid) {
|
|
584
|
+
const adoptFallbackTarget = child;
|
|
585
|
+
killProcessTree(child.pid, { stillRunning: () => adoptFallbackTarget.exitCode === null && adoptFallbackTarget.signalCode === null });
|
|
586
|
+
}
|
|
583
587
|
armForceSettle(err(new ExecutionError("timeout", `timeout:${options?.timeout}`, undefined, partialOutput())));
|
|
584
588
|
};
|
|
585
589
|
if (options?.detachSignal) {
|