Skip to content

feat(app): New split — open an empty session as the secondary pane - #4397

Merged
benjaminshafii merged 11 commits into
devfrom
feat/new-split-session
Sep 4, 2026
Merged

benjaminshafii merged 11 commits into
devfrom
feat/new-split-session

Conversation

@benjaminshafii

@benjaminshafii benjaminshafii commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

What

Adds New split: create a fresh, empty session in a workspace and open it as the secondary split pane while the primary pane and route stay where they are.

Two entry points:

  • Sidebar: right-click any session row (or its ⋯ menu) → New split. Uses that row's workspace. Shown whenever a primary session is open, including on the current session's own row.
  • Cmd+K → New split. Uses the selected workspace.

How

  • session-route.tsx: handleCreateTaskInWorkspace is now a thin wrapper over one creator with openAs: "primary" | "split". The split path keeps the retry/toast/analytics/model-apply behaviour but skips the navigate / active-workspace / last-session writes and instead openTab → setSplit → focusPane("secondary"). Retry and engine-reload toasts preserve the mode.
  • app-sidebar.tsx / app-sidebar-provider.tsx / session-page.tsx: menu item (data-session-menu-new-split) plumbed through the sidebar context.
  • command-palette.tsx: new-split item, gated like open-in-split-view.
  • en.ts: one label. No workbench-store changes; existing reducers cover it.

Verification — Passed

Spec evals/specs/new-split-session.e2e.test.ts, Daytona lane, on this head (checkout resolved 1a8b35b6a5dc):

✓ new split creates fresh same-workspace secondary sessions without moving the primary  275660ms
passed 1 / failed 0 / skipped 0

