say what the live opencode rows actually do

Two comments describing behaviour the code does not have.

LiveOpenCodeSession had been inserted between LiveClaudeSession and its docblock, so a
comment about isGenerating, pendingTasks and the idle GC read as documentation for the
OpenCode type — where it is contradicted by the correct comment directly beneath it.
Moved below, and it now states that it carries no ses_ id.

That absence is the point: /chat/live claimed title and cwd come from the session store
"so a turn whose id has not been reported yet shows unnamed". Nothing is looked up, and
there is no id here to look one up with. They are null permanently, not until-known.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-10 12:50:46 +01:00
co-authored by Claude Opus 5
parent c252f24f1d
commit 42190f007f
2 changed files with 19 additions and 11 deletions
+7 -3
View File
@@ -122,9 +122,13 @@ chatRouter.get('/live', async (ctx) => {
// OpenCode rows carry less, and the shape says so rather than faking parity. `isGenerating` is always
// true because a subprocess exists only while it generates; `pendingTasks` is 0 because `opencode run`
// has no background-task concept. Title and cwd come from the session store, which is keyed on the
// `ses_…` id the runner reports — not on our sessionKey — so a turn whose id has not been reported yet
// shows unnamed rather than guessing.
// has no background-task concept.
//
// Title and cwd are ALWAYS null here, not merely null-until-known: naming a session means reading
// OpenCode's store, which is keyed on the `ses_…` id, and `LiveOpenCodeSession` does not carry one —
// the runner reports it separately over `opencode:session` and nothing correlates the two. So a
// running OpenCode turn shows up unnamed, every time. Giving it a title means widening that type
// first; guessing from `sessionKey` would be inventing one.
const openCodeSessions = liveOpenCode.map((session) => ({
sessionKey: session.sessionKey,
claudeSessionId: null,