Skip to content

Commit 91ae391

Browse files
committed
fix(session): trust session_status only in busy() helper
Same root cause as the message-timeline fix in 3e7acb8. The busy() helper used to OR session_status against `some(incomplete assistant)` on the message list. Sessions with previously-crashed assistant messages stay 'busy' forever per that derivation, even when no work is running. Trust status only. Aligns with the helper inlined in upstream PR anomalyco#17593's second commit (6bfce60). Refs upstream PR anomalyco#17593.
1 parent 3e7acb8 commit 91ae391

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎packages/app/src/pages/session.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,10 +1516,11 @@ export default function Page() {
15161516
})
15171517

15181518
const busy = (sessionID: string) => {
1519-
if ((sync.data.session_status[sessionID] ?? { type: "idle" as const }).type !== "idle") return true
1520-
return (sync.data.message[sessionID] ?? []).some(
1521-
(item) => item.role === "assistant" && typeof item.time.completed !== "number",
1522-
)
1519+
// Trust session_status only. The DB-persisted message-list `some(incomplete
1520+
// assistant)` check is a permanent false positive for sessions that ever
1521+
// crashed mid-stream — those assistant messages stay incomplete forever in
1522+
// DB. session_status reliably clears to idle on error/cancel/finish.
1523+
return (sync.data.session_status[sessionID] ?? { type: "idle" as const }).type !== "idle"
15231524
}
15241525

15251526
const queuedFollowups = createMemo(() => {

0 commit comments

Comments
 (0)