Skip to content

Refresh persisted chat history once after an idle reattachment - #856

Open
Maya-Kid wants to merge 3 commits into
deeplethe:devfrom
Maya-Kid:fix/chat-history-reattach-handoff
Open

Maya-Kid wants to merge 3 commits into
deeplethe:devfrom
Maya-Kid:fix/chat-history-reattach-handoff

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Post-merge synchronization (2026-09-22)

Rebased onto dev@7cfeedfeb11c3a1c42d5091c5941a51afaaeb161 after #848, #851, #849, #850 and #852 merged. Current head: ba964f3aaa94ae514f9e585c04329f642708299d.

The UI dependency order remains #854#856#855. Retained upstream stream-interruption strings alongside the history/pagination keys when resolving i18n conflicts. The complete UI tree is byte-for-byte identical to the previous validated integration tree. Maintainer visual review remains outstanding.

Validation on combined tree d06f4ad0199a382635a6bbf94210b9421cbeba66 (675 tracked Linux inputs hash-matched):

Earlier evidence below refers to its stated historical heads.


Depends on #854 (view-request ownership). This branch includes that prerequisite so stale refreshes cannot overwrite a later navigation or send. The additional commits for this behavior are cb82751 and 9afbe39; after #854 merges, GitHub's diff will reduce to those changes.

An answer can commit after the browser reads a user-only history but before it reattaches to the live producer. The server then correctly returns idle, while the page remains stuck with the unanswered question. On that initial idle handoff, read the persisted history once and apply it only while the initiating view request still owns the page. If it is still unanswered, display a bounded idle status; a failed read offers an explicit retry. This never re-POSTs the question or recursively reattaches.

Validation, based on dev@ea0557b plus #854, final head 9afbe39:

  • Four new history-handoff browser regressions fail before this change while the 11 prerequisite cases pass.
  • All 16 browser subtests pass after the fix: the 11 prerequisite cases plus completed-between-reads, bounded user-only history, late refresh after navigation, retry after refresh failure, and a new send taking ownership before the old refresh arrives. The tests render the real Chat/router/query/live-answer implementation with controlled HTTP responses.
  • Frontend 116 module tests and build/typecheck/guard pass; the final additional send-race case and typecheck pass as well.
  • Chrome with the actual Linux backend and PostgreSQL held reattachment until a locally scripted model's answer had committed and the producer had unregistered. The real idle response caused exactly one extra detail GET, rendered the saved answer, and caused zero chat POSTs.
  • Integration tree f7bcd0878bf490d6efb122b71d6f13d379df4709, including Hand off exhausted tool runs to an evidence-only final answer #845 and Preserve exact chat outcomes across stream closure and reattachment #851's strict stream terminal handling, passes Rust fmt, strict workspace Clippy, 1,013 tests (one pre-existing external-HTTPS RSS test ignored), workspace build, 129 frontend module tests, 27 browser subtests and frontend build.

Run node --test tests/chat-view.test.mjs from web, with optional CHAT_PLAYWRIGHT_PATH and CHAT_CHROMIUM_PATH. No new dependency, polling loop, model retry, or server generation policy is introduced. All model integration evidence uses a local scripted endpoint, not a paid model.

Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
@Maya-Kid
Maya-Kid force-pushed the fix/chat-history-reattach-handoff branch from a155bba to ba964f3 Compare September 22, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant