antechamber 2.0.10 → 2.0.12

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,22 @@ and this project uses [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.12] - 2026-11-22
11
+
12
+ ### Fixed
13
+
14
+ - Reverting a message while the agent is still working now reverts the conversation. OpenChamber stops the turn
15
+ and stages the revert right away; the adapter answered the stop before OmO had stopped, so the revert was refused
16
+ as "Session is busy" and the next prompt still ran on the old history.
17
+
18
+ ## [2.0.11] - 2026-11-20
19
+
20
+ ### Fixed
21
+
22
+ - A background task (`run_in_background`) no longer shows as "Interrupted" in OpenChamber while it is still
23
+ running. It reaches OpenChamber as OpenCode's background subagent, so its row stays running, labelled in
24
+ background, while the child works, and shows the child's result when it finishes.
25
+
10
26
  ## [2.0.10] - 2026-11-20
11
27
 
12
28
  ### Fixed
package/dist/routes-v2.js CHANGED
@@ -162,6 +162,8 @@ async function handleV2Bootstrap(services, res, url, path, method, directory) {
162
162
  }
163
163
  return false;
164
164
  }
165
+ /** OpenChamber's subagent stop note (subagent-run.ts `subagentCancellationNote`). */
166
+ const SUBAGENT_CANCELLATION_KEY = "openchamberSubagentCancellation";
165
167
  /** Shell ids named by OpenChamber's stop note (background-shell.ts `shellCancellationNote`). */
166
168
  function cancelledShells(metadata) {
167
169
  const note = metadata?.[SHELL_CANCELLATION_KEY];
@@ -913,6 +915,12 @@ export async function handleV2(services, req, res, url, path, method, directory)
913
915
  json(res, 400, errorBody("UnsupportedError", `OmO cannot stop ${unstoppable.join(", ")}: only eval cells can be stopped`));
914
916
  return;
915
917
  }
918
+ // OpenChamber's subagent stop sends this note, then interrupts the child (client.ts `stopSubagent`,
919
+ // 2.5.3). An OmO task child has no RPC to stop it, so refuse the note: the agent is never told of a stop.
920
+ if (metadata?.[SUBAGENT_CANCELLATION_KEY] !== undefined) {
921
+ json(res, 400, errorBody("UnsupportedError", "OmO cannot stop a subagent from OpenChamber"));
922
+ return;
923
+ }
916
924
  const messageID = typeof body.id === "string" && body.id !== "" ? body.id : `msg_${randomUUID().replaceAll("-", "")}`;
917
925
  const text = body.text;
918
926
  if (body.description !== undefined && typeof body.description !== "string")
