Skip to content

fix(desktop): keep completed task history accessible - #67987

Open
null-runner wants to merge 6 commits into
NousResearch:mainfrom
null-runner:fix/desktop-persistent-task-history-v2
Open

fix(desktop): keep completed task history accessible#67987
null-runner wants to merge 6 commits into
NousResearch:mainfrom
null-runner:fix/desktop-persistent-task-history-v2

Conversation

@null-runner

Copy link
Copy Markdown
Contributor

Summary

  • keep completed Desktop task history accessible after the intentional 4-second live-list linger
  • derive durable history at explicit lifecycle boundaries instead of rescanning the transcript during token streaming
  • render history as a separate collapsed status section after live tasks, with accessible disclosure state
  • reconcile primary and session-tile resume, edit, reload, restore, delete, stop, error, and gateway-reset paths

Supersedes the cramped popover approach from #66941 with the status-stack redesign requested in that review.

This is complementary to #62988: that PR changes linger duration, while this PR preserves the current 4-second linger and adds a transcript-derived way to reopen completed tasks.

Behavior

  • live tasks remain first and visible while active
  • completed live tasks still auto-dismiss after 4 seconds
  • the Task history disclosure remains available afterward
  • plain text deltas do not read or rebuild history
  • task ownership is bound to the producing stream, so a later turn cannot inherit or finalize the previous plan
  • runtime and stored session identities are reconciled for both the primary chat and tiles

Verification

  • focused backend/store tests: 119/119 passed
  • focused UI tests: 45/45 passed
  • final task-history regression tests: 30/30 passed in independent review
  • Desktop typecheck: passed
  • ESLint, Prettier, and git diff --check: passed
  • full Vitest run after upstream merge: 2,132 passed, 2 skipped; 12 parallel timeout failures were confined to Messaging, Providers, and Skills and all passed in isolated reruns
  • Desktop packaging tests: passed
  • production build and Electron bundle: passed

Review

Independent fail-closed review passed with no security concerns or logic errors after fixes for:

  • stale transcript cache risk
  • previous-turn todo attribution during the 4-second linger
  • late completion after visual dismiss
  • tile resume from stale prefetch data
  • stored/runtime history-key cleanup

@alt-glitch alt-glitch added type/feature New feature or request comp/desktop Electron desktop app (apps/desktop/*) area/sessions Session lifecycle, resume, persistence, history P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 20, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: this supersedes the closed #66941 popover approach and is complementary to #62988 (linger duration). It adds separate durable history/lifecycle behavior, so it is not a duplicate.

null-runner and others added 3 commits July 20, 2026 15:59
Completed-turn finalize committed task plans to history, but error and
stop paths only dropped the live turn's ownership. A later transcript
rebuild (resume/hydration/rewind) then reconstructed those same plans
from the persisted turn, so an errored or stopped task list was absent
immediately yet reappeared after resume. The transcript cannot tell an
errored/stopped turn apart from a completed-but-unfinished one, so the
only coherent semantic is to commit on every turn end: error and stop
now finalize the snapshot (as completion already did) before clearing
the live list, matching what the rebuild produces.

Also harden the surrounding edges surfaced by review:
- finalizeSessionTodoSnapshot accepts a nullable id and early-returns,
  so callers drop the `?? turn-${Date.now()}` fallback that could never
  match a real turn owner and only masked a missing streamId.
- StatusSection sets aria-controls only while expanded; the body is
  unmounted when collapsed, so the attribute no longer dangles at a
  missing id.
- todoHistoryFromTranscript always ids snapshots `messageId:toolCallId`
  instead of only when a turn carried multiple plans, so the same
  snapshot's id no longer flips across rebuilds.
…t-task-history-v2

# Conflicts:
#	apps/desktop/src/store/session-states.ts
# Conflicts:
#	apps/desktop/src/app/chat/composer/status-stack/index.tsx
#	apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx
#	apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
#	apps/desktop/src/app/session/hooks/use-session-actions/index.ts
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for carrying the task-history behavior through the Desktop lifecycle paths. The underlying gap remains on current main: apps/desktop/src/store/todos.ts:53-59 removes finished todo rows after the 4-second linger, and apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts:655-690 only clears live todo state at completion. The PR’s snapshot/finalization approach directly addresses that behavior while keeping plain text streaming outside history reconstruction.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 30, 2026
Re-apply the task-history snapshot/finalization wiring on the evolved
upstream shapes: the status-presence hook now drives its subscriptions off
the FEEDS array (task history joins it), reload/regenerate reads the session
id from the ref instead of the stale closure, and the resume fallback path
rebuilds history from the journal-recovered transcript.

Track upstream's ComposerScope ($messages atom, no popoutAllowed) and the
react-router package merge in the new tests, and have the tile-delegate test
stub return the updated state the real cache returns, which resume now reads
back to rebuild the tile's history.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/desktop Electron desktop app (apps/desktop/*) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants