antechamber 0.2.14 → 0.2.16
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 +16 -0
- package/dist/session-store.d.ts +2 -0
- package/dist/session-store.js +2 -0
- package/dist/sessions.js +9 -3
- package/dist/subagents.d.ts +5 -1
- package/dist/subagents.js +40 -6
- package/extensions/omo-dag/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project uses [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.16] - 2026-10-17
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Keep deleted subagent sessions deleted. They came back when their parent's history was read again or when the
|
|
15
|
+
adapter restarted, because OmO still holds their task record.
|
|
16
|
+
- Keep subagent sessions archived after an adapter restart. Archiving a parent with its subagents left the
|
|
17
|
+
subagents active as orphans once the adapter restarted.
|
|
18
|
+
|
|
19
|
+
## [0.2.15] - 2026-10-17
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Show saved child-task errors when no transcript is available, and label missing runtime, token and cost statistics
|
|
24
|
+
as unknown instead of zero.
|
|
25
|
+
|
|
10
26
|
## [0.2.14] - 2026-10-16
|
|
11
27
|
|
|
12
28
|
### Fixed
|
package/dist/session-store.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export type TitleSource = "user" | "native" | "fallback" | "generated";
|
|
|
35
35
|
export interface SessionRegistryEntry {
|
|
36
36
|
/** Created by this connector, rather than discovered from another OmO client. */
|
|
37
37
|
connectorOwned?: true;
|
|
38
|
+
/** A child the user deleted; kept so its task record or parent history cannot list it again. */
|
|
39
|
+
deleted?: true;
|
|
38
40
|
tree?: SessionTreeState;
|
|
39
41
|
parentID?: string | undefined;
|
|
40
42
|
parentMessageID?: string;
|
package/dist/session-store.js
CHANGED
|
@@ -346,6 +346,8 @@ function registryEntry(value) {
|
|
|
346
346
|
return false;
|
|
347
347
|
if (value.connectorOwned !== undefined && value.connectorOwned !== true)
|
|
348
348
|
return false;
|
|
349
|
+
if (value.deleted !== undefined && value.deleted !== true)
|
|
350
|
+
return false;
|
|
349
351
|
if (value.tree !== undefined && !sessionTreeState(value.tree))
|
|
350
352
|
return false;
|
|
351
353
|
if (value.parentID !== undefined && typeof value.parentID !== "string")
|
package/dist/sessions.js
CHANGED
|
@@ -344,7 +344,7 @@ export class SessionManager {
|
|
|
344
344
|
this.emit(s.info.directory, { type: "session.deleted", properties: { info: s.info } });
|
|
345
345
|
await this.lifecycle.dormant(s);
|
|
346
346
|
const piPath = this.subagents.owns(sessionId) || this.monitors.owns(sessionId) ? undefined : (s.piPath ?? s.restored?.piPath);
|
|
347
|
-
this.subagents.remove(sessionId);
|
|
347
|
+
const child = this.subagents.remove(sessionId);
|
|
348
348
|
this.monitors.remove(sessionId);
|
|
349
349
|
if (piPath !== undefined) {
|
|
350
350
|
try {
|
|
@@ -355,7 +355,9 @@ export class SessionManager {
|
|
|
355
355
|
throw error;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
|
|
358
|
+
// A deleted child keeps its tombstone; OmO still holds the task record that would list it again.
|
|
359
|
+
if (!child)
|
|
360
|
+
this.store.remove(sessionId);
|
|
359
361
|
return true;
|
|
360
362
|
}
|
|
361
363
|
/**
|
|
@@ -391,7 +393,9 @@ export class SessionManager {
|
|
|
391
393
|
delete s.info.time.archived; // 0 = unarchive
|
|
392
394
|
}
|
|
393
395
|
s.info.time.updated = Date.now();
|
|
394
|
-
|
|
396
|
+
// Child sessions have no pi path of their own, so persistMeta would skip them.
|
|
397
|
+
if (!this.subagents.save(s.info.id))
|
|
398
|
+
this.persistMeta(s);
|
|
395
399
|
this.emit(s.info.directory, { type: "session.updated", properties: { info: s.info } });
|
|
396
400
|
return s.info;
|
|
397
401
|
}
|
|
@@ -1318,6 +1322,8 @@ export class SessionManager {
|
|
|
1318
1322
|
/** Resolve a bare session id (e.g. deep link after restart) via known directories. */
|
|
1319
1323
|
resolveRestored(sessionId) {
|
|
1320
1324
|
const reg = this.store.get(sessionId);
|
|
1325
|
+
if (reg?.deleted)
|
|
1326
|
+
return undefined;
|
|
1321
1327
|
if (reg && existsSync(reg.piPath)) {
|
|
1322
1328
|
return this.adopt({
|
|
1323
1329
|
piSessionId: reg.piSessionId,
|
package/dist/subagents.d.ts
CHANGED
|
@@ -78,12 +78,16 @@ export declare class SubagentBridge {
|
|
|
78
78
|
private publishRefresh;
|
|
79
79
|
private saveArchive;
|
|
80
80
|
private fallback;
|
|
81
|
+
/** Save a rename or archive made through the session routes; false when `id` is not a child. */
|
|
82
|
+
save(id: string): boolean;
|
|
81
83
|
private persist;
|
|
82
84
|
private emitPart;
|
|
83
85
|
private closeWatchers;
|
|
84
86
|
finishCalls(parentID: string, cancelled?: boolean): void;
|
|
85
87
|
stopParent(parentID: string): void;
|
|
86
|
-
|
|
88
|
+
/** Forget a deleted child and leave a registry tombstone; false when `id` is not a child. */
|
|
89
|
+
remove(id: string): boolean;
|
|
90
|
+
private deleted;
|
|
87
91
|
dispose(): void;
|
|
88
92
|
}
|
|
89
93
|
export {};
|
package/dist/subagents.js
CHANGED
|
@@ -319,6 +319,8 @@ export class SubagentBridge {
|
|
|
319
319
|
const id = metadata.taskID;
|
|
320
320
|
const details = record(metadata.task) ? metadata.task : {};
|
|
321
321
|
let child = this.children.get(ocIdFor(id));
|
|
322
|
+
if (!child && this.deleted(ocIdFor(id)))
|
|
323
|
+
continue;
|
|
322
324
|
if (!child) {
|
|
323
325
|
child = this.create(parent, {
|
|
324
326
|
id,
|
|
@@ -340,6 +342,7 @@ export class SubagentBridge {
|
|
|
340
342
|
}
|
|
341
343
|
}
|
|
342
344
|
create(parent, task) {
|
|
345
|
+
const archived = this.store.get(ocIdFor(task.id))?.archived;
|
|
343
346
|
const session = this.managedSession({
|
|
344
347
|
id: ocIdFor(task.id),
|
|
345
348
|
parentID: parent.info.id,
|
|
@@ -347,7 +350,7 @@ export class SubagentBridge {
|
|
|
347
350
|
directory: parent.info.directory,
|
|
348
351
|
title: typeof task.input.description === "string" ? task.input.description : task.id,
|
|
349
352
|
version: parent.info.version,
|
|
350
|
-
time: { ...parent.info.time },
|
|
353
|
+
time: { ...parent.info.time, ...(archived !== undefined ? { archived } : {}) },
|
|
351
354
|
});
|
|
352
355
|
const child = {
|
|
353
356
|
session,
|
|
@@ -373,7 +376,7 @@ export class SubagentBridge {
|
|
|
373
376
|
const entry = this.store.get(id);
|
|
374
377
|
if (!entry)
|
|
375
378
|
return this.removed.has(id) ? undefined : this.adopt(id);
|
|
376
|
-
if (!entry.task || !entry.parentID)
|
|
379
|
+
if (entry.deleted || !entry.task || !entry.parentID)
|
|
377
380
|
return undefined;
|
|
378
381
|
const child = this.create(this.detachedParent(entry.parentID, entry.directory, entry), entry.task);
|
|
379
382
|
child.session.info.title = entry.title ?? child.session.info.title;
|
|
@@ -639,10 +642,16 @@ export class SubagentBridge {
|
|
|
639
642
|
const model = typeof data.model === "string"
|
|
640
643
|
? data.model
|
|
641
644
|
: `${resolved.provider ?? "unknown"}/${resolved.model_id ?? "unknown"}`;
|
|
645
|
+
const finalResponse = stripTaskSuffix(typeof data.final_response === "string" ? data.final_response : "");
|
|
646
|
+
const error = terminal(data.status) && data.status !== "completed" && typeof data.error_message === "string"
|
|
647
|
+
? data.error_message
|
|
648
|
+
: undefined;
|
|
649
|
+
const runtime = stats.runtime_ms ?? data.duration_ms;
|
|
642
650
|
const text = [
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
"
|
|
651
|
+
finalResponse,
|
|
652
|
+
error && !finalResponse.includes(error) ? error : "",
|
|
653
|
+
`Model: ${model}\nRuntime: ${runtime === undefined ? "unknown" : `${runtime} ms`}\nTokens: ${stats.total_tokens ?? "unknown"}\nCost: ${stats.cost_usd === undefined ? "unknown" : `$${stats.cost_usd}`}`,
|
|
654
|
+
"Full transcript is unavailable.",
|
|
646
655
|
]
|
|
647
656
|
.filter(Boolean)
|
|
648
657
|
.join("\n\n");
|
|
@@ -666,6 +675,7 @@ export class SubagentBridge {
|
|
|
666
675
|
role: "assistant",
|
|
667
676
|
provider: resolved.provider ?? model.split("/")[0],
|
|
668
677
|
model: resolved.model_id ?? model.split("/").slice(1).join("/"),
|
|
678
|
+
...(error ? { stopReason: "error", errorMessage: error } : {}),
|
|
669
679
|
// run_stats tokens are totals across the whole run (every model call),
|
|
670
680
|
// not one request's context, so only the cost is carried as usage; the
|
|
671
681
|
// totals stay in the text above. Token counts here read as context fill.
|
|
@@ -675,6 +685,14 @@ export class SubagentBridge {
|
|
|
675
685
|
});
|
|
676
686
|
return this.parse(child.session, `${request}\n${response}\n`);
|
|
677
687
|
}
|
|
688
|
+
/** Save a rename or archive made through the session routes; false when `id` is not a child. */
|
|
689
|
+
save(id) {
|
|
690
|
+
const child = this.children.get(id);
|
|
691
|
+
if (!child)
|
|
692
|
+
return false;
|
|
693
|
+
this.persist(child);
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
678
696
|
persist(child) {
|
|
679
697
|
const { info } = child.session;
|
|
680
698
|
try {
|
|
@@ -684,6 +702,7 @@ export class SubagentBridge {
|
|
|
684
702
|
directory: info.directory,
|
|
685
703
|
title: info.title,
|
|
686
704
|
parentID: info.parentID,
|
|
705
|
+
...(info.time.archived !== undefined ? { archived: info.time.archived } : {}),
|
|
687
706
|
task: child.task,
|
|
688
707
|
created: info.time.created,
|
|
689
708
|
updated: info.time.updated,
|
|
@@ -739,14 +758,29 @@ export class SubagentBridge {
|
|
|
739
758
|
this.closeWatchers(child);
|
|
740
759
|
}
|
|
741
760
|
}
|
|
761
|
+
/** Forget a deleted child and leave a registry tombstone; false when `id` is not a child. */
|
|
742
762
|
remove(id) {
|
|
743
763
|
const child = this.children.get(id);
|
|
744
764
|
if (!child)
|
|
745
|
-
return;
|
|
765
|
+
return false;
|
|
746
766
|
this.closeWatchers(child);
|
|
747
767
|
child.parts.clear();
|
|
748
768
|
this.children.delete(id);
|
|
749
769
|
this.removed.add(id);
|
|
770
|
+
const { info } = child.session;
|
|
771
|
+
this.store.set(id, {
|
|
772
|
+
deleted: true,
|
|
773
|
+
piSessionId: child.session.piSessionId ?? child.task.id,
|
|
774
|
+
piPath: this.archive(child.task.id),
|
|
775
|
+
directory: info.directory,
|
|
776
|
+
...(info.parentID !== undefined ? { parentID: info.parentID } : {}),
|
|
777
|
+
created: info.time.created,
|
|
778
|
+
updated: info.time.updated,
|
|
779
|
+
});
|
|
780
|
+
return true;
|
|
781
|
+
}
|
|
782
|
+
deleted(id) {
|
|
783
|
+
return this.removed.has(id) || this.store.get(id)?.deleted === true;
|
|
750
784
|
}
|
|
751
785
|
dispose() {
|
|
752
786
|
for (const child of this.children.values()) {
|