Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed
- Fixed generating options, rewriting a question, and asking about an option failing on OpenCode Go models with `400 MissingSessionID`. These requests now send the current session ID, which OpenCode requires. Needs Pi 0.86 or later. Fixes #29.
- Fixed Orca interviews cancelling during tab creation and reporting preselected recommendations as partial user responses. Thanks to [@w-winter](https://github.com/w-winter) for #26.

## [0.13.0] - 2026-09-26

Expand Down
27 changes: 25 additions & 2 deletions index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe("openOrcaUrl", () => {
const url = "http://127.0.0.1:1234/interview";
const cwd = "/Users/example/project";

it("creates and focuses an Orca browser tab in the current worktree", async () => {
it("creates a blank Orca tab before navigating to the interview", async () => {
const calls: { command: string; args: string[]; cwd: string | undefined; timeout: number | undefined }[] = [];

await openOrcaUrl(
Expand All @@ -157,7 +157,7 @@ describe("openOrcaUrl", () => {
expect(calls).toEqual([
{
command: "orca",
args: ["tab", "create", "--url", url, "--json"],
args: ["tab", "create", "--url", "about:blank", "--json"],
cwd,
timeout: 60_000,
},
Expand All @@ -167,6 +167,12 @@ describe("openOrcaUrl", () => {
cwd,
timeout: undefined,
},
{
command: "orca",
args: ["goto", "--page", "page-123", "--url", url],
cwd,
timeout: undefined,
},
]);
});

Expand Down Expand Up @@ -205,6 +211,23 @@ describe("openOrcaUrl", () => {
cwd,
)).rejects.toThrow("orca tab switch: exit code 1: worktree unavailable");
});

it("rejects when interview navigation fails", async () => {
await expect(openOrcaUrl(
{
exec: async (_command, args) => args[0] === "goto"
? { stdout: "", stderr: "navigation failed", code: 1, killed: false }
: {
stdout: JSON.stringify({ result: { browserPageId: "page-123" } }),
stderr: "",
code: 0,
killed: false,
},
},
url,
cwd,
)).rejects.toThrow("orca goto: exit code 1: navigation failed");
});
});

describe("shouldAttemptGlimpse", () => {
Expand Down
10 changes: 9 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ export async function openOrcaUrl(
url: string,
cwd: string,
): Promise<void> {
// Orca may reload a tab's initial URL during creation, which cancels an interview.
const createResult = await pi.exec(
"orca",
["tab", "create", "--url", url, "--json"],
["tab", "create", "--url", "about:blank", "--json"],
{ timeout: 60_000, cwd },
);
assertExecSucceeded("orca tab create", createResult);
Expand Down Expand Up @@ -196,6 +197,13 @@ export async function openOrcaUrl(
{ cwd },
);
assertExecSucceeded("orca tab switch", switchResult);

const navigateResult = await pi.exec(
"orca",
["goto", "--page", browserPageId, "--url", url],
{ cwd },
);
assertExecSucceeded("orca goto", navigateResult);
}

export async function openLinuxUrl(
Expand Down
Loading