name the live opencode rows

They were permanently unnamed, and the two halves needed to name them already existed on
officer: the sidecar reports its own sessionKey because that is all it has, while the ses_ id
arrives separately over opencode:session and is recorded in opencode/state.ts. Nothing joined
them. /chat/live joins them now, so no protocol or sidecar change — widening
LiveOpenCodeSession would have meant sending the sidecar a fact it told officer in the first
place.

One list call names every row rather than one transcript load each, and it is skipped when
nothing is running or no id has been reported, so an idle Live panel never touches the serve.

Verified against a real turn, which also showed the design working as intended: the first
poll has no id yet and shows nothing, the next shows title and cwd. That window is real and
short, and showing nothing beats showing a key the user has never seen.

Worth knowing: opencode titles its own sessions "New session - <ISO timestamp>", so the row
is located but not meaningfully named. That is genuinely its title, not a bug here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-10 13:42:15 +01:00
co-authored by Claude Opus 5
parent 1892c23aef
commit 9118a9f76c
2 changed files with 37 additions and 17 deletions
+5 -3
View File
@@ -29,9 +29,11 @@ export type LiveClaudeSession = {
* An OpenCode turn in flight. Only ever the generating ones — see `listRunningOpenCodeTurns` for why
* this carries neither `isGenerating` (it is always true) nor `pendingTasks` (no such concept).
*
* It also carries no id for OpenCode's own `ses_…` session, which is why a live OpenCode row cannot be
* named: the runner reports that id separately, over `opencode:session`, and nothing correlates the two
* back here. Adding it is what a titled OpenCode row in the Live panel would need.
* It deliberately carries no id for OpenCode's own `ses_…` session, and does not need to: the sidecar
* only ever knows its own `sessionKey`, while the `ses_…` is reported separately over `opencode:session`
* and recorded by officer in `api/chat/opencode/state.ts`. `/chat/live` joins the two on officer's side,
* which is where both halves already are — widening this type would mean sending the sidecar a fact it
* had told officer in the first place.
*/
export type LiveOpenCodeSession = {
sessionKey: string;