Claims asserted, for both entry points: layout is split; primary session id and route unchanged; secondary is a new ses_… id not present before; same workspace; session count grows by exactly one per action; exactly one secondary pane (palette replaces, doesn't stack). Evidence is in the sticky test-evidence comment; supplementary screenshots of both flows are in an earlier comment.

Typecheck (tsc -p apps/app/tsconfig.json --noEmit) and bun test tests/workbench-store.test.ts tests/command-palette-sessions.test.ts (8 pass) green.

Depends on #4415

This branch includes the two harness commits from #4415 (engine cache pre-warm). Without them every app-driving spec on dev dies at seedSessions because the engine's cold plugin install wedges in the sandbox. Merge #4415 first; this PR then reduces to the three feature/spec commits.

@vercel

vercel Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 4, 2026 10:59am UTC
openwork-den Ready Ready Preview Sep 4, 2026 10:59am UTC
openwork-diagnostics Ready Ready Preview Sep 4, 2026 10:59am UTC
openwork-landing Ready Ready Preview, v0 Sep 4, 2026 10:59am UTC

@benjaminshafii

Copy link
Copy Markdown
Member Author

Supplementary screenshots (not the verdict)

Captured by driving the PR build from this branch's worktree (pnpm world up dev-headless, headless Chrome at 1600×1000). These illustrate the feature; the verdict still comes from evals/specs/new-split-session.e2e.test.ts, which remains Incomplete (see below).

1. Right-click any session → New split

Context menu showing New split

2. Result: primary stays put, a fresh empty session opens as the secondary pane with focus

layout: { kind: "split", primary: ses_…lcxe, secondary: ses_…wegg (new), focused: "secondary" } — route unchanged.

Split view with the new session on the right

3. Cmd+K → New split

Command palette showing New split

Selecting it replaced the secondary with another fresh session (ses_…bAIE), primary and route unchanged, exactly one secondary pane.

Why the spec is still red — root cause

It is not this diff and not the proxy. On current dev, the managed OpenCode engine takes ~3.5 minutes to finish workspace bootstrap on a repo this size; until then openwork-server answers every workspace-scoped /opencode/* call with 502 opencode_unreachable (only /global/health is served early — engine-pool.ts:~1200). The app's canCreateTask is therefore false, and @openwork/behaviors seedSessions gives up after 60s (packages/behaviors/src/sessions.ts:4). Every app-driving spec hits this, on Daytona and locally, with or without this diff. The Daytona regression suite has skipped its E2E job in its last 60 runs, so CI hasn't surfaced it.

Latest Daytona run on this head: placement: daytona · × … did not become available within 60000ms · verdict failed.

Fix belongs in the harness/engine warm-up (either wait for engine readiness before seeding, or raise the first-create budget), not here. Once that lands, rerun pnpm evals:e2e new-split-session on this head and this PR can go ready-for-review.

Benjamin Shafii added 2 commits September 4, 2026 02:58
…nd seed each Electron profile

Every e2e desktop profile started with an empty engine cache, so the first
workspace bootstrap npm-installed @opencode-ai/plugin and opencode-chrome-devtools
inside the engine. In the sandbox that self-install often wedged with idle TLS
connections to the registry, the app reported OpenCode unavailable, and every
app-driving spec died at seedSessions. Install those packages once per sandbox
with npm into the three directories the engine checks, then copy the warm tree
into each fresh profile so bootstrap takes 0.2s instead of minutes.
Comment thread evals/packages/hosts/src/daytona.ts Resolved
diff-warden[bot]
diff-warden Bot previously approved these changes Sep 4, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (24187a960eb98ace5f7db0d6854db9f66a2ec0e4). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

…that exact path

Address the Warden finding: never trust a pre-existing shared cache dir in a
reused sandbox. Each provision installs into a fresh /tmp/openwork-engine-warm-*
tree with --ignore-scripts and hands that exact path to the Daytona host, which
is the only source spawnElectron seeds from.
Comment thread evals/packages/hosts/src/provision.ts Resolved
@benjaminshafii

Copy link
Copy Markdown
Member Author

Test evidence — new-split-creates-fresh-same-workspace-secondary-sessions-without-moving-the-pri — ✅ passed

✅ 0/2 screenshots passed · 0 expectations passed · 0 failed · 0 pending

[world] desktop(daytona) · workspace(/tmp/openwork-new-split-session-1788519588298) · session("New split primary")
[probe] eventually(single layout on the seeded primary) · hash
[agent] listSessions
[user] rightClick(text=New split primary) · see(label=New split) · click(label=New split) · see(text=Split view) · see(text=New session)
[probe] eventually(context-menu new split layout) · hash
[agent] listSessions
[probe] eventually(context-menu split session appears in the session list)
[user] screenshot · press(Control+K) · see(placeholder=Search actions, settings, and sessions…) · type(placeholder=Search actions, settings, and sessions…, "new split", replace) · see(label=/^New split/) · press(Enter) · see(text=Split view) · see(text=New session)
[probe] eventually(palette new split replaces the secondary session) · hash
[agent] listSessions
[probe] eventually(palette split session appears in the session list)
[user] screenshot
steps 1 ✅ the seeded session is the single primary pane (0.9s) · 2 ✅ New split in the session context menu opens a fresh secondary (2.4s) · 3 ✅ the context menu creates one same-workspace split session (1.3s) · 4 ✅ New split in the command palette replaces the secondary with another fresh session (3.1s) · 5 ✅ the palette creates one more session while preserving the primary route (1.2s)
verdict passed · 9 user observations (see ×7, screenshot ×2) · 8 probes · steps 5/5

⚪ UNVALIDATED — 1. new-split-creates-fresh-same-workspace-secondary-sessions-without-moving-the-pri artifact 1

  • ⚪ UNVALIDATED — no visual expectations recorded.

new-split-creates-fresh-same-workspace-secondary-sessions-without-moving-the-pri artifact 1

⚪ UNVALIDATED — 2. new-split-creates-fresh-same-workspace-secondary-sessions-without-moving-the-pri artifact 2

  • ⚪ UNVALIDATED — no visual expectations recorded.

new-split-creates-fresh-same-workspace-secondary-sessions-without-moving-the-pri artifact 2


Test run created 2026-09-04T10:58:00.501Z · Source: evals/results/test-runs/2026-09-04T10-58-00-500Z-new-split-creates-fresh-same-workspace-secondary-sessions-without-moving-the-pri/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4397 --test-run 2026-09-04T10-58-00-500Z-new-split-creates-fresh-same-workspace-secondary-sessions-without-moving-the-pri

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (69caa0f478ca9bbdc9142fba9214f252155a4ad9). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@benjaminshafii
benjaminshafii merged commit 153b34d into dev Sep 4, 2026
27 checks passed
@benjaminshafii
benjaminshafii deleted the feat/new-split-session branch September 4, 2026 11:13
benjaminshafii pushed a commit that referenced this pull request Sep 4, 2026
…lugin is bundled (#4426)

The cache warm gate added in #4397 preinstalled opencode-chrome-devtools through npm. #4423 now bundles the plugin locally, so remove the provision-time install, profile seeding, and environment plumbing.

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — 69caa0f4 Deployed Sep 4, 2026 by vercel[bot]
Preview – openwork-app — 69caa0f4 Deployed Sep 4, 2026 by vercel[bot]
Preview – openwork-den — 69caa0f4 Deployed Sep 4, 2026 by vercel[bot]
Preview – openwork-diagnostics — 69caa0f4 Deployed Sep 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant