Repository navigation
Conversation
There was a problem hiding this comment.
The client part is small and correct: shell.activeSessions() is tested, the client tests pass (36/36) and both packages type-check with tsc. The app part is ~490 lines that nothing mounts, so I couldn't try it; the only check on it is that it compiles.
Public API: adds shell.activeSessions() to the data object returned by createData in @opencode/client (backwards compatible). Nothing else public changes.
Concerns:
- Code nothing uses yet.
RunningSessionsand its four helpers aren't mounted or tested anywhere, so nothing exercises them until the Side bar PR lands. It's worth asking whether this should ship together with the PR that mounts it. - Duplicated Inbox logic.
shell/sessions/branches.tsre-implements the Inbox's branch loading without its retry and timeout handling, andduration.tsrepeats the elapsed-time formatting ininbox.tsx. Sharing the Inbox code would be better than keeping a second copy.activity.tsandlabels.tsare each used once;AGENTS.mdasks to inline helpers like these. - Two behaviour issues, noted inline: branch lookups never retry, and requests repeat on every list change.
|
Could a maintainer please approve the pending fork CI workflows for this PR? The required checks are waiting for approval ( |
|
Addressed in f72b8d4: shared Inbox loading/elapsed formatting, inlined the single-use helpers, and added a real Running component story plus regression tests (20/20 repeated runs). The component takes connections, selection and navigation from its caller, so it can be tried independently in the component lab: |
There was a problem hiding this comment.
Both earlier concerns are fixed, and I found nothing new that should block a merge.
- Branch loading: Running now uses the Inbox's branch loader (moved to
shell/sessions/branches.tsandbranch-machine.ts) with its retries, timeouts and reconnect handling. On the Inbox side this only moves code; behaviour is unchanged. - Repeated syncs: session, permission and form syncs now run once per row, when it first appears or its connection changes, instead of for every row on each list change.
- Duplicated helpers: elapsed-time formatting is shared with the Inbox and gives the same output. The single-use helpers are inlined.
- Use in the app: the component is still only shown through Storybook and component tests. That's fine for this split.
I ran the branch, Inbox and session unit tests (114 pass) and tsc for packages/app (passes). I couldn't run the Playwright component specs here.
Public API: adds shell.activeSessions() to the data object returned by createData in @opencode/client (backwards compatible). Nothing else public changes.
Issue for this PR
Part 3 of the split requested in #60867; design context: #60241. Independent of the session-index PR #62845 and the project-action refactor #62850.
Type of change
What does this PR do?
Add a reusable
RunningSessionslist undershell/sidebar. It combines active session IDs with already collected background shells across connected servers, including child sessions. Rows show waiting requests, project/branch and elapsed time. Connections, selection and navigation are supplied by the caller.Metadata and requests load when a keyed row arrives or its connection changes. Inbox and Running share the existing branch retry/timeout state machine and elapsed formatting; the two single-use helpers are inlined.
Exposure: mounted in the component lab with a local server fixture and Playwright tests. Production mounting belongs to the later opt-in Side bar PR after design review; no interface mode or default changes here, so no runtime flag is needed in this PR.
How did you verify your code works?
bun run check, application/client TypeScript checks, 36 client data tests, 8 branch/Inbox unit tests and changed-file lint pass. The two real-component regressions pass 20/20 repeated runs (2 workers, no retries), covering child sessions, shell deduplication, navigation, request counts and retry/reconnect. The retry regression fails with the old loader.Three existing Inbox browser regressions pass against a production build. Both full component suites pass cold: app 268/268 and session-ui 209/209, with no retries or dependency re-optimization.
Windows validation uses an equivalent temporary import for the repository's
custom-elements.d.tssymlink; it is not committed. Upstream fork CI awaits maintainer workflow approval (action_required).Visual
Screenshots / recordings
Try the real component:
bun run --cwd packages/stories dev, thenhttp://localhost:6006/?id=sidebar-running--overview(orsidebar-running--retry). Controls change only the local fixture.Checklist
Added by the opencode bot (AI-generated).
Public API: adds shell.activeSessions() to @opencode/client's createData data object (backwards compatible)