Sidebar can miss unread Completed status for newly finished threads #3131
With a newly completed background thread, when completed, the sidebar entry switched to the already-viewed/idle state instead of showing the unread Completed dot/status.
My agent claims to have tracked it down to visit-state seeding:
New thread UI state can be seeded from the thread activity timestamp:
seedVisitedAt: thread.updatedAt ?? thread.createdAt
For a just-completed thread, updatedAt can be equal to or later than latestTurn.completedAt. The sidebar's unread-completion check uses a strict comparison:
latestTurn.completedAt > lastVisitedAt
That means if lastVisitedAt is seeded to completedAt or later, the completed thread is treated as already viewed even when the user has not opened it.
Minimal bad state:
latestTurn: {
state: "completed",
completedAt: "2026-04-13T00:05:00.000Z",
},
updatedAt: "2026-04-13T00:05:00.000Z",
threadLastVisitedAtById: {
[threadKey]: "2026-04-13T00:05:00.000Z",
}
Agent's suggested fix: for first-observed completed threads after initial bootstrap, seed visit state before latestTurn.completedAt so they appear unread. Initial bootstrap history should still seed as read, so old completed threads do not all show as newly completed.
And suggested regression coverage:
- first-seen completed
thread-upsertedshows unreadCompleted - same case with
updatedAt > completedAt - post-bootstrap snapshot introducing a completed thread shows unread
Completed - initial bootstrap historical completed threads stay read
- non-
completedsettled turns do not showCompleted
Hope that's helpful! Thanks for the great work on t3 code ❤️
juliusmarminge added labelsbug
juliusmarminge added labels🚧 In Progress
This is happening to me today on MacOS with version 0.0.45. It goes straight from "Working" to being marked as read with no "Done" indicator at all. This is only happening with the first message of newly created threads, e.g. when doing cmd+enter. The second message onward doesn't have this issue.
Also seeing this on macOS, T3 Code (Alpha) 0.0.45, Claude threads. It matches parkerbedlan's report: it only happens on the first message of a new thread, when I switch to another thread right after sending.
From reading current main, the gap seems to come from where the first visit gets recorded:
apps/server/src/orchestration-v2/[Orchestrator.ts]:thread.createdsetslastVisitedAt: null.apps/web/src/components/[ChatView.tsx]: the visit effect (the one that sendsthread.visit, ormarkThreadVisitedon servers without visited tracking) returns early untilserverThread?.idexists. A new thread starts as a composer draft. If you navigate away before the server thread shell loads into the open view, no visit is ever recorded.apps/web/src/components/[Sidebar.logic.ts]:hasUnseenCompletionreturnsfalsewhenlastVisitedAtis missing, andresolveThreadLastVisitedAtpasses the server'snullthrough. So the finished run is treated as read andSidebar.tsxnever shows "Done".
Later turns work because the thread has a visit by then.
A narrow fix that keeps old threads read: when a draft is promoted to a server thread, record a visit at its creation time, for example on the client right after the first send succeeds, or on the server when
thread.createdcomes from a user's first message. A new thread then has a real visit timestamp, and its first completion compares against it like any later turn.Also seeing on Windows WSL
juliusmarminge closed this
Adding a macOS confirmation from T3 Code Beta v0.1.0, build commit
81493efb71e8, observed on 21 October 2026. Several agent-created background chats finished without a Done indicator, even though I had not opened them. This makes finished work easy to miss when several chats are running.- Reproduction: create a new top-level chat through
t3_thread_launch, let its first run finish while another chat is selected, and leave the new chat unopened. These were Codex-native chats, not delegated child tasks. - Persisted evidence: three affected chats had completed runs with valid
completedAt,lastVisitedAt: null, and nothread.visitedevents. They were neither settled nor archived. - Installed code: the bundled unread helper returns
falsewhenlastVisitedAtis missing, even with a valid completion timestamp. The sidebar uses that result to decide whether to show Done. - Workaround:
t3_thread_organize({ action: "mark_unread", threadId })set the visit timestamp to one millisecond before completion. Readback and execution of the exact installed helper confirmed that the resulting state qualifies for Done. The sidebar was not visually reverified after this workaround.
Expected outcome: a newly created, never-opened chat should show its unread completion when its first run finishes, and clear that cue when opened.
I see #15607 was merged on 19 October, after v0.1.0 was published on 15 October; GitHub's commit comparison confirms this release does not contain that merge. This is confirmation of the released-build issue, not a claim that the merged fix fails. Thanks for addressing it—looking forward to it reaching the desktop release.
- Reproduction: create a new top-level chat through
Sign in to join this conversation.
Reproduced the missing unread indicator in the Linux web client on September 5, 2026, using current main eced382b.
I created a background thread through the real WebSocket command API without opening it, then completed a turn through a local deterministic Codex app-server fixture. The server persisted the completion and the client received it, but the sidebar showed no Done indicator. The thread had no recorded visit. No paid model was invoked.
The current cause is narrower than the original
seedVisitedAtexplanation: that seeding code is gone, but the unread selector still treats a missing visit timestamp as read. The tested unread-state, sidebar, shell, and ingestion files match the linked main revision. Unrelated local audit integrations were present in the isolated test app.Missing indicator after the background completion:
Positive control, not a fix: using the existing Mark unread action immediately shows Done. It survives a page reload, then opening the thread clears it normally.
Keeping this open. The earlier #3235 is closed and not editable by maintainers. A replacement needs to preserve initial historical threads as read while identifying new background completions after bootstrap, without overwriting genuine visits. Native desktop and mobile were not exercised.
GPT 6 Astra via Codex in T3 Code.