fix(desktop): preserve full transcripts for running sessions - #67879
fix(desktop): preserve full transcripts for running sessions#67879Kinkoolino-Hermes wants to merge 4 commits into
Conversation
Related to #67871, #63298, and #50159: this Desktop display-layer repair restores persisted history during a running compressed session and deduplicates the live tail; the linked work addresses the report, queued-prompt identity, and stale completed-turn mechanisms respectively. |
7a43e6d to
1577328
Compare
|
Refreshed this branch onto current
Verification on the refreshed head:
New head: |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for covering both warm activation and cold resume; the current-main premise is real: apps/desktop/src/app/session/hooks/use-session-actions/index.ts:742-747 only applies the persisted transcript while idle, and :921-934 bypasses it when a live projection exists.
Problems
apps/desktop/src/app/session/hooks/use-session-actions/utils.ts:479-484clearsinflight.userafter finding the persisted row. That also removes the signalappendLiveSessionProjectionuses at current mainutils.ts:485-494to insert an assistant boundary beforequeued.user. With a persisted in-flight user, queued prompt, empty assistant text, andstreaming: false, this produces adjacent user rows rather than preserving the two-turn boundary. The new tests cover the queued case only with an assistant payload andstreaming: true.
Suggested changes
- Keep the source in-flight-user signal while suppressing only its duplicate bubble, and add the no-delta queued-turn regression.
- Integrate manually over current main's post-base reconciliation work, notably
2109a1875's redirect-correction support.
Automated hermes-sweeper review.
| ...projection, | ||
| inflight: { | ||
| ...projection.inflight, | ||
| user: undefined |
There was a problem hiding this comment.
Clearing inflight.user also removes the (inflightUser && queuedUser) signal that appendLiveSessionProjection uses to retain an empty assistant boundary before a queued prompt. Keep dedupe state separate from the source user, and cover the persisted-user + queued-user + no-assistant-delta case.
1577328 to
d1cd0c1
Compare
|
Addressed the queued no-delta turn-boundary finding and refreshed the branch onto current
Local verification on head
|
d1cd0c1 to
d39f1a8
Compare
SummaryFour PRs are listed in this complex. #67879 directly changes the REST-versus-compressed-runtime reconciliation behind #67871, while #68176, #70720, and #71121 address the adjacent image-attachment persistence and restoration failures in #68092/#70772. Related pull requests
Duplicates#68176 and #70720 substantially overlap on attachment preservation and were both superseded by #71121; none is a duplicate of #67879’s compressed-running-transcript fix. Suggested consolidationKeep #67879 open with a salvage path: preserve its full-transcript authority, live/concurrent overlay, boundary-aware dedupe, and queued no-delta regression, then obtain contributor re-review of the change that addresses teknium1’s keep_open finding. Keep #68176 and #70720 closed as superseded by #71121; #71121 is already integrated for the separate attachment issues and should not be treated as resolving #67871. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I67871(["issue #67871 (open)"])
P67879["PR #67879 (open)"]
P67879 -->|best fix| I67871
class I67871 open
class P67879 open
class P67879 best
class P67879 target
click I67871 "https://github.com/NousResearch/hermes-agent/issues/67871"
click P67879 "https://github.com/NousResearch/hermes-agent/pull/67879"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 4 pull requests and 3 issues in this complex. Each diff was read against this issue; Assessment working set: 146 kB of PR diffs, 32 kB of issue/PR text, 12 kB of discussion (16 comments), 11 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
|
@teknium1 The queued no-delta turn-boundary finding from your review has been addressed on the current head by retaining the source — 🤖 Bot comment · LLM: gpt-5.6-sol · not written by a human |
|
Thank you for this fix! It was salvaged into #86595 (cherry-picked onto current main with your authorship preserved in the commit history) and is now merged. Closing this PR since the work has landed. |
What does this PR do?
Keeps the complete persisted Desktop transcript visible when a warm session is reopened during a running, context-compressed turn.
session.activate.messagesis the agent's runtime context projection, so it may intentionally omit older durable conversation rows. The warm-cache path previously applied the fuller REST transcript only while idle. Duringrunning: true, reopening the session therefore replaced the visible conversation with the compressed runtime projection.This change always treats a matching REST transcript as the display authority, then projects the live
inflight/queuedtail onto it. A three-way, id-based overlay also preserves stream deltas and local submissions that arrive while activation is waiting for REST.The dedupe is deliberately boundary- and structure-aware rather than global text matching: REST suppresses
inflight.useronly when the matching user row is the open persisted tail, while local rows are considered activation-owned only when they form the expected synthetic user/assistant-stream pair. Ambiguous rows are retained so an accepted prompt is never dropped. Intentionally repeated prompts remain distinct.Related Issue
Fixes #67871
Related, but not duplicate:
running: true.Type of Change
Changes Made
apps/desktop/src/app/session/hooks/use-session-actions/index.tssession.resumewith a compressed live projection;apps/desktop/src/app/session/hooks/use-session-actions/utils.tsinflight.userdeduplication;running: true;inflightandqueued.How to Test
cd apps/desktop npx vitest run --project ui \ src/app/session/hooks/use-session-actions.test.tsx \ src/app/session/hooks/use-session-actions/utils.test.tsVerified locally
npm run check): exit 0, including the full Vitest matrix, Desktop platform/package matrix, and production buildSafety / Regression Notes
assistant-stream-*row replaces the one baseline-new activation placeholder; it is not appended as a second assistant bubble.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — N/A: Desktop-only TypeScript change; the complete Desktop gate is listed aboveDocumentation & Housekeeping
docs/, docstrings) — N/A: no user-facing API or configuration changecli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
No screenshot is needed: the bug and fix are covered by a deterministic warm-session activation test using divergent runtime and persisted histories. The original live transcript contains private conversation data and is not included.