antechamber 2.0.20 → 2.0.22

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,24 @@ and this project uses [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.22] - 2026-11-30
11
+
12
+ ### Fixed
13
+
14
+ - OpenChamber 2.8 shows the real context usage, the model picker and the thinking-effort control again. It loads no
15
+ model catalog while the backend lists no plugins, so the context gauge fell back to a 200k limit (a 1M-token model
16
+ showed 130%), the picker stayed on "Loading...", and the UI polled the plugin list every 25 ms. antechamber now
17
+ lists itself as the one active builtin plugin.
18
+ - Finished background subagents no longer pile up as "Subagent finished" rows at the end of the conversation. Their
19
+ reports are now kept in the message history where each child ended, and a history reload (after a compaction, for
20
+ example) no longer sends the reports of tasks that ended long before.
21
+
22
+ ## [2.0.21] - 2026-11-30
23
+
24
+ ### Changed
25
+
26
+ - OmO 5.1.89 (engine senpi 2026.11.30-2), up from 5.1.81.
27
+
10
28
  ## [2.0.20] - 2026-11-30
11
29
 
12
30
  - fix(subagents): keep background task reports where the task ended (#111)
package/dist/routes-v2.js CHANGED
@@ -14,7 +14,7 @@ import { formQuestionAnswer, questionFormID, toQuestionForm } from "./question-f
14
14
  import { getAgentName } from "./agent-name.js";
15
15
  import { vcsRead, VcsError } from "./vcs.js";
16
16
  import { announceSessionError, compactSession, unsupportedShare } from "./session-commands.js";
17
- import { defaultV2Model, flattenModels, toV2Message, toV2Session } from "./v2.js";
17
+ import { defaultV2Model, flattenModels, subagentReportMessage, toV2Message, toV2Session, } from "./v2.js";
18
18
  import { SHELL_CANCELLATION_KEY } from "./omo-shells.js";
19
19
  import { WorkStatusError } from "./work-status.js";
20
20
  import { FileWatchError } from "./file-watch.js";
@@ -252,10 +252,15 @@ export async function handleV2(services, req, res, url, path, method, directory)
252
252
  json(res, 400, errorBody("UnsupportedError", "Integration connections are not available; configure providers in OmO"));
253
253
  return;
254
254
  }
255
+ // OpenCode 2.4 lists its builtin plugins once a location has activated, and OpenChamber 2.8 reads an empty list as
256
+ // "still activating": it polls every 25 ms for 5 s and keeps an empty model catalog (location-plugins.ts
257
+ // `waitForLocationPlugins`, `plugins.length > 0`; OpenChamber 2.8.1). antechamber's catalog is ready at once, so it
258
+ // lists itself as the one active builtin. The Plugins settings page only matches configured package and local
259
+ // plugins (pluginLoadState.ts), so this entry shows nowhere.
255
260
  if ((path === "/api/plugin" && method === "GET") || (path === "/api/plugin/check" && method === "POST")) {
256
261
  if (method === "POST")
257
262
  await services.body(req);
258
- json(res, 200, withLocation([]));
263
+ json(res, 200, withLocation([{ id: "antechamber", source: { type: "builtin" }, features: {}, state: { status: "active" } }]));
259
264
  return;
260
265
  }
261
266
  if (path === "/api/plugin/update" && method === "POST") {
@@ -725,6 +730,15 @@ export async function handleV2(services, req, res, url, path, method, directory)
725
730
  if (item !== undefined)
726
731
  messagesWithTurns.push(item);
727
732
  }
733
+ // Each finished background subagent's report, where its child ended (see `subagentReportMessage`).
734
+ for (const message of history)
735
+ for (const part of message.parts) {
736
+ const report = part.type === "tool" ? subagentReportMessage(part) : undefined;
737
+ if (report === undefined)
738
+ continue;
739
+ const before = messagesWithTurns.findLastIndex((item) => item.time.created <= report.time.created);
740
+ messagesWithTurns.splice(before + 1, 0, report);
741
+ }
728
742
  let messages = messagesWithTurns;
729
743
  if (order !== "asc")
730
744
  messages = messages.reverse(); // v2 default is newest-first
package/dist/v2.d.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  * assistant message — exactly how the UI rebuilds a fetched message's `content`
22
22
  * array (index-CgR5rJq_ `Zh`).
23
23
  */
