Skip to content
Open
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

### Fixed
- Fixed Orca interviews cancelling during tab creation and reporting preselected recommendations as partial user responses.

## [0.13.0] - 2026-09-26

### Highlights
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