Three parallel shells, then a read, then a shell

The same flow inside one Code Mode script and as direct tool calls, in the desktop app and the TUI. OpenCode dev @ 007afb1b0c, simulated Claude Opus 5.5, real shells and read. Click a screenshot to open it full size.

Code Mode: one execute script
Direct tools: four model steps
Desktop
TUI

Clicking a shell (desktop)

The first shell prints tick 1…4, one line a second. In Code Mode, a nested shell row only ever shows its command. The output appears only in the script's combined Output row after it ends. With direct tools, the row opens the command and its live output.

Code Mode
Direct tools
Mid-run
Running, finished, then the combined Output row.
Running (tick 1–2), a second later (tick 1–4), finished.

Timeline detail: “Detailed” (desktop)

Settings → Preferences → Timeline detail. The default is Compact. Detailed opens direct shells by default, and their output streams in on its own. In Code Mode, Execute starts open, but its nested rows still show only the command.

Code Mode
Direct tools
Detailed

Patch (GPT model)

A GPT model gets patch instead of edit/write. The flow is shell (1 s), patch, read, shell (2 s), patch. With direct tools, each patch shows a numbered diff (on desktop, with the file name and +/− counts). In Code Mode, the patch row is the raw patch text on one line; opened, it shows the raw patchText with no file header or diff view.

Code Mode
Direct tools
TUI
Desktop

Scripts in the activity pill

A Code Mode script running two 60 s shells: in the foreground, then moved to the background, then stopped from the pill. PR #64790.

origin/dev (before)
codemode-scripts-pill (after)

While the script runs in the foreground, the pill shows its own shells as "2 shells", and the execute row has no "Move to background". Ctrl+B in the composer opened the home screen here, so the run stops at that point.

In the foreground: "Move to background" on the execute row and no pill. In the background: "1 script · 2 shells" and a script row ("// Build both targets", elapsed time). Stop cancels the script and its shells, and the pill goes away.

Subagents with background work

The main session starts a subagent. The subagent starts a background sleep 60 && echo done shell and goes idle. PR #64790.

origin/dev (before)
codemode-scripts-pill (after)

The pill shows "1 subagent" for about half a second, then disappears once the subagent goes idle, even though its shell is still running.

The pill keeps "1 subagent", and its row reads "General · Run the build · Background work · 1 shell". Stop sends one POST /api/experimental/job/sh_…/cancel, the shell ends and the pill goes away. The renderer made no other /api/experimental/job requests while the run was being watched (no polling).

Activity pill on dev (#64790), flag on/off

OpenCode dev @ 5ef7657335 (contains #64790 f15ed39165), Desktop under Xvfb, simulated Claude Opus 5.5, real shells. Flag on = experimental.full_codemode: true + OPENCODE_FLAGS=full_codemode; flag off = OPENCODE_FLAGS unset + full_codemode: false. Every LLM request's tool list matched (on: question, skill, subagent, execute; off: shell top-level). 8. No polling: pass: the request hook (attached before the session opened) saw only one GET /api/experimental/job?…descendants=true&status=running per session opened (main; child and main again in 5–7) plus one POST …/cancel per Stop. Shell Stop goes through the shell API, so 4 shows no job request.

Flag on
Flag off
1. Foreground script, 2 shells (3–4 s)

Pass. “Move to background · Ctrl B” shows on the running Execute; no pill (its 2 shells aren't counted as background). log

Pass (hint), N/A (shells). No hint, no pill. With the flag off shell isn't in Code Mode's catalog: the script fails at once with “Unknown tool 'shell'”. log

2. Long script (>10 s)

Pass. At 10 s the script moves on its own: pill “1 script · 2 shells”, rows “// Build both targets”, both sleeps. Stop → pill gone, shells killed. log

Pass. A 14 s script (shell can't run, so it spins) stays in the foreground: no hint, no job, no pill. Surprise: Ctrl+B here opens the Home screen (nothing to move, so Linux mod+b home toggle wins). log

3. Move to background (click), Stop from pill

Pass. Click → “1 script · 2 shells”. Stop on the script row sends one POST /job/cm_…/cancel; pill gone, both sleeps exit. log

N/A: with the flag off nothing runs as a script job (see 2).

3k. Move to background (Ctrl+B)

Pass. Same as 3 with Ctrl+B in the composer. log

N/A.

4. Main-session background shell

Pass. Via tools.shell({timeout: 1500}) (Code Mode has no background): “1 shell”, row “sleep 97 && echo bg”; Stop removes it, process ends. log

Pass. Direct shell with background: true: “1 shell”; Stop removes it, process ends. log

5 + 7. Subagent background shell, open the child

Pass. Subagent idle: “1 subagent”, row “Background work · 1 shell”. Child session: no pill. Back in main: pill again. Stop → POST /job/sh_…/cancel, pill gone, shell ends. log

Pass. Same with a direct background shell. log

6. Subagent backgrounds a script

Pass. Row “Background work · 1 script” (its shells aren't counted separately). Child: no pill. Stop → POST /job/cm_…/cancel, both sleeps exit, pill gone. Note: a cancelled script sends no notice, so the subagent and main stay quiet (a stopped shell wakes both). log

N/A: no script jobs with the flag off.

TUI Scripts tab

PR #64956 plus #64972, flag on, simulated “Claude Opus 5.5”. A Code Mode script with two 90 s shells, moved to the background with Ctrl+B. Pass.

  1. Footer shows “↓ 1 script · 2 shells”.
  2. ↓ from the prompt now opens the picker straight on Scripts, the first tab with something running (#64972, a36aa465d8); before, it opened an empty Subagents tab. Esc, then clicking the footer pill opens Scripts too: both use the same rule.
  3. Scripts row “// Build both targets” with elapsed time ticking (22s → 24s); Ctrl+D cancels it and the Scripts tab and the footer entry disappear.

manifest

Diffs below Code Mode scripts

PR #65002, flag on, simulated “GPT-5”. One foreground script: sleep 3 → patch src/app.ts → sleep 3 → patch it again → sleep 3 → Bun.write new notes.md → sleep 3 → delete old.txt → sleep 3. The diffs stay visible while the script stays collapsed. Pass.

Desktop: a caption at the top of the video labels each step

  1. The prompt is typed into an empty session and sent.
  2. The script starts. “Used 1 Execute” stays collapsed.
  3. Patch src/app.ts (1/2).
  4. Patch src/app.ts (2/2).
  5. Bun.write notes.md.
  6. Delete old.txt.
  7. With the script still collapsed, three cards show under it: app.ts +2 −2 (both patches in one diff), notes.md Created, old.txt Deleted.
  8. Each card opens and closes in turn.
  9. The script is expanded (its calls are listed) and the diffs stay below it.
  10. The script collapses again.
  11. The model's reply.

TUI: the video's markers name each step

  1. The prompt is typed into an empty session and sent.
  2. The script runs, folded into “+ N tools”.
  3. Patch src/app.ts (1/2), then 4. (2/2), 5. Bun.write notes.md, 6. delete old.txt.
  4. The row stays folded as “+ 9 tools”, and under it are “← Patched src/app.ts” (one merged diff), “# Created notes.md” and “# Deleted old.txt -3 lines”.
  5. Scroll through the three blocks. They fit in the 60-row view, so nothing moves.
  6. Click “+ 9 tools”: the execute call list appears, with the diffs still below it.
  7. Click it again to fold it.
  8. The model's reply.

manifest · desktop log