antechamber 0.2.28 → 0.2.30
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
CHANGED
|
@@ -7,6 +7,19 @@ and this project uses [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.30] - 2026-10-19
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Preserve archived and nested task children in replay sandboxes, with transcript and task session paths
|
|
15
|
+
remapped locally, so child history and costs are not lost when replaying selected roots.
|
|
16
|
+
|
|
17
|
+
## [0.2.29] - 2026-10-19
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Keep compaction markers before the replies that follow them, both live and after reopening a conversation.
|
|
22
|
+
|
|
10
23
|
## [0.2.28] - 2026-10-18
|
|
11
24
|
|
|
12
25
|
- fix(session): keep replies visible after compaction (#37)
|
|
@@ -255,6 +255,16 @@ export class PiEventTranslator {
|
|
|
255
255
|
}
|
|
256
256
|
s.activeUserMessageID = messageID;
|
|
257
257
|
const input = s.inputs?.get(messageID);
|
|
258
|
+
if (ev.type === "message_start" || (input && !input.delivered)) {
|
|
259
|
+
const messages = s.messages ?? [];
|
|
260
|
+
const boundary = messages.findIndex((item) => item.info.id === s.tree.revert?.messageID);
|
|
261
|
+
const compaction = messages.findLast((item, index) => (boundary < 0 || index < boundary) && item.parts.some((part) => part.type === "compaction"));
|
|
262
|
+
// Optimistic queued prompts can precede compactions that happened before delivery.
|
|
263
|
+
if (compaction)
|
|
264
|
+
(s.deliveredInputCompactions ??= new Map()).set(messageID, compaction.info.id);
|
|
265
|
+
else
|
|
266
|
+
s.deliveredInputCompactions?.delete(messageID);
|
|
267
|
+
}
|
|
258
268
|
if (input && !input.delivered) {
|
|
259
269
|
input.delivered = true;
|
|
260
270
|
if (input.accepted)
|
|
@@ -519,15 +529,23 @@ export class PiEventTranslator {
|
|
|
519
529
|
// Trust that over our snapshot, which goes stale whenever pi switches on
|
|
520
530
|
// its own side (subagent routing, an in-session /model, a resumed file).
|
|
521
531
|
this.services.applyPiModel(s, msg.provider, piModelId(msg.responseModel, msg.model));
|
|
522
|
-
const
|
|
532
|
+
const messages = s.messages ?? [];
|
|
533
|
+
const inputID = typeof ev.clientMessageId === "string"
|
|
534
|
+
? ev.clientMessageId
|
|
535
|
+
: (s.activeUserMessageID ?? messages.findLast((m) => m.info.role === "user")?.info.id ?? "");
|
|
536
|
+
const inputIndex = Math.max(messages.findIndex((m) => m.info.id === inputID), messages.findIndex((m) => m.info.id === s.deliveredInputCompactions?.get(inputID)));
|
|
537
|
+
const boundary = messages.findIndex((m) => m.info.id === s.tree.revert?.messageID);
|
|
538
|
+
// A compaction starts a display turn without changing the native prompt's identity.
|
|
539
|
+
const compaction = messages.findLast((m, index) => index > inputIndex &&
|
|
540
|
+
(boundary < 0 || index < boundary) &&
|
|
541
|
+
m.info.role === "user" &&
|
|
542
|
+
m.parts.some((part) => part.type === "compaction"));
|
|
523
543
|
const assistant = {
|
|
524
544
|
id: id("msg"),
|
|
525
545
|
sessionID: s.info.id,
|
|
526
546
|
role: "assistant",
|
|
527
547
|
time: { created: Date.now() },
|
|
528
|
-
parentID:
|
|
529
|
-
? ev.clientMessageId
|
|
530
|
-
: (s.activeUserMessageID ?? parent?.info.id ?? ""),
|
|
548
|
+
parentID: compaction?.info.id ?? inputID,
|
|
531
549
|
modelID: s.model?.modelID ?? "unknown",
|
|
532
550
|
providerID: s.model?.providerID ?? "unknown",
|
|
533
551
|
mode: getAgentName(),
|
package/dist/routes-v1.js
CHANGED
|
@@ -151,15 +151,18 @@ export async function handleV1(services, req, res, url, path, method, directory)
|
|
|
151
151
|
const parents = new Set(messages
|
|
152
152
|
.slice(start, end)
|
|
153
153
|
.flatMap((message) => (message.info.role === "assistant" ? [message.info.parentID] : [])));
|
|
154
|
-
// A compaction opens its own display turn, but ongoing replies still belong to the original prompt.
|
|
155
154
|
const parent = messages.findIndex((message, index) => index < start && message.info.role === "user" && parents.has(message.info.id));
|
|
156
155
|
if (parent >= 0)
|
|
157
156
|
start = parent;
|
|
158
157
|
// OpenChamber 1.24 widens a page with no user message only up to 120 messages
|
|
159
158
|
// (150 on desktop), then renders it with no turn to anchor on: blank. A long agent
|
|
160
|
-
// turn outgrows that, so
|
|
161
|
-
if (!messages
|
|
162
|
-
|
|
159
|
+
// turn outgrows that, so retain its native prompt, not just a compaction display marker.
|
|
160
|
+
if (!messages
|
|
161
|
+
.slice(start, end)
|
|
162
|
+
.some((message) => message.info.role === "user" && !message.parts.some((part) => part.type === "compaction"))) {
|
|
163
|
+
const prompt = messages.findLastIndex((message, index) => index < start &&
|
|
164
|
+
message.info.role === "user" &&
|
|
165
|
+
!message.parts.some((part) => part.type === "compaction"));
|
|
163
166
|
if (prompt >= 0)
|
|
164
167
|
start = prompt;
|
|
165
168
|
}
|
package/dist/session-history.js
CHANGED
|
@@ -152,8 +152,9 @@ export function parsePiSessionText(s, agentName, raw) {
|
|
|
152
152
|
continue;
|
|
153
153
|
}
|
|
154
154
|
if (e.type === "compaction" && typeof e.summary === "string" && typeof e.firstKeptEntryId === "string") {
|
|
155
|
-
|
|
156
|
-
out.push(...
|
|
155
|
+
const compaction = compactionMessages(s, e.id ?? `r${indexOf.get(e) ?? 0}`, e.summary, entryTime(e), currentModel, currentThinkingLevel);
|
|
156
|
+
out.push(...compaction);
|
|
157
|
+
lastUserId = compaction[0].info.id;
|
|
157
158
|
continue;
|
|
158
159
|
}
|
|
159
160
|
if (e.type === "custom_message") {
|
package/dist/sessions.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface ManagedSession extends ThinkingState {
|
|
|
24
24
|
abortRequests?: number;
|
|
25
25
|
titleSource?: TitleSource;
|
|
26
26
|
activeUserMessageID?: string;
|
|
27
|
+
deliveredInputCompactions?: Map<string, string>;
|
|
27
28
|
inputs?: Map<string, {
|
|
28
29
|
text: string;
|
|
29
30
|
delivery: "steer" | "queue";
|