@sema-agent/core 1.350.0 → 1.352.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.d.ts +1 -0
- package/dist/agents/subagent.d.ts.map +1 -1
- package/dist/agents/subagent.js +116 -8
- package/dist/agents/subagent.js.map +1 -1
- package/dist/core/runner/prepare-task.d.ts.map +1 -1
- package/dist/core/runner/prepare-task.js +13 -1
- package/dist/core/runner/prepare-task.js.map +1 -1
- package/dist/core/task-registry.d.ts +11 -0
- package/dist/core/task-registry.d.ts.map +1 -1
- package/dist/core/task-registry.js +46 -1
- package/dist/core/task-registry.js.map +1 -1
- package/dist/core/types.d.ts +3 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts.map +1 -1
- package/dist/orchestration/run-workflow-tool.js +8 -5
- package/dist/orchestration/run-workflow-tool.js.map +1 -1
- package/package.json +1 -1
|
@@ -177,6 +177,7 @@ export interface SendMessageToolOptions {
|
|
|
177
177
|
senderName?: string;
|
|
178
178
|
roster?: import("./roster-store.js").RosterStore;
|
|
179
179
|
siblingRetain?: SubagentRetainLedger;
|
|
180
|
+
onBackgroundChildEvent?: (event: import("../core/types.js").BackgroundChildEvent) => void;
|
|
180
181
|
}
|
|
181
182
|
export declare function recordRosterSpawn(roster: import("./roster-store.js").RosterStore | undefined, entry: import("./roster-store.js").RosterEntry): void;
|
|
182
183
|
export declare function createSendMessageTool(opts: SendMessageToolOptions): import("../core/types.js").AgentTool<Type.TObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent.d.ts","sourceRoot":"","sources":["../../src/agents/subagent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE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sB;;;;aAkVjE;AAGD,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAK5D,MAAM,WAAW,0BAA0B;IAEzC,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,EAAE,OAAO,0BAA0B,EAAE,YAAY,CAAC;IAE1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,0BAA0B;;;aA6EzE"}
|
package/dist/agents/subagent.js
CHANGED
|
@@ -442,6 +442,7 @@ function makeSubagentResume(deps) {
|
|
|
442
442
|
const childRunner = entry.runner ?? deps.runner;
|
|
443
443
|
let stream;
|
|
444
444
|
let reviveCycle;
|
|
445
|
+
let reviveEmit;
|
|
445
446
|
let marker;
|
|
446
447
|
try {
|
|
447
448
|
let leafId;
|
|
@@ -478,9 +479,54 @@ function makeSubagentResume(deps) {
|
|
|
478
479
|
: "resume unavailable: the agent's registry row no longer exists (terminal GC) — relaunch a new agent instead.", revived.reason === "still_running" ? "steering.still_running" : "resume.row_gone");
|
|
479
480
|
}
|
|
480
481
|
reviveCycle = revived.cycle;
|
|
482
|
+
if (deps.bgSink !== undefined) {
|
|
483
|
+
reviveEmit = (event) => {
|
|
484
|
+
try {
|
|
485
|
+
deps.bgSink(event);
|
|
486
|
+
}
|
|
487
|
+
catch {
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
reviveEmit({
|
|
491
|
+
kind: "spawn",
|
|
492
|
+
taskId: deps.taskId,
|
|
493
|
+
sessionScoped: deps.sessionScoped === true,
|
|
494
|
+
...(deps.rowOwner !== undefined ? { owner: deps.rowOwner } : {}),
|
|
495
|
+
...(deps.rowScope !== undefined ? { scope: deps.rowScope } : {}),
|
|
496
|
+
description: `${deps.rowDescription ?? "sub-agent"} (resumed ${marker})`,
|
|
497
|
+
...(deps.rowAgentType !== undefined ? { agentType: deps.rowAgentType } : {}),
|
|
498
|
+
...(deps.rowName !== undefined ? { name: deps.rowName } : {}),
|
|
499
|
+
sessionId: entry.childSessionId,
|
|
500
|
+
...(deps.rowParentTaskId !== undefined ? { parentTaskId: deps.rowParentTaskId } : {}),
|
|
501
|
+
...(deps.rowParentSessionId !== undefined ? { parentSessionId: deps.rowParentSessionId } : {}),
|
|
502
|
+
});
|
|
503
|
+
}
|
|
481
504
|
}
|
|
482
505
|
stream = childRunner.runTaskStream(resumeSpec, undefined, {
|
|
483
506
|
...entry.internalsSnapshot,
|
|
507
|
+
...(reviveEmit !== undefined
|
|
508
|
+
? {
|
|
509
|
+
onForwardEvent: (e) => {
|
|
510
|
+
try {
|
|
511
|
+
entry.internalsSnapshot.onForwardEvent?.(e);
|
|
512
|
+
}
|
|
513
|
+
catch {
|
|
514
|
+
}
|
|
515
|
+
if (e.type === "task_progress") {
|
|
516
|
+
reviveEmit({
|
|
517
|
+
kind: "tick",
|
|
518
|
+
taskId: deps.taskId,
|
|
519
|
+
sessionScoped: deps.sessionScoped === true,
|
|
520
|
+
...(deps.rowAgentType !== undefined ? { agentType: deps.rowAgentType } : {}),
|
|
521
|
+
progressTaskId: e.taskId,
|
|
522
|
+
...(e.parentTaskId !== undefined ? { progressParentTaskId: e.parentTaskId } : {}),
|
|
523
|
+
...(e.name !== undefined ? { name: e.name } : {}),
|
|
524
|
+
usage: e.usage,
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
}
|
|
529
|
+
: {}),
|
|
484
530
|
...(deps.currentParentNotify !== undefined ? { parentNotify: deps.currentParentNotify } : {}),
|
|
485
531
|
...(reviveCycle !== undefined
|
|
486
532
|
? {
|
|
@@ -534,11 +580,26 @@ function makeSubagentResume(deps) {
|
|
|
534
580
|
catch {
|
|
535
581
|
}
|
|
536
582
|
}
|
|
583
|
+
const stoppedByRevive = status === "killed" ? deps.registry?.getStopAttribution(deps.taskId ?? "") ?? "system" : undefined;
|
|
584
|
+
reviveEmit?.({
|
|
585
|
+
kind: "terminal",
|
|
586
|
+
taskId: deps.taskId,
|
|
587
|
+
sessionScoped: deps.sessionScoped === true,
|
|
588
|
+
sessionId: entry.childSessionId,
|
|
589
|
+
transcriptId: entry.childSessionId,
|
|
590
|
+
status,
|
|
591
|
+
seq: entry.cycleSeq,
|
|
592
|
+
...(stoppedByRevive !== undefined ? { stoppedBy: stoppedByRevive } : {}),
|
|
593
|
+
summary: `resumed sub-agent ${marker} — ${status === "killed" ? "killed" : child.status}`,
|
|
594
|
+
resumable: status !== "killed",
|
|
595
|
+
usage: { tokens: child.stats.tokens, turns: child.stats.turns, costMicroUsd: child.stats.costMicroUsd },
|
|
596
|
+
});
|
|
537
597
|
const resumeFrame = {
|
|
538
598
|
task_id: entry.childSessionId,
|
|
539
599
|
task_type: "background_agent",
|
|
540
600
|
toolUseId: deps.parentToolCallId,
|
|
541
601
|
status,
|
|
602
|
+
...(stoppedByRevive !== undefined ? { stoppedBy: stoppedByRevive } : {}),
|
|
542
603
|
seq: entry.cycleSeq,
|
|
543
604
|
summary: `resumed sub-agent ${marker} — ${status === "killed" ? "killed" : child.status}`,
|
|
544
605
|
...(child.result ? { result: child.result.slice(0, 2_000) } : {}),
|
|
@@ -578,6 +639,17 @@ function makeSubagentResume(deps) {
|
|
|
578
639
|
catch {
|
|
579
640
|
}
|
|
580
641
|
}
|
|
642
|
+
const stoppedByReject = abort.signal.aborted ? deps.registry?.getStopAttribution(deps.taskId ?? "") ?? "system" : undefined;
|
|
643
|
+
reviveEmit?.({
|
|
644
|
+
kind: "terminal",
|
|
645
|
+
taskId: deps.taskId,
|
|
646
|
+
sessionScoped: deps.sessionScoped === true,
|
|
647
|
+
sessionId: entry.childSessionId,
|
|
648
|
+
status: abort.signal.aborted ? "killed" : "failed",
|
|
649
|
+
seq: entry.cycleSeq,
|
|
650
|
+
...(stoppedByReject !== undefined ? { stoppedBy: stoppedByReject } : {}),
|
|
651
|
+
summary: `resumed sub-agent ${marker} — ${abort.signal.aborted ? "killed" : "failed"}`.slice(0, 300),
|
|
652
|
+
});
|
|
581
653
|
try {
|
|
582
654
|
deps.notify?.({
|
|
583
655
|
task_id: entry.childSessionId,
|
|
@@ -585,6 +657,7 @@ function makeSubagentResume(deps) {
|
|
|
585
657
|
toolUseId: deps.parentToolCallId,
|
|
586
658
|
status: abort.signal.aborted ? "killed" : "failed",
|
|
587
659
|
seq: entry.cycleSeq,
|
|
660
|
+
...(stoppedByReject !== undefined ? { stoppedBy: stoppedByReject } : {}),
|
|
588
661
|
summary: `resumed sub-agent ${marker} — ${abort.signal.aborted ? "killed" : `failed: ${e instanceof Error ? e.message : String(e)}`}`.slice(0, 300),
|
|
589
662
|
}, { priority: "later" });
|
|
590
663
|
}
|
|
@@ -1300,15 +1373,17 @@ function makeSubagentTool(opts, depth, excluded, extraToolsBudget) {
|
|
|
1300
1373
|
...(ctx.excludeTools !== undefined ? { excludeTools: [...ctx.excludeTools] } : {}),
|
|
1301
1374
|
...(ctx.deferTools !== undefined ? { deferTools: [...ctx.deferTools] } : {}),
|
|
1302
1375
|
...(ctx.promptProfile !== undefined ? { promptProfile: ctx.promptProfile } : {}),
|
|
1376
|
+
...(ctx.additionalDirectories !== undefined ? { additionalDirectories: [...ctx.additionalDirectories] } : {}),
|
|
1377
|
+
...(ctx.envFacts !== undefined ? { envFacts: { ...ctx.envFacts } } : {}),
|
|
1303
1378
|
...(ctx.getApiKeyAndHeaders !== undefined ? { getApiKeyAndHeaders: ctx.getApiKeyAndHeaders } : {}),
|
|
1304
1379
|
enableBlockedReport: true,
|
|
1305
1380
|
limits: childLimits,
|
|
1306
1381
|
signal,
|
|
1307
1382
|
});
|
|
1308
|
-
const tryRetainChild = async (ledger, entryTtlMs) => {
|
|
1383
|
+
const tryRetainChild = async (ledger, entryTtlMs, preMintedSessionId) => {
|
|
1309
1384
|
if (!ledger)
|
|
1310
1385
|
return undefined;
|
|
1311
|
-
const childSessionId = uuidv7();
|
|
1386
|
+
const childSessionId = preMintedSessionId ?? uuidv7();
|
|
1312
1387
|
const { signal: _spawnSignal, ...plainSpec } = buildChildSpec(undefined);
|
|
1313
1388
|
let entry = ledger.register(ctx.toolCallId, {
|
|
1314
1389
|
childSessionId,
|
|
@@ -1450,7 +1525,7 @@ function makeSubagentTool(opts, depth, excluded, extraToolsBudget) {
|
|
|
1450
1525
|
}
|
|
1451
1526
|
if (!forkedId) {
|
|
1452
1527
|
const wt = await finishWorktree();
|
|
1453
|
-
return { isError: true, content: `Sub-agent not started: source session not found or fork unavailable.${wt ? `\n${wt}` : ""}`, details: { error: "source not found", ...(ctx.sessionId !== undefined ? { sourceSessionId: ctx.sessionId } : {}) } };
|
|
1528
|
+
return { isError: true, content: `Sub-agent not started: source session not found or fork unavailable.${wt ? `\n${wt}` : ""}`, details: { error: "source not found", forkLane: ctx.hostSessionFork ? "host" : "child-runner", ...(ctx.sessionId !== undefined ? { sourceSessionId: ctx.sessionId } : {}) } };
|
|
1454
1529
|
}
|
|
1455
1530
|
const forkInternals = { ...childInternals, insideFork: true };
|
|
1456
1531
|
stepRecorder.lockTo(forkedId);
|
|
@@ -1478,7 +1553,10 @@ function makeSubagentTool(opts, depth, excluded, extraToolsBudget) {
|
|
|
1478
1553
|
...(bgScope !== undefined ? { scope: bgScope } : {}),
|
|
1479
1554
|
...(sessionScopedBg ? { sessionScoped: true } : {}),
|
|
1480
1555
|
description: shortDesc,
|
|
1556
|
+
agentType: spawnAgentType,
|
|
1481
1557
|
...(agentName !== undefined ? { name: agentName } : {}),
|
|
1558
|
+
...(ctx.taskId !== undefined && ctx.taskId !== ctx.sessionId ? { parentTaskId: ctx.taskId } : {}),
|
|
1559
|
+
...(ctx.sessionId !== undefined ? { parentSessionId: ctx.sessionId } : {}),
|
|
1482
1560
|
deliveryChannel: "attaching",
|
|
1483
1561
|
toolUseId: ctx.toolCallId,
|
|
1484
1562
|
abort,
|
|
@@ -1770,7 +1848,10 @@ task_id: ${taskId}
|
|
|
1770
1848
|
...(bgScope !== undefined ? { scope: bgScope } : {}),
|
|
1771
1849
|
...(sessionScopedBg ? { sessionScoped: true } : {}),
|
|
1772
1850
|
description: shortDesc,
|
|
1851
|
+
agentType: spawnAgentType,
|
|
1773
1852
|
...(agentName !== undefined ? { name: agentName } : {}),
|
|
1853
|
+
...(ctx.taskId !== undefined && ctx.taskId !== ctx.sessionId ? { parentTaskId: ctx.taskId } : {}),
|
|
1854
|
+
...(ctx.sessionId !== undefined ? { parentSessionId: ctx.sessionId } : {}),
|
|
1774
1855
|
deliveryChannel: "attaching",
|
|
1775
1856
|
toolUseId: ctx.toolCallId,
|
|
1776
1857
|
abort,
|
|
@@ -1793,6 +1874,8 @@ task_id: ${taskId}
|
|
|
1793
1874
|
catch {
|
|
1794
1875
|
}
|
|
1795
1876
|
};
|
|
1877
|
+
const bgChildSessionId = uuidv7();
|
|
1878
|
+
stepRecorder.lockTo(bgChildSessionId);
|
|
1796
1879
|
sinkEmit({
|
|
1797
1880
|
kind: "spawn",
|
|
1798
1881
|
taskId,
|
|
@@ -1802,6 +1885,7 @@ task_id: ${taskId}
|
|
|
1802
1885
|
description: shortDesc,
|
|
1803
1886
|
agentType: spawnAgentType,
|
|
1804
1887
|
...(agentName !== undefined ? { name: agentName } : {}),
|
|
1888
|
+
sessionId: bgChildSessionId,
|
|
1805
1889
|
...(ctx.taskId !== undefined && ctx.taskId !== ctx.sessionId ? { parentTaskId: ctx.taskId } : {}),
|
|
1806
1890
|
...(ctx.sessionId !== undefined ? { parentSessionId: ctx.sessionId } : {}),
|
|
1807
1891
|
});
|
|
@@ -1812,9 +1896,7 @@ task_id: ${taskId}
|
|
|
1812
1896
|
: ctx.subagentRetain;
|
|
1813
1897
|
if (sessionScopedBg && bgRetainLedger)
|
|
1814
1898
|
ensureSessionReapHook(bg.registry);
|
|
1815
|
-
const bgRetain = await tryRetainChild(bgRetainLedger, sessionScopedBg && ctx.subagentRetain ? ctx.subagentRetain.ttlMs : undefined);
|
|
1816
|
-
if (bgRetain)
|
|
1817
|
-
stepRecorder.lockTo(bgRetain.childSessionId);
|
|
1899
|
+
const bgRetain = await tryRetainChild(bgRetainLedger, sessionScopedBg && ctx.subagentRetain ? ctx.subagentRetain.ttlMs : undefined, bgChildSessionId);
|
|
1818
1900
|
if (bgRetain) {
|
|
1819
1901
|
bg.registry.markRetainedContinuation(taskId);
|
|
1820
1902
|
const origRelease = bgRetain.release;
|
|
@@ -1823,7 +1905,7 @@ task_id: ${taskId}
|
|
|
1823
1905
|
await origRelease();
|
|
1824
1906
|
};
|
|
1825
1907
|
}
|
|
1826
|
-
const bgSpec = { ...buildChildSpec(abort.signal),
|
|
1908
|
+
const bgSpec = { ...buildChildSpec(abort.signal), sessionId: bgChildSessionId };
|
|
1827
1909
|
if (sessionScopedBg && bgSpec.limits?.timeoutSec === undefined) {
|
|
1828
1910
|
bgSpec.limits = { ...(bgSpec.limits ?? {}), timeoutSec: SESSION_BG_DEFAULT_TIMEOUT_SEC };
|
|
1829
1911
|
}
|
|
@@ -1919,6 +2001,7 @@ task_id: ${taskId}
|
|
|
1919
2001
|
sessionScoped: sessionScopedBg === true,
|
|
1920
2002
|
...(child.sessionId ? { sessionId: child.sessionId, transcriptId: child.sessionId } : {}),
|
|
1921
2003
|
status: settled,
|
|
2004
|
+
...(seqAtSettle !== undefined ? { seq: seqAtSettle } : {}),
|
|
1922
2005
|
...(stoppedBy !== undefined ? { stoppedBy } : {}),
|
|
1923
2006
|
summary: `${shortDesc} — ${settled === "killed" ? "stopped" : child.status}${observerNote}`,
|
|
1924
2007
|
...residual,
|
|
@@ -1972,6 +2055,13 @@ task_id: ${taskId}
|
|
|
1972
2055
|
else
|
|
1973
2056
|
bgRetainLedger?.markSettled(ctx.toolCallId);
|
|
1974
2057
|
}
|
|
2058
|
+
else {
|
|
2059
|
+
try {
|
|
2060
|
+
await opts.runner.sessions.release(bgChildSessionId);
|
|
2061
|
+
}
|
|
2062
|
+
catch {
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
1975
2065
|
const msg = e instanceof Error ? e.message : String(e);
|
|
1976
2066
|
const settled = bg.registry.settleBackgroundAgent(taskId, { status: killed ? "killed" : "failed", error: msg }) ?? (killed ? "killed" : "failed");
|
|
1977
2067
|
const stoppedBy = settled === "killed" ? bg.registry.getStopAttribution(taskId) ?? "system" : undefined;
|
|
@@ -1980,7 +2070,9 @@ task_id: ${taskId}
|
|
|
1980
2070
|
kind: "terminal",
|
|
1981
2071
|
taskId,
|
|
1982
2072
|
sessionScoped: sessionScopedBg === true,
|
|
2073
|
+
sessionId: bgChildSessionId,
|
|
1983
2074
|
status: settled,
|
|
2075
|
+
...(seqAtSettle !== undefined ? { seq: seqAtSettle } : {}),
|
|
1984
2076
|
...(stoppedBy !== undefined ? { stoppedBy } : {}),
|
|
1985
2077
|
summary: `${shortDesc} — ${settled === "failed" ? `failed: ${msg}` : settled}${observerNote}`.slice(0, 300),
|
|
1986
2078
|
});
|
|
@@ -1990,6 +2082,7 @@ task_id: ${taskId}
|
|
|
1990
2082
|
task_type: "background_agent",
|
|
1991
2083
|
toolUseId: ctx.toolCallId,
|
|
1992
2084
|
status: settled,
|
|
2085
|
+
sessionId: bgChildSessionId,
|
|
1993
2086
|
...(seqAtSettle !== undefined ? { seq: seqAtSettle } : {}),
|
|
1994
2087
|
...(stoppedBy !== undefined ? { stoppedBy } : {}),
|
|
1995
2088
|
summary: `${shortDesc} — ${settled === "failed" ? `failed: ${msg}` : settled}${observerNote}`.slice(0, 300),
|
|
@@ -2263,7 +2356,7 @@ export function createSendMessageTool(opts) {
|
|
|
2263
2356
|
}
|
|
2264
2357
|
if (byName.status === "found") {
|
|
2265
2358
|
const h = byName.handle;
|
|
2266
|
-
target = { task_id: h.id, type: h.type, status: h.status, ...(h.toolUseId !== undefined ? { toolUseId: h.toolUseId } : {}) };
|
|
2359
|
+
target = { task_id: h.id, type: h.type, status: h.status, ...(h.toolUseId !== undefined ? { toolUseId: h.toolUseId } : {}), ...(h.sessionScoped ? { sessionScoped: true } : {}), ...(h.description !== undefined ? { description: h.description } : {}), ...(h.name !== undefined ? { name: h.name } : {}), ...(h.agentType !== undefined ? { agentType: h.agentType } : {}), ...(h.owner !== undefined ? { owner: h.owner } : {}), ...(h.scope !== undefined ? { scope: h.scope } : {}), ...(h.parentTaskId !== undefined ? { parentTaskId: h.parentTaskId } : {}), ...(h.parentSessionId !== undefined ? { parentSessionId: h.parentSessionId } : {}) };
|
|
2267
2360
|
}
|
|
2268
2361
|
else {
|
|
2269
2362
|
let rosterHit;
|
|
@@ -2358,6 +2451,15 @@ export function createSendMessageTool(opts) {
|
|
|
2358
2451
|
registry: opts.registry,
|
|
2359
2452
|
taskId: targetId,
|
|
2360
2453
|
taskAccess: resolvedAccess,
|
|
2454
|
+
...((ctx.onBackgroundChildEvent ?? opts.onBackgroundChildEvent) ? { bgSink: ctx.onBackgroundChildEvent ?? opts.onBackgroundChildEvent } : {}),
|
|
2455
|
+
sessionScoped: row.sessionScoped === true,
|
|
2456
|
+
...(row.description !== undefined ? { rowDescription: row.description } : {}),
|
|
2457
|
+
...(row.name !== undefined ? { rowName: row.name } : {}),
|
|
2458
|
+
...(row.agentType !== undefined ? { rowAgentType: row.agentType } : {}),
|
|
2459
|
+
...(row.owner !== undefined ? { rowOwner: row.owner } : {}),
|
|
2460
|
+
...(row.scope !== undefined ? { rowScope: row.scope } : {}),
|
|
2461
|
+
...(row.parentTaskId !== undefined ? { rowParentTaskId: row.parentTaskId } : {}),
|
|
2462
|
+
...(row.parentSessionId !== undefined ? { rowParentSessionId: row.parentSessionId } : {}),
|
|
2361
2463
|
...(opts.notify ? { currentParentNotify: opts.notify } : {}),
|
|
2362
2464
|
});
|
|
2363
2465
|
const summary = typeof a.summary === "string" && a.summary.trim() !== "" ? a.summary.trim().slice(0, 200) : undefined;
|
|
@@ -2419,6 +2521,12 @@ export function createAgentTranscriptTool(opts) {
|
|
|
2419
2521
|
};
|
|
2420
2522
|
const row = opts.registry.list(access, { limit: 500 }).find((r) => r.task_id === id);
|
|
2421
2523
|
if (!row || row.type !== "background_agent") {
|
|
2524
|
+
if (/^w[0-9a-f]{16}$/.test(id) || (row !== undefined && row.type === "workflow")) {
|
|
2525
|
+
return {
|
|
2526
|
+
content: `No transcript: "${id}" is a WORKFLOW run id — AgentTranscript reads sub-agent transcripts only. For the run's per-agent rows (which agent failed, why, elapsed) call TaskOutput({ task_id: "${id}" }); to continue a fixed script, re-invoke the workflow with resumeFromRunId: "${id}".`,
|
|
2527
|
+
details: { error: "workflow_id", id },
|
|
2528
|
+
};
|
|
2529
|
+
}
|
|
2422
2530
|
return { content: `No transcript: no background agent task "${id}" (unknown id, not yours, or expired).`, details: { error: "not_found", id } };
|
|
2423
2531
|
}
|
|
2424
2532
|
const runLedger = ctx.subagentRetain ?? undefined;
|