From 196a5ee9226508da4d698e9af980505f0be96aa5 Mon Sep 17 00:00:00 2001 From: Dax Date: Thu, 12 Nov 2026 08:54:05 -0500 Subject: [PATCH 01/13] chore: only require code owner review for .github (#63543) --- .github/CODEOWNERS | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ae0205d60da1..a3f533d5cb31 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,11 +1,3 @@ -# web + desktop packages -packages/app/ @Hona @Brendonovich -packages/desktop/ @Hona @Brendonovich - -# GUI plugin SDK -# changes here must be meticulous - pls chat first :) -packages/plugin/src/gui/ @Hona - # CI and releases. Release jobs that hold secrets run only .github/workflows/release.yml and .github/release/, -# which makes this path the release security boundary. +# which makes this path the release security boundary. It is the only path that needs a code owner review. /.github/ @thdxr From 98def2f90e8596d0734929b9273defe33f74ba74 Mon Sep 17 00:00:00 2001 From: James Long Date: Thu, 12 Nov 2026 08:08:25 -0600 Subject: [PATCH 02/13] test(app): update e2e specs for always-background subagents (#63538) --- .../e2e/regression/timeline-geometry.spec.ts | 10 +- .../e2e/regression/timeline-stream.spec.ts | 217 +++++++----------- 2 files changed, 89 insertions(+), 138 deletions(-) diff --git a/packages/app/e2e/regression/timeline-geometry.spec.ts b/packages/app/e2e/regression/timeline-geometry.spec.ts index 4e19574c8ec2..cbc41f76b774 100644 --- a/packages/app/e2e/regression/timeline-geometry.spec.ts +++ b/packages/app/e2e/regression/timeline-geometry.spec.ts @@ -767,16 +767,16 @@ async function scrollsBehindComposerRegion( content: [ { type: "tool", - id: "call_running_subagent", - name: "subagent", + id: "call_blocking_shell", + name: "shell", state: { status: "running", - input: { description: "Trace frame budget", agent: "explore" }, - metadata: { sessionID: "ses_running_subagent" }, + input: { command: "bun test" }, + metadata: {}, }, time: { created: 2 }, }, - { type: "text", id: "prt_timeline_end", text: "The last answer ends above the composer region." }, + { type: "text", text: "The last answer ends above the composer region." }, ], time: { created: 2 }, }, diff --git a/packages/app/e2e/regression/timeline-stream.spec.ts b/packages/app/e2e/regression/timeline-stream.spec.ts index fa7e6cc4108b..38b128fb4309 100644 --- a/packages/app/e2e/regression/timeline-stream.spec.ts +++ b/packages/app/e2e/regression/timeline-stream.spec.ts @@ -705,45 +705,6 @@ test("holds undelivered input still while live status above it comes and goes", await expect.poll(lane).toBe(36) }) -test("jumps from a finished shell's notice to its call", async ({ page }) => { - await setupTimeline(page, { - settings: { timelineDetail: detailed }, - sessionMessages: [ - userMessage(), - assistantMessage([ - ...searches(0, 2), - toolPart( - "prt_notice_shell", - "shell", - "completed", - { command: "bun serve.ts" }, - { output: "listening", metadata: { shellID: "shell_notice" } }, - ), - ...searches(2, 2), - textPart("prt_notice_notes", notes("Later", 80)), - ]), - { - id: "msg_shell_finished", - type: "synthetic", - text: '\nlistening\n', - description: "bun serve.ts", - metadata: { source: "shell", shellID: "shell_notice", state: "completed" }, - time: { created: 1700000003000 }, - }, - ], - }) - - const notice = page.getByRole("button", { name: /^Shell finished/ }) - const shellTrigger = page.locator('[data-timeline-part-id="prt_notice_shell"] [data-slot="collapsible-trigger"]') - - await expect(notice).toBeInViewport() - await expect(shellTrigger).toHaveCount(0) - await notice.click() - - await expect(shellTrigger).toHaveAttribute("aria-expanded", "true") - await expect(shellTrigger).toBeInViewport() -}) - test.describe("Working", () => { test("shows Working between busy and reasoning states", async ({ page }) => { const timeline = await setupTimeline(page, { @@ -1039,7 +1000,7 @@ test("grows a streaming row without a ResizeObserver loop error", async ({ page expect(await page.evaluate(() => document.documentElement.dataset.resizeObserverLoops)).toBeUndefined() }) -test.describe("background shortcut", () => { +test.describe("background work", () => { test("does not offer a running subagent to the background", async ({ page }) => { await setupTimeline(page, { settings: { timelineDetail: { ...detailed, subagents: { placement: "separate" } } }, @@ -1177,7 +1138,7 @@ test.describe("background shortcut", () => { }) => { const childID = "ses_background_stale_call" - // As after a lost completion notice: the call still reads running, while the child session has finished. + // The call records the launch; the child can finish without changing that metadata. const timeline = await setupTimeline(page, { settings: { timelineDetail: detailed }, sessionMessages: [ @@ -1194,7 +1155,7 @@ test.describe("background shortcut", () => { name: "subagent", state: { status: "completed", - input: { description: "Stale task", agent: "explore", background: true }, + input: { description: "Stale task", agent: "explore" }, content: [{ type: "text", text: "working" }], metadata: { sessionID: childID, status: "running" }, }, @@ -1209,7 +1170,9 @@ test.describe("background shortcut", () => { const capsule = page.locator('[data-slot="session-activity-chip"]') - await expect(page.locator('[data-timeline-part-id="call_stale"]')).toContainText("Stale task (background)") + await expect( + page.locator('[data-timeline-part-id="call_stale"]').getByText("Stale task", { exact: true }), + ).toBeVisible() await expect(capsule).toHaveCount(0) await timeline.transport.send(status("busy", 1, childID)) await expect(page.getByRole("button", { name: "1 subagent", exact: true })).toBeVisible() @@ -1217,9 +1180,8 @@ test.describe("background shortcut", () => { await expect(capsule).toHaveCount(0) }) - test("separates blocking and already-backgrounded work into two rows", async ({ page }) => { + test("shows the shortcut for a blocking shell and lists background work in the capsule", async ({ page }) => { const backgroundID = "ses_background_existing" - const blockingID = "ses_background_blocking" const timeline = await setupTimeline(page, { settings: { timelineDetail: detailed }, @@ -1233,25 +1195,25 @@ test.describe("background shortcut", () => { content: [ { type: "tool", - id: "call_backgrounded", - name: "subagent", + id: "call_shell_backgrounded", + name: "shell", state: { status: "completed", - input: { description: "Background task", agent: "explore" }, + input: { command: "sleep 120" }, content: [{ type: "text", text: "working" }], - metadata: { sessionID: backgroundID, status: "running" }, + metadata: { shellID: "shell_backgrounded", status: "running" }, }, time: { created: 2, completed: 3 }, }, { type: "tool", - id: "call_shell_backgrounded", - name: "shell", + id: "call_backgrounded", + name: "subagent", state: { status: "completed", - input: { command: "sleep 120" }, + input: { description: "Background task", agent: "explore" }, content: [{ type: "text", text: "working" }], - metadata: { shellID: "shell_backgrounded", status: "running" }, + metadata: { sessionID: backgroundID, status: "running" }, }, time: { created: 2, completed: 3 }, }, @@ -1267,12 +1229,8 @@ test.describe("background shortcut", () => { { type: "tool", id: "call_blocking", - name: "subagent", - state: { - status: "running", - input: { description: "Foreground task", agent: "build" }, - metadata: { sessionID: blockingID }, - }, + name: "shell", + state: { status: "running", input: { command: "sleep 10" }, metadata: { shellID: "shell_blocking" } }, time: { created: 4 }, }, ], @@ -1282,39 +1240,28 @@ test.describe("background shortcut", () => { sessions: [ session(), session({ id: backgroundID, parentID: sessionID, title: "Background task", agent: "explore" }), - session({ id: blockingID, parentID: sessionID, title: "Foreground task", agent: "build" }), ], sessionStatus: { [sessionID]: { type: "busy" }, [backgroundID]: { type: "busy" }, - [blockingID]: { type: "busy" }, }, + shellCommands: [ + { id: "shell_backgrounded", command: "sleep 120" }, + { id: "shell_blocking", command: "sleep 10" }, + ].map((shell) => ({ + ...shell, + status: "running" as const, + cwd: directory, + shell: "bash", + file: `/tmp/${shell.id}.out`, + metadata: { sessionID }, + time: { started: 2 }, + })), }) - await timeline.transport.send({ - id: "evt_background_shell_created", - created: 3, - type: "shell.created", - location: { directory }, - data: { - info: { - id: "shell_backgrounded", - status: "running", - command: "sleep 120", - cwd: directory, - shell: "bash", - file: "/tmp/background.out", - metadata: { sessionID }, - time: { started: 2 }, - }, - }, - }) const backgroundCard = page.locator('[data-timeline-part-id="call_backgrounded"]') - const blockingCard = page.locator('[data-timeline-part-id="call_blocking"]') await expect(backgroundHint(page)).toBeVisible() - await expect(backgroundCard).toContainText("Background task (background)") - await expect(blockingCard).toContainText("Foreground task") - await expect(blockingCard).not.toContainText("(background)") + await expect(backgroundCard).toContainText("Background task") const used = page .locator('[data-timeline-part-ids="call_shell_backgrounded"]') @@ -1322,18 +1269,18 @@ test.describe("background shortcut", () => { await expect(used).toHaveText(/^Used\s*1\s*Shell$/) await expect(used).toHaveAttribute("aria-expanded", "false") - const activity = page.getByRole("button", { name: "2 subagents · 1 shell", exact: true }) - const list = page.getByRole("menu", { name: "2 subagents · 1 shell", exact: true }) + const summary = "1 subagent · 1 shell" + const list = page.getByRole("menu", { name: summary, exact: true }) // The open menu hides the rest of the page from the accessibility tree, the capsule included. - const capsule = page.getByRole("button", { name: "2 subagents · 1 shell", exact: true, includeHidden: true }) - const label = capsule.getByText("2 subagents · 1 shell", { exact: true }) + const capsule = page.getByRole("button", { name: summary, exact: true, includeHidden: true }) + const label = capsule.getByText(summary, { exact: true }) const glyph = await capsule.locator('[data-component="session-progress-indicator-v2"]').boundingBox() const text = await label.boundingBox() const inset = glyph!.x - (await capsule.boundingBox())!.x - await activity.click() + await capsule.click() await expect(list.locator('[data-slot="menu-v2-group-label"], [data-slot="menu-v2-separator"]')).toHaveCount(0) - await expect(list.getByText("2 subagents · 1 shell", { exact: true })).toHaveCount(0) + await expect(list.getByText(summary, { exact: true })).toHaveCount(0) await expect(label).toBeVisible() // The panel opens above the capsule on its grid: row glyphs on the capsule's glyph, names and commands on its @@ -1357,7 +1304,7 @@ test.describe("background shortcut", () => { return ( panel!.y + panel!.height <= anchor!.y && - rows.length === 3 && + rows.length === 2 && rows.every( ([left, start, end]) => Math.abs(left - glyph!.x) < 0.5 && @@ -1369,7 +1316,6 @@ test.describe("background shortcut", () => { .toBe(true) await expect(list.getByRole("menuitem")).toHaveText([ // The fixture starts every task near the epoch, so each row ends with an hours-long run time. - /^Build\s*Foreground task\d+h \d{2}m$/, /^Explore\s*Background task\d+h \d{2}m$/, /^sleep 120\d+h \d{2}m$/, ]) @@ -1381,13 +1327,13 @@ test.describe("background shortcut", () => { const interrupt = page.waitForRequest( (request) => - request.method() === "POST" && new URL(request.url()).pathname === `/api/session/${blockingID}/interrupt`, + request.method() === "POST" && new URL(request.url()).pathname === `/api/session/${backgroundID}/interrupt`, ) - const foreground = list.getByRole("menuitem", { name: /Foreground task/ }) + const subagent = list.getByRole("menuitem", { name: /Background task/ }) - await foreground.hover() - await foreground.getByRole("button", { name: "Interrupt subagent", exact: true }).click() + await subagent.hover() + await subagent.getByRole("button", { name: "Interrupt subagent", exact: true }).click() await interrupt await expect(list).toBeVisible() @@ -1410,50 +1356,56 @@ test.describe("background shortcut", () => { expect(kill.requests).toHaveLength(1) await page.keyboard.press("Escape") await expect(list).toHaveCount(0) - await expect(backgroundCard).toContainText("Background task (background)") await expect(backgroundCard.locator('[data-component="session-progress-indicator-v2"]')).toBeVisible() await used.click() await expect( page.locator('[data-timeline-part-id="call_shell_backgrounded"] [data-component="text-shimmer"]'), ).toHaveAttribute("data-active", "true") - // SAFETY: the transport forwards this payload unchanged, and the client marks a session idle from - // `type` and `data.sessionID` alone; the child session's event needs no durable metadata here. - await timeline.transport.send({ - id: "evt_background_succeeded", - created: Date.now(), - type: "session.execution.succeeded", - data: { sessionID: backgroundID }, - } as never) + await timeline.send(status("idle", 1, backgroundID)) await expect(backgroundCard.locator('[data-component="session-progress-indicator-v2"]')).toHaveCount(0) - await expect(backgroundCard).toContainText("Background task (background)") + await expect(backgroundCard).toContainText("Background task") }) for (const fixture of [ { name: "from far below", before: 40, searches: 40, after: 80 }, // The collapsed timeline fits the viewport, so it only becomes scrollable once the group opens. - { name: "that opens the last row", before: 0, searches: 40, after: 0 }, + { name: "in an initially unscrollable timeline", before: 0, searches: 40, after: 0 }, // Reaching the shell lands on the end of the timeline, which would otherwise follow new content again. { name: "at the end of the timeline", before: 40, searches: 0, after: 0 }, ]) { - // A starting subagent call is the pill's row that reveals its call; grouping subagents puts it inside the group. - test(`holds a revealed call ${fixture.name} just under its stuck group header`, async ({ page }) => { + test(`holds the call revealed by a shell notice ${fixture.name} just under its stuck group header`, async ({ + page, + }) => { const timeline = await setupTimeline(page, { - settings: { timelineDetail: { ...detailed, subagents: { placement: "grouped" } } }, - sessionStatus: { [sessionID]: { type: "busy" } }, - messages: [ + settings: { timelineDetail: detailed }, + sessionMessages: [ userMessage(), - assistantMessage( - [ - ...(fixture.before ? [textPart("prt_earlier", notes("Earlier", fixture.before))] : []), - ...searches(0, 42 - fixture.searches), - toolPart("prt_far_call", "subagent", "running", { description: "Map the far code", agent: "explore" }), - // The open group outgrows the viewport, so aligning the group instead of the call misses it. - ...searches(42 - fixture.searches, fixture.searches), - ...(fixture.after ? [textPart("prt_follow_up", notes("Follow-up", fixture.after))] : []), - ], - { completed: false }, - ), + assistantMessage([ + ...(fixture.before ? [textPart("prt_earlier", notes("Earlier", fixture.before))] : []), + ...searches(0, 42 - fixture.searches), + toolPart( + "prt_far_call", + "shell", + "completed", + { command: "bun serve.ts" }, + { + output: "listening", + metadata: { shellID: "shell_notice", status: "running" }, + }, + ), + // The open group outgrows the viewport, so aligning the group instead of the call misses it. + ...searches(42 - fixture.searches, fixture.searches), + ...(fixture.after ? [textPart("prt_follow_up", notes("Follow-up", fixture.after))] : []), + ]), + { + id: "msg_1002_shell_finished", + type: "synthetic", + text: '\nlistening\n', + description: "bun serve.ts", + metadata: { source: "shell", shellID: "shell_notice", state: "completed" }, + time: { created: 1700000003000 }, + }, ], }) @@ -1472,26 +1424,25 @@ test.describe("background shortcut", () => { }) .toBe(0) - await expect( - fixture.after ? page.getByText(`Follow-up note ${fixture.after}.`, { exact: true }) : group, - ).toBeInViewport() + const notice = page.getByRole("button", { name: /^Shell finished/ }) + await expect(notice).toBeInViewport() await expect(call).toHaveCount(0) - await page.getByRole("button", { name: "1 subagent", exact: true }).click() - await page - .getByRole("menu", { name: "1 subagent", exact: true }) - .getByRole("menuitem", { name: /Map the far code/ }) - .click() + await notice.click() await expect(group).toHaveAttribute("aria-expanded", "true") - await expect(call).toBeInViewport() + const trigger = call.locator('[data-slot="collapsible-trigger"]') + await expect(trigger).toHaveAttribute("aria-expanded", "true") + await expect(trigger).toBeInViewport() // A call at the very end cannot rise under the header until more content arrives below it. if (fixture.searches) await aligned() // Nothing covers the row, so it takes the next click. - await call.click({ trial: true }) + await trigger.click({ trial: true }) // The agent keeps writing below the call; the call stays where it was revealed. - await timeline.send(partUpdated(textPart("prt_late", notes("Late", 30)))) + const late = assistantMessage([], { id: "msg_1003_late", completed: false, created: 1700000004000 }) + await timeline.send(stepStarted(late)) + await timeline.send(partUpdated({ id: "prt_late", messageID: late.id, type: "text", text: notes("Late", 30) })) await expect(page.getByText("Late note 30.", { exact: true })).toBeAttached() await aligned() }) From 1c53e40a7fafc417a1aef03b8569f176c062e30d Mon Sep 17 00:00:00 2001 From: usrnk1 <7547651+usrnk1@users.noreply.github.com> Date: Thu, 12 Nov 2026 15:37:30 +0100 Subject: [PATCH 03/13] feat(app): choose each server's terminal shell from its menu (#63539) --- .../app/src/servers/registry/row-menu.tsx | 53 ++++++++++++++++++- packages/app/src/settings/general/general.tsx | 8 +-- packages/app/src/settings/servers/servers.tsx | 38 ++++++++----- 3 files changed, 80 insertions(+), 19 deletions(-) diff --git a/packages/app/src/servers/registry/row-menu.tsx b/packages/app/src/servers/registry/row-menu.tsx index e8b01f57d4bd..99df529f9f68 100644 --- a/packages/app/src/servers/registry/row-menu.tsx +++ b/packages/app/src/servers/registry/row-menu.tsx @@ -1,15 +1,19 @@ import { Icon } from "@opencode/ui/icon" import { IconButton } from "@opencode/ui/icon-button" import { Menu } from "@opencode/ui/menu" -import { type Component, Show } from "solid-js" +import { type Component, createMemo, For, Show } from "solid-js" import type { ServerActionsController } from "@/servers/registry/controller" import { useLanguage } from "@/runtime/i18n/language" import { ServerConnection } from "@/runtime/server/registry" +import { createShellOptions } from "@/settings/general/behavior" +import type { ShellSettingsController } from "@/settings/general/controllers" export const ServerRowMenu: Component<{ server: ServerConnection.Any domain: ServerActionsController onEdit: (server: ServerConnection.Http) => void + shell?: ShellSettingsController + action?: string open?: boolean onOpenChange?: (open: boolean) => void }> = (props) => { @@ -23,6 +27,8 @@ export const ServerRowMenu: Component<{ canRemove={props.domain.connection.canRemove(key)} canHide={props.domain.connection.canHide(key)} hidden={props.domain.connection.isHidden(key)} + shell={props.shell} + action={props.action} onEdit={props.onEdit} onRemove={() => props.domain.connection.remove(key)} onHide={() => props.domain.connection.setHidden(key, true)} @@ -41,6 +47,9 @@ export function serverMenuLabels(language: ReturnType) { remove: language.t("dialog.server.menu.remove"), hide: language.t("dialog.server.menu.hide"), show: language.t("dialog.server.menu.show"), + shell: language.t("settings.general.row.shell.title"), + shellAuto: language.t("settings.general.row.shell.autoDefault"), + shellTerminalOnly: language.t("settings.general.row.shell.terminalOnly"), } } @@ -50,6 +59,8 @@ export const ServerRowMenuView: Component<{ canRemove: boolean canHide?: boolean hidden?: boolean + shell?: ShellSettingsController + action?: string onEdit: (server: ServerConnection.Http) => void onRemove: () => void onHide?: () => void @@ -68,6 +79,7 @@ export const ServerRowMenuView: Component<{ size="small" icon={} aria-label={props.labels.more} + data-action={props.action} /> @@ -83,6 +95,7 @@ export const ServerRowMenuView: Component<{ > {props.labels.edit} + {(shell) => } {props.labels.show} @@ -99,3 +112,41 @@ export const ServerRowMenuView: Component<{ ) } + +function ShellSubmenu(props: { shell: ShellSettingsController; labels: ReturnType }) { + const options = createMemo(() => + createShellOptions({ shells: props.shell.shells(), current: props.shell.current() }), + ) + + const current = () => options().find((option) => option.value === props.shell.current())?.id ?? "auto" + + return ( + + {props.labels.shell} + + + { + const option = options().find((item) => item.id === id) + + if (option) props.shell.select(option.value) + }} + > + + {(option) => ( + + {option.id === "auto" + ? props.labels.shellAuto + : option.terminalOnly + ? `${option.name} (${props.labels.shellTerminalOnly})` + : option.name} + + )} + + + + + + ) +} diff --git a/packages/app/src/settings/general/general.tsx b/packages/app/src/settings/general/general.tsx index e5b72a2ea81d..d0631eeca24d 100644 --- a/packages/app/src/settings/general/general.tsx +++ b/packages/app/src/settings/general/general.tsx @@ -69,11 +69,7 @@ const WorkspaceDestinationSetting: Component = () => { ) } -export const ShellSetting: Component<{ - controller: ShellSettingsController - /** Search reveals the row with the default action; the Servers page names the other servers' rows apart. */ - action?: string -}> = (props) => { +export const ShellSetting: Component<{ controller: ShellSettingsController }> = (props) => { const language = useLanguage() const options = createMemo(() => @@ -89,7 +85,7 @@ export const ShellSetting: Component<{ description={language.t("settings.general.row.shell.description")} >