@bivy/bivy 0.16.9-staging.21 → 0.16.9-staging.23

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.
@@ -639,6 +639,13 @@ export function genericStreamJsonParser() {
639
639
  const nestedUpdate = (msg.params?.update
640
640
  ?? msg.update);
641
641
  const type = String(msg.type ?? msg.method ?? nestedUpdate?.sessionUpdate ?? nestedUpdate?.type ?? "");
642
+ // Typed error frame — `{type:"error", message}` (Grok's streaming-json and
643
+ // other ACP-style CLIs), `session/error`, `turn.error`, … — as opposed to
644
+ // the `{error:{message}}` envelope handled below. Recognize it as data
645
+ // (a suffix match, no per-agent branch) so the message is surfaced as a
646
+ // real turn error instead of leaking into the transcript as assistant
647
+ // prose via the broad `message` text fallback in textFromStreamEvent.
648
+ const isErrorFrame = /(^|[._:/])error$/.test(type.toLowerCase());
642
649
  const tool = acpToolUpdate(msg);
643
650
  if (tool?.kind === "call")
644
651
  acc.addToolUse(tool.id, tool.name ?? "tool", tool.input, events);
@@ -648,7 +655,12 @@ export function genericStreamJsonParser() {
648
655
  const m = msg.error.message ?? msg.error;
649
656
  events.push({ type: "session.error", error: String(m) });
650
657
  }
651
- const text = textFromStreamEvent(msg);
658
+ else if (isErrorFrame) {
659
+ const m = msg.message ?? msg.error ?? msg.detail ?? msg.reason;
660
+ if (typeof m === "string" && m.trim())
661
+ events.push({ type: "session.error", error: m.trim() });
662
+ }
663
+ const text = isErrorFrame ? "" : textFromStreamEvent(msg);
652
664
  if (text && !STREAM_TERMINALS.has(type)) {
653
665
  acc.appendText(text, events);
654
666
  sawText = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivy/bivy",
3
- "version": "0.16.9-staging.21",
3
+ "version": "0.16.9-staging.23",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "Run coding agents on machines you own. Open-source, self-hostable agent workspace.",