package/dist/sessions.js CHANGED
@@ -913,7 +913,9 @@ export class SessionManager {
913
913
  if (s.status.type !== "idle")
914
914
  s.interruptRequested = true;
915
915
  try {
916
- const response = await s.pi.command({ type: "abort" });
916
+ // OmO answers a plain abort before the turn stops; OpenChamber stages a revert (or forks) as soon as the
917
+ // interrupt answers, so wait for agent_idle (sent ahead of this answer) up to OmO's default grace.
918
+ const response = await s.pi.command({ type: "abort", awaitIdle: true });
917
919
  if (!response.success)
918
920
  throw new Error(response.error ?? "pi abort failed");
919
921
  }
package/dist/subagents.js CHANGED
@@ -54,6 +54,8 @@ toolMappers.task = (args, result) => {
54
54
  description: args.task_summary ?? args.name ?? args.description,
55
55
  prompt: args.prompt,
56
56
  subagent_type: args.subagent_type ?? args.category,
57
+ // OpenCode 2.x's own flag for a delegated call that returns at once (v2.ts `backgroundTask`).
58
+ ...(args.run_in_background === true ? { background: true } : {}),
57
59
  };
58
60
  const details = record(result?.details) ? result.details : {};
59
61
  return {
package/dist/v2.js CHANGED
@@ -189,9 +189,52 @@ export function toV2AssistantMessage(info) {
189
189
  msg.error = i.error;
190
190
  return msg;
191
191
  }
192
- /** OpenCode 2.x renamed `bash` to `shell`; OpenChamber 2.x draws a shell card (command, live output) only for `shell`. */
193
- function v2ToolName(tool) {
194
- return tool === "bash" ? "shell" : tool;
192
+ /**
193
+ * OpenCode 2.x renamed `bash` to `shell`; OpenChamber 2.x draws a shell card (command, live output) only for `shell`.
194
+ * A background `task` is OpenCode's background `subagent` call, the only call OpenChamber 2.x follows past its step.
195
+ */
196
+ function v2ToolName(part) {
197
+ if (part.tool === "task" && part.state.status !== "pending" && part.state.input.background === true)
198
+ return "subagent";
199
+ return part.tool === "bash" ? "shell" : part.tool;
200
+ }
201
+ /**
202
+ * A background task whose call returned while the child still runs. pi completes the step before the child ends, and
203
+ * OpenChamber 2.x marks a running tool under a completed message "Interrupted". OpenCode 2.x settles such a call at
204
+ * once with `{status: "running", sessionID}` in its metadata, and OpenChamber 2.x draws the row from the child
205
+ * session's status, then from its report (`session.synthetic`, see `subagentReport`).
206
+ */
207
+ function backgroundTask(part) {
208
+ const st = part.state;
209
+ if (part.tool !== "task" || st.status !== "running" || st.input.background !== true)
210
+ return undefined;
211
+ const sessionID = st.metadata?.sessionID;
212
+ if (typeof sessionID !== "string")
213
+ return undefined;
214
+ return { output: "", metadata: { ...st.metadata, status: "running", sessionID } };
215
+ }
216
+ /** OpenCode 2.x's report of a finished background subagent, which OpenChamber 2.x puts on the call's row. */
217
+ function subagentReport(part) {
218
+ const st = part.state;
219
+ if (part.tool !== "task" || st.input.background !== true)
220
+ return undefined;
221
+ if (st.status !== "completed" && st.status !== "error")
222
+ return undefined;
223
+ const childID = st.metadata?.sessionID;
224
+ if (typeof childID !== "string")
225
+ return undefined;
226
+ const task = st.metadata?.task;
227
+ const cancelled = task !== null && typeof task === "object" && "status" in task && /^cancel/.test(String(task.status));
228
+ const state = st.status === "completed" ? "completed" : cancelled ? "cancelled" : "error";
229
+ const text = st.status === "completed" ? st.output : st.error;
230
+ const description = st.input.description;
231
+ const agent = st.input.subagent_type;
232
+ return {
233
+ sessionID: part.sessionID,
234
+ text: `<subagent sessionID="${childID}" state="${state}">\n${text}\n</subagent>`,
235
+ ...(typeof description === "string" ? { description } : {}),
236
+ metadata: { source: "subagent", childID, state, ...(typeof agent === "string" ? { agent } : {}) },
237
+ };
195
238
  }
196
239
  /**
197
240
  * A card whose call left OmO work running (background-results.ts `backgroundShellID`), as OpenCode 2.x settles a
@@ -224,7 +267,7 @@ function v2ToolId(part) {
224
267
  }
225
268
  function toolContent(part) {
226
269
  const st = part.state;
227
- const name = v2ToolName(part.tool);
270
+ const name = v2ToolName(part);
228
271
  const start = st.status === "pending" ? undefined : st.time.start;
229
272
  const end = st.status === "pending" || st.status === "running" ? undefined : st.time.end;
230
273
  const id = v2ToolId(part);
@@ -241,7 +284,7 @@ function toolContent(part) {
241
284
  ...(end !== undefined ? { completed: end } : {}),
242
285
  },
243
286
  };
244
- const background = st.status === "running" ? backgroundShell(part) : undefined;
287
+ const background = st.status === "running" ? (backgroundShell(part) ?? backgroundTask(part)) : undefined;
245
288
  if (st.status === "pending") {
246
289
  base.state = { status: "streaming", input: st.raw ?? "", metadata: {} };
247
290
  }
@@ -619,7 +662,7 @@ export class V2EventTranslator {
619
662
  }
620
663
  onToolPart(directory, part) {
621
664
  const st = this.state(part.sessionID);
622
- const name = v2ToolName(part.tool);
665
+ const name = v2ToolName(part);
623
666
  let ts = st.tools.get(part.id);
624
667
  if (!ts) {
625
668
  ts = {
@@ -669,6 +712,26 @@ export class V2EventTranslator {
669
712
  ts.called = true;
670
713
  frames.push(this.frame(directory, "session.tool.called", { ...base, input: state.input, executed: false }));
671
714
  }
715
+ const task = backgroundTask(part);
716
+ if (task !== undefined) {
717
+ if (!ts.ended) {
718
+ ts.ended = true;
719
+ frames.push(this.frame(directory, "session.tool.success", {
720
+ ...base,
721
+ content: [],
722
+ metadata: task.metadata,
723
+ executed: false,
724
+ }));
725
+ }
726
+ return frames;
727
+ }
728
+ // Every terminal background task reports once, even one settled before a restart: OpenChamber 2.x drops the
729
+ // report of a call whose row it already shows finished.
730
+ const report = subagentReport(part);
731
+ if (report !== undefined && !ts.reported) {
732
+ ts.reported = true;
733
+ frames.push(this.frame(directory, "session.synthetic", report));
734
+ }
672
735
  const background = backgroundShell(part);
673
736
  if (background !== undefined) {
674
737
  if (!ts.ended) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antechamber-openchamber",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
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.10",
3
+ "version": "2.0.12",
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",