24
- import type { OCAssistantMessage, OCMessageWithParts, OCModelRef, OCSession, OCEvent } from "./types.js";
24
+ import type { OCAssistantMessage, OCMessageWithParts, OCModelRef, OCPart, OCSession, OCEvent } from "./types.js";
25
25
  interface V2Tokens {
26
26
  input: number;
27
27
  output: number;
@@ -172,6 +172,15 @@ export interface V2Message {
172
172
  tokens?: V2Tokens;
173
173
  error?: OCAssistantMessage["error"];
174
174
  }
175
+ /**
176
+ * The report as the message list holds it: OpenCode 2.x keeps a finished background subagent's report in history as
177
+ * a synthetic message at the time the child ended. OpenChamber 2.8 adds a live report it does not hold yet at the end
178
+ * of the conversation, whatever its `created` (message-ordering.ts `insertMessageInEventOrder`), so a report missing
179
+ * from the list lands below the last reply.
180
+ */
181
+ export declare function subagentReportMessage(part: Extract<OCPart, {
182
+ type: "tool";
183
+ }>): V2Message | undefined;
175
184
  export declare function toV2Message(info: OCMessageWithParts): V2Message;
176
185
  export interface V2Envelope {
177
186
  durable?: {
@@ -195,6 +204,13 @@ export interface V2Envelope {
195
204
  export declare class V2EventTranslator {
196
205
  private sessions;
197
206
  private sequences;
207
+ /**
208
+ * Per session, the background tasks this translator saw running, with the report last sent for each (its data and
209
+ * end time, as JSON; undefined until one is sent). Unlike `sessions` it outlives the turn: a history reload
210
+ * re-emits every old card, and a report sent again for a task that ended earlier is a new row at the end of the
211
+ * conversation in OpenChamber 2.8 (see `subagentReportMessage`).
212
+ */
213
+ private reports;
198
214
  translate(directory: string, ev: OCEvent): V2Envelope[];
199
215
  private onStatus;
200
216
  private onMessageUpdated;
package/dist/v2.js CHANGED
@@ -243,6 +243,15 @@ function backgroundTask(part) {
243
243
  return undefined;
244
244
  return { output: "", metadata: { ...st.metadata, status: "running", sessionID } };
245
245
  }
246
+ /** A background `task` call: its child is reported by `subagentReport` once it ends. */
247
+ function isBackgroundTask(part) {
248
+ return part.tool === "task" && part.state.status !== "pending" && part.state.input.background === true;
249
+ }
250
+ /**
251
+ * The report's id without its prefix: the live frame is `evt_<id>`, and OpenChamber 2.x files it as the message
252
+ * `msg_<id>` (events.ts `session.synthetic`), which is the id the message list gives it.
253
+ */
254
+ const subagentReportID = (part) => `subagent_${part.id}`;
246
255
  /** OpenCode 2.x's report of a finished background subagent, which OpenChamber 2.x puts on the call's row. */
247
256
  function subagentReport(part) {
248
257
  const st = part.state;
@@ -266,6 +275,26 @@ function subagentReport(part) {
266
275
  metadata: { source: "subagent", childID, state, ...(typeof agent === "string" ? { agent } : {}) },
267
276
  };
268
277
  }
278
+ /**
279
+ * The report as the message list holds it: OpenCode 2.x keeps a finished background subagent's report in history as
280
+ * a synthetic message at the time the child ended. OpenChamber 2.8 adds a live report it does not hold yet at the end
281
+ * of the conversation, whatever its `created` (message-ordering.ts `insertMessageInEventOrder`), so a report missing
282
+ * from the list lands below the last reply.
283
+ */
284
+ export function subagentReportMessage(part) {
285
+ const report = subagentReport(part);
286
+ if (report === undefined || part.state.status === "pending" || part.state.status === "running")
287
+ return undefined;
288
+ const { text, description, metadata } = report;
289
+ return {
290
+ id: `msg_${subagentReportID(part)}`,
291
+ time: { created: part.state.time.end },
292
+ type: "synthetic",
293
+ text: String(text),
294
+ ...(typeof description === "string" ? { description } : {}),
295
+ metadata: metadata,
296
+ };
297
+ }
269
298
  /**
270
299
  * A card whose call left OmO work running (background-results.ts `backgroundShellID`), as OpenCode 2.x settles a
271
300
  * call it moved to the background: completed at once with `{status: "running", shellID}` in its metadata, so
@@ -368,6 +397,13 @@ export function toV2Message(info) {
368
397
  export class V2EventTranslator {
369
398
  sessions = new Map();
370
399
  sequences = new Map();
400
+ /**
401
+ * Per session, the background tasks this translator saw running, with the report last sent for each (its data and
402
+ * end time, as JSON; undefined until one is sent). Unlike `sessions` it outlives the turn: a history reload
403
+ * re-emits every old card, and a report sent again for a task that ended earlier is a new row at the end of the
404
+ * conversation in OpenChamber 2.8 (see `subagentReportMessage`).
405
+ */
406
+ reports = new Map();
371
407
  translate(directory, ev) {
372
408
  switch (ev.type) {
373
409
  case "session.inbox.enqueued":
@@ -435,6 +471,7 @@ export class V2EventTranslator {
435
471
  case "session.deleted": {
436
472
  const info = ev.properties.info;
437
473
  this.sessions.delete(info.id);
474
+ this.reports.delete(info.id);
438
475
  return [this.frame(directory, "session.deleted", { sessionID: info.id })];
439
476
  }
440
477
  case "session.status":
@@ -742,6 +779,12 @@ export class V2EventTranslator {
742
779
  ts.called = true;
743
780
  frames.push(this.frame(directory, "session.tool.called", { ...base, input: state.input, executed: false }));
744
781
  }
782
+ let reports = this.reports.get(part.sessionID);
783
+ if (isBackgroundTask(part) && state.status === "running" && !reports?.has(part.id)) {
784
+ if (reports === undefined)
785
+ this.reports.set(part.sessionID, (reports = new Map()));
786
+ reports.set(part.id, undefined);
787
+ }
745
788
  const task = backgroundTask(part);
746
789
  if (task !== undefined) {
747
790
  if (!ts.ended) {
@@ -755,19 +798,18 @@ export class V2EventTranslator {
755
798
  }
756
799
  return frames;
757
800
  }
758
- // Every terminal background task reports, even one settled before a restart, and again when its outcome changes
759
- // (a revived task ends anew): OpenChamber 2.x drops the report of a call whose row it already shows finished,
760
- // and finishes the row from the last report it holds (subagent-run.ts `findSubagentRun`). A history reload
761
- // re-emits every old card once this state is gone (it ends with the turn), and OpenChamber 2.x makes the report
762
- // a message placed by `created` under an id taken from the envelope (events.ts `session.synthetic`). So the
763
- // report keeps the task's end time and an id of its own call: sent again, it replaces itself where the task
764
- // ended, not in a new row at the end.
801
+ // A background task this translator saw running reports when it ends, and again when its outcome changes (a
802
+ // revived task ends anew): OpenChamber 2.x finishes the row from the last report it holds (subagent-run.ts
803
+ // `findSubagentRun`). A card first seen finished (a history reload, an adapter restart) does not: its report is
804
+ // in the message list (`subagentReportMessage`), which OpenChamber 2.x reads again after a reconnect
805
+ // (event-reducer.ts `server.connected`). The frame keeps the task's end time and the list's id, so a report sent
806
+ // again replaces itself where the task ended.
765
807
  const report = subagentReport(part);
766
- if (report !== undefined && state.status !== "running") {
808
+ if (report !== undefined && state.status !== "running" && reports?.has(part.id)) {
767
809
  const reported = safeJson([report, state.time.end]);
768
- if (reported !== ts.reported) {
769
- ts.reported = reported;
770
- frames.push(this.frame(directory, "session.synthetic", report, state.time.end, `evt_subagent_${part.id}`));
810
+ if (reported !== reports.get(part.id)) {
811
+ reports.set(part.id, reported);
812
+ frames.push(this.frame(directory, "session.synthetic", report, state.time.end, `evt_${subagentReportID(part)}`));
771
813
  }
772
814
  }
773
815
  const background = backgroundShell(part);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antechamber-openchamber",
3
- "version": "2.0.20",
3
+ "version": "2.0.22",
4
4
  "description": "OpenChamber extension for antechamber: installs and pins the antechamber server and OmO, draws the OmO Graph and the OmO Work section, and titles OmO tool cards",
5
5
  "private": true,
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antechamber",
3
- "version": "2.0.20",
3
+ "version": "2.0.22",
4
4
  "description": "OpenCode-compatible HTTP/SSE server that lets OpenChamber drive the pi coding agent (and OmO) over RPC",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -88,7 +88,7 @@
88
88
  "typescript": "^7.0.2"
89
89
  },
90
90
  "dependencies": {
91
- "omo-ai": "5.1.81"
91
+ "omo-ai": "5.1.89"
92
92
  },
93
93
  "openchamber": {
94
94
  "apiVersion": 1,