Repository navigation
Closed
7 / 77 of 7 issues completedLabels
androidPrimary Android workenhancementNew feature or requestin-progressImplementation started, work still incompleteiosPrimary iOS workpriority: mediumNon-blocking V1 work and polish
Milestone
Description
Session Chat gets one floating pill system. Every pill over the chat uses the same component and lives in one of three corners. Subagents and agent-run shells get a background work pill. Steering messages stay visible in the timeline.
Why: today each floating element has its own look and position: a top-centre pill, the btw row, the full-width queued strip, a centred "Scroll to end", and a separate collapsed-permission pill. Background work isn't shown in the parent chat at all, and a steer disappears from the chat until it's delivered. The btw pill is the look to standardise on.
Pill component (design system, both platforms)
- One component in four layouts: icon + label, round icon only, live counter with a spinner, label with a close ✕.
- Five states: live, ready, needs attention (amber text, thin amber ring), error, done (green check).
- Same height, type and frosted glass as today's btw pill (
OpenCodeSideQuestionPill). - Variant-first API with no colour or radius overrides. Gallery entry on both platforms.
Corner slots
- Top left, context: at most 2 pills.
- Bottom left, live activity: one pill, plus a "+N" button. "+N" springs up a stack of the rest, in priority order:
- needs input
- error
- btw answer ready
- running work
- queued
- finished (fades after about 3 s, so with other work it only shows in the "+N" stack)
- Bottom right, navigation: empty at the end of the chat. When scrolled up it shows a round ↓, which becomes "↓ 3 new" when messages arrive.
- Keyboard up:
- The bottom-left pill shrinks to its icon, and "+N" and the other corners hide.
- A needs-input pill never hides and keeps its full label.
Pills
- Branch (top left):
- Shows only a branch or worktree icon and "+128 −14", with no name. Worktree sessions get the worktree icon. With no changes, it shows the icon only.
- Tapping it opens a small popover:
- branch name, base branch and file count
- the top 3 changed files
- "View all changes"
- a new "Copy branch name" action
- With no changes, the popover shows only the branch, its base and "Copy branch name".
- Todos (top left): "2/5" progress. Opens the existing todos sheet.
- btw (bottom left): the existing pill, moved onto the component.
- Queued (bottom left): "3 queued" replaces the full-width pending-prompts strip and opens the existing Up next sheet.
- Request failed (bottom left): error pill with ✕.
- Tapping it scrolls to the failure in the chat and highlights it.
- ✕ dismisses it.
- The retry countdown stays in the chat and is not a pill.
- Background work (bottom left): replaces a plain subagent indicator.
- Counter: "1 subagent · 2 shells" with a spinner. When one is waiting, it turns amber with a pulsing dot: "general needs input · 2 running".
- Tapping it opens a panel with Subagents and Shells sections, each row with a live timer. Tapping a subagent opens its session.
- Tapping a shell opens a half-height live output sheet: streaming output, "Running · 1 min 12 s", Copy, and Stop shell.
- Depends on the server: first check whether the opencode server (v1 and v2) lists running agent shells, streams their output and can stop them. If it can't, ship subagents only and track shells separately.
Permission and question panels
- Both panels keep replacing the composer while a request waits. Pills don't replace them.
- A request from a subagent shows which one is asking:
- a light amber row: the agent's letter, "general · subagent wants to run: npm test", and Open
- the same row on the question panel ("explore · subagent asks")
- the name comes from the subagent's session, which Session Chat already loads to find descendant requests
- Paging between waiting requests: arrows next to "1 of 2", dots under the panel, and swipe.
- Only a collapsed panel becomes a pill: "↑ Review permission" (today's collapsed pill, restyled) or "↑ Answer question".
- The question panel gains the same collapse.
- These pills have no ✕, so the request can't be dismissed by accident. Answer or deny it in the panel.
- Tapping the needs-input pill opens the panel if it's collapsed, pages to that subagent's request, and pulses the panel briefly.
Steering in the timeline
- Messages sent with steer during a run stay in the chat instead of only in the queued pill.
- Consecutive steers share one "↱ Steering" label, right-aligned above the bubbles.
- While pending, the bubble is dimmed with a dashed outline and "Pending · sends at the next step". After delivery it keeps the label.
- Queued (not steered) messages stay in the queued pill only.
Out of scope
Day separators, cardless assistant replies, and collapsing the idle composer.
Acceptance
- The shared pill component, with all layouts and states, in the Component Gallery on iOS and Android.
- Three corner slots with the priority order, "+N" stack and keyboard behaviour above, on both platforms.
- Branch, todos, btw, queued, request-failed and jump-to-latest pills on the new component, with the behaviour above.
- Background work pill and panel for subagents. Shells are included if the server supports them; otherwise a follow-up issue is filed (shells: Session Chat: shells in the background work pill #907).
- Permission and question panels name the asking subagent, page between requests, and collapse to pills with no ✕.
- Steering messages are shown in the timeline with the label and pending state.
- Works on v1 and v2 servers; no protocol-specific UI.
- Unit tests on both platforms for slot priority, the keyboard rules and the steering projection.
- Verified in the real apps against the scenario harness, with screenshots for both platforms.
Remaining:
- Check opencode server support for listing, streaming and stopping agent-run shells (v1 and v2); record the result here for Session Chat: background work pill for subagents #904
- Remove the old pill components left only in the Component Gallery after Session Chat: corner slots for floating pills #903 (side-question pill, pending-prompts strip, todos pill, syncing pill)
Sub-issues, in build order:
- Round 1 (merged): Session Chat: floating pill component #900 pill component, Session Chat: name the asking subagent and page requests in permission and question panels #901 permission and question panels, Session Chat: show steering messages in the timeline #902 steering in the timeline
- Round 2 (merged): Session Chat: corner slots for floating pills #903 corner slots, Session Chat: background work pill for subagents #904 background work pill, Session Chat: branch pill with changes popover #905 branch pill
- Round 3 (merged): Session Chat: connect needs-input pill and prompt pills #906 connect the needs-input and prompt pills, plus the end-to-end check
Sub-issues
Collapse Sub-issuesSub-issues
Loading 7 sub-issues
Metadata
Metadata
Assignees
Labels
androidPrimary Android workenhancementNew feature or requestin-progressImplementation started, work still incompleteiosPrimary iOS workpriority: mediumNon-blocking V1 work and polish
Activity
ivanfenenko commentedon Oct 31, 2026
Server support for agent-run shells (for #904)
I checked the opencode source at the v1 release
v1.19.5(810c0eba) and the v2 releasev2.2.5(9bbb8ce1). Thebetabranch no longer exists; v2 now ships fromdev, anddevatbf544cd4changes nothing relevant here.Recommendation: ship subagents in #904 on both protocols. Treat shells as a follow-up issue. v2 supports listing, reading and stopping shells. v1 has no background shells at all; it only has foreground tool calls, and the only way to stop one is to abort the whole session. Shipping shells now would make the panel differ by protocol, which the Acceptance list rules out ("no protocol-specific UI").
Summary
v1.19.5)v2.2.5)shelltool withbackground: truebashtool parts in the timelineGET /api/shellplusshell.created,shell.exitedandshell.deletedeventsmessage.part.updatedwithstate.metadata.outputGET /api/shell/:id/output?cursor&limit. There is no output event.POST /session/:id/abort, which stops the whole run.DELETE /api/shell/:idv1 (classic)
command,timeoutandworkdir(prompt.ts#L16-L23).state.status: "running". The server callsctx.metadata({ metadata: { output } })on every stdout/stderr chunk (shell.ts#L475-L531).outputholds the last 30,000 characters (shell.ts#L27).message.part.updated {sessionID, part, time}, not as amessage.part.delta.POST /session/:id/abortcancels the run and its descendant subagents. The bash child process is killed, and open tool parts becomeerrorwithmetadata.interrupted: true. No endpoint stops a single tool call or process./ptyis unrelated. These are user-created terminals with nosessionIDorcallID; the agent never creates them.v2 (
/api/*)shelltool acceptsbackground: boolean(tool/plugin/shell.ts#L46-L59). Background shells have no default timeout.Shell.Inforecord with ansh_…id andmetadata.sessionID(shell.ts#L200-L214).location[directory]:GET /api/shelllists running shells only.GET /api/shell/:idGET /api/shell/:id/output?cursor&limitreturns{output, cursor, size, truncated}.cursoris a byte offset.DELETE /api/shell/:idkills the process. It publishesshell.exited {status: "killed"}, thenshell.deleted, and deletes the output.Shell.Infofields areid, status (running|exited|timeout|killed), command, cwd, shell, file, pid?, exit?, signal?, metadata, time{started, completed?}(schema/src/shell.ts#L25-L61).shell.created {info},shell.exited {id, exit?, status}andshell.deleted {id}.info.metadata.sessionID.shell.outputevent, so a live output sheet has to poll/outputwith the cursor.session.tool.progresswithmetadata.shellID. Its output only arrives insession.tool.success.POST /api/session/:id/interruptonly cancels the job keyed by the session id (execution.ts#L128), and shell jobs are keyed bysh_…. Deleting the session does stop them.packages/process-daemonis not agent shells. It is a Rust PTY daemon behind the experimental persistent user terminals.Telling a foreground running bash call from a background shell
runningtool part. A user-run!command (POST /session/:id/shell) has the same shape, but comes after a synthetic user text part ("The following tool was executed by the user").Shell.Infohas no foreground/background flag. You have to infer it from the tool part:runningwithmetadata.shellID.completedwithmetadata.status: "running"andmetadata.shellID.session.syntheticmessage withmetadata.source: "shell".!shells havemetadata.background: trueand emitsession.shell.started/session.shell.ended.Subagents (both protocols, can ship now)
tasktool creates the child session withparentID, which arrives insession.createdasinfo.parentID.running, the tool part getsmetadata: {parentSessionId, sessionId, model, background?}(task.ts#L185-L195).session.status {sessionID, status: idle|busy|retry}, or from theGET /session/statusmap.permission.askedandquestion.askedcarry the child'ssessionID.subagenttool sends the child id throughsession.tool.progressasmetadata: {sessionID, status: "running"}(subagent.ts#L207).session.execution.started|succeeded|failed|interruptedfor the child's id, or fromGET /api/session/active.session.statusis declared, but no code publishes it.permission.askedandform.createdcarry the child'ssessionID.metadata.sessionID/sessionIdfrom the tool part.parentIDtree to find descendant permission requests.Follow-up scope for shells
GET /api/shelland theshell.*events, filtered to this session tree; poll/outputwhile the sheet is open; Stop withDELETE /api/shell/:id.bashparts with streamed output and no per-shell Stop. That is a protocol-specific gap and needs a product call.metadata.outputwhile a part is running.#899 Remove old floating pill components (#923)
ivanfenenko commentedon Nov 1, 2026
Done. #924 connected the needs-input and prompt pills, with end-to-end screenshots on iOS and Android against the scenario harness on v1 and v2. #923 removed the old pill components. Shells continue in #907.