fix(desktop): keep completed task history accessible - #67987
Open
null-runner wants to merge 6 commits into
Open
Conversation
Collaborator
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
Contributor
|
Thanks for carrying the task-history behavior through the Desktop lifecycle paths. The underlying gap remains on current main: This is an automated hermes-sweeper review. |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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
Verification
git diff --check: passedReview
Independent fail-closed review passed with no security concerns or logic errors after fixes for: