Skip to content

The agent that grows with you

fix(desktop): sessions waiting on subagents or background processes keep the running highlight

Tekniumcc9dbb0583fc
diff --git a/apps/desktop/src/store/session-dot-state.test.ts b/apps/desktop/src/store/session-dot-state.test.ts
index 46b6e933213..54ddb323e8a 100644
--- a/apps/desktop/src/store/session-dot-state.test.ts
+++ b/apps/desktop/src/store/session-dot-state.test.ts
@@ -35,8 +35,11 @@ describe('showsRunningArc', () => {
expect(showsRunningArc('needs-input')).toBe(false)
})
+ it('keeps the arc while subagents or background processes outlive the turn', () => {
+ expect(showsRunningArc('background')).toBe(true)
+ })
+
it('leaves a session that is not running unmarked', () => {
- expect(showsRunningArc('background')).toBe(false)
expect(showsRunningArc('idle')).toBe(false)
expect(showsRunningArc('unread')).toBe(false)
})
@@ -53,8 +56,7 @@ describe('hasLiveTurn', () => {
}
})
- it('excludes work that outlived the turn', () => {
- expect(hasLiveTurn('background')).toBe(false)
+ it('excludes a finished session', () => {
expect(hasLiveTurn('unread')).toBe(false)
})
})
diff --git a/apps/desktop/src/store/session-dot-state.ts b/apps/desktop/src/store/session-dot-state.ts
index 2217b49dfdb..f423af992af 100644
--- a/apps/desktop/src/store/session-dot-state.ts
+++ b/apps/desktop/src/store/session-dot-state.ts
@@ -71,13 +71,17 @@ export const $delegatingSessionIds = computed(
export type SessionDotState = 'background' | 'draft' | 'idle' | 'needs-input' | 'stalled' | 'unread' | 'working'
/** The sidebar row's arc. A quiet turn is still authoritatively running, so
- * `stalled` keeps it; a blocking prompt drops it, because the amber dot is the
- * louder cue and two treatments at once fight each other. */
-export const showsRunningArc = (state: SessionDotState): boolean => state === 'stalled' || state === 'working'
-
-/** Whether this turn is the session's own, live: brighter title, and the row's
- * age yields to the actions menu. Wider than the arc — a turn waiting on an
- * answer has not ended. */
+ * `stalled` keeps it; so does `background`, because a turn that ended on
+ * delegate_task(background=true) or terminal(background=true) still has work
+ * running in the session, and a row with no arc read as finished. A blocking
+ * prompt drops it, because the amber dot is the louder cue and two treatments
+ * at once fight each other. The dot still tells background apart (hollow). */
+export const showsRunningArc = (state: SessionDotState): boolean =>
+ state === 'background' || state === 'stalled' || state === 'working'
+
+/** Whether the session is live: brighter title, and the row's age yields to
+ * the actions menu. Wider than the arc — a turn waiting on an answer has not
+ * ended. */
export const hasLiveTurn = (state: SessionDotState): boolean => showsRunningArc(state) || state === 'needs-input'
/** The buckets the sidebar's status filter and ordering work in. `stalled` and