@bivy/bivy 0.16.25-staging.20 → 0.16.25-staging.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/bin/acp-shim.mjs +7 -0
- package/bin/codex-app-server-shim.mjs +10 -0
- package/dist/worktree.js +9 -1
- package/package.json +1 -1
package/bin/acp-shim.mjs
CHANGED
|
@@ -313,6 +313,13 @@ function onSessionUpdate(params) {
|
|
|
313
313
|
if (!content) return "";
|
|
314
314
|
if (typeof content === "string") return content;
|
|
315
315
|
if (Array.isArray(content)) return content.map(textOf).join("");
|
|
316
|
+
// ACP's ToolCallContent wraps a ContentBlock: `{ type: "content", content:
|
|
317
|
+
// { type: "text", text } }`. Unwrap it (recursively) so a tool's real output
|
|
318
|
+
// — a command's stdout, a fetched document, a read's text — isn't dropped,
|
|
319
|
+
// which collapsed the tool_result to the bare status ("completed"). opencode
|
|
320
|
+
// and most spec-compliant ACP agents deliver tool output in this wrapped
|
|
321
|
+
// shape, so reading only the bare `{type:"text"}` form lost it in production.
|
|
322
|
+
if (content.type === "content" && content.content != null) return textOf(content.content);
|
|
316
323
|
if (content.type === "text" && typeof content.text === "string") return content.text;
|
|
317
324
|
if (typeof content.text === "string") return content.text;
|
|
318
325
|
return "";
|
|
@@ -415,6 +415,16 @@ function onNotification(m) {
|
|
|
415
415
|
bivy({ type: "session.status", status: "working" });
|
|
416
416
|
return;
|
|
417
417
|
case "turn/completed": {
|
|
418
|
+
// The completion event is authoritative about a terminal failure: a turn
|
|
419
|
+
// that hit a usage limit (or any provider error) arrives here as
|
|
420
|
+
// `status: "failed"` carrying `turn.error`. Capture it directly instead of
|
|
421
|
+
// depending on a separate `error` notification landing first — otherwise a
|
|
422
|
+
// completion that omits that notification seals as session.done and the
|
|
423
|
+
// user sees a silent empty turn (fail loud, never swallow the error).
|
|
424
|
+
const turnError =
|
|
425
|
+
params?.turn?.error?.message ||
|
|
426
|
+
(params?.turn?.status === "failed" ? params?.error?.message || params?.message || "Codex turn failed" : undefined);
|
|
427
|
+
if (turnError && !sawError) sawError = turnError;
|
|
418
428
|
// Codex 0.147 can publish turn/completed just before the final
|
|
419
429
|
// collabAgentToolCall item/completed notification. Sealing immediately
|
|
420
430
|
// leaves the sub-agent card running forever and drops its persisted
|
package/dist/worktree.js
CHANGED
|
@@ -94,7 +94,15 @@ export async function createWorktree(opts) {
|
|
|
94
94
|
else if (base !== "HEAD" && !(await refExists(repoRoot, base)))
|
|
95
95
|
base = "HEAD";
|
|
96
96
|
// Fail closed on path collisions; never delete an unrelated directory.
|
|
97
|
-
|
|
97
|
+
if (base === "HEAD" && !(await refExists(repoRoot, "HEAD"))) {
|
|
98
|
+
// Empty repo (e.g. a freshly created GitHub repo with no commits): HEAD is
|
|
99
|
+
// unborn, so it can't seed a worktree. Start the branch as an orphan —
|
|
100
|
+
// the session's first commit becomes the repo's root commit.
|
|
101
|
+
await exec("git", ["-C", repoRoot, "worktree", "add", "--orphan", "-b", branch, wtPath]);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
await exec("git", ["-C", repoRoot, "worktree", "add", "-b", branch, wtPath, base]);
|
|
105
|
+
}
|
|
98
106
|
}
|
|
99
107
|
// Opportunistically reuse a sibling worktree's installed deps (node_modules,
|
|
100
108
|
// target, .venv) via copy-on-write when the filesystem supports it, so a
|
package/package.json
CHANGED