Skip to content

feat(assistant): improve conversation continuity and responsiveness - #271

Open
chaxus wants to merge 43 commits into
mainfrom
fix/speech-first-permission
Open

chaxus wants to merge 43 commits into
mainfrom
fix/speech-first-permission

Conversation

@chaxus

@chaxus chaxus commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Merge Verdict

[NEEDS_CHANGE]

Exact-head CI passed at 62c614c, but a fresh interaction review reproduced additional correctness and UX gaps below. These should be addressed before merging. Functional commits remain separate; this PR is not merged.

Summary

  • Preserve first-use dictation through background model discovery. Align selected-text context, replace the native marker with a thin chevron, and animate opening and closing with reduced-motion support.
  • Browse history in bounded pages with background full-text search. The assistant title returns to the latest meaningful conversation while preserving active turns and per-conversation drafts.
  • Keep sending while an answer runs: edit/remove pending requests, resume FIFO, or explicitly Send now. Stop acknowledges immediately and preserves the next draft; obsolete output cannot affect later turns.
  • Serialize inference and every actual document Apply through physical settlement, including retained proposals after failed/stopped refinement. Only verified document receipts advance dependent work.
  • Skip unnecessary classification for exact greetings and trusted read-only tasks, avoid eager document-body scans for ordinary chat, and bound serialized reference context without truncating user instructions.

Functional commits remain separate. History persistence, model defaults, dependencies and document review permissions are unchanged.

Risk Analysis

Cross-cutting assistant lifecycle changes are protected by per-run identity, original-document scope checks, verified outcomes, owned Apply barriers and serialized provider drain. Pending requests and drafts remain volatile; disk history stays opt-in.

Code Concerns

Specification and quality reviews approved history, Stop, request performance, queue execution, Apply ownership, disclosure, title navigation and the delayed startup draft fix. The follow-up interaction review supersedes the earlier approval.

Follow-up Review

  • P1: First submitted request can become unreachable during initial history hydration. With opted-in history and delayed IndexedDB restoration, a ready provider can begin classifying a request before the initial placeholder is touched by accepted history. sessions.ts:157 drops that owner, and panel.ts:2747 switches to the restored conversation. The queued text is left under a removed session and the composer is empty. Reproduced in Chromium with a real Word editor and a controlled panel test; an already accepted Hello is the passing control. Preserve the identity of a session owning in-flight/pending work rather than rebinding its document context.
  • P2: Ordinary conversation is invalidated by editing the document. Ask Hello with no tools, edit the document while the response is held, then release it: the reply becomes “This proposal expired” instead of the greeting. Reproduced in Chromium. panel.ts:2628 applies document-position/history freshness to conversation-only requests. Separate proven conversation-only requests from editor-bound tasks while retaining provider/session/abort guards.
  • P2: Preparing request exposes ineffective queue actions. During held classification, Edit/Remove/Send now remain enabled, but request-queue.ts:141–165 rejects the active entry. Remove does nothing; Edit incorrectly says the empty composer contains a draft (panel.ts:1786). Reproduced in Chromium. Expose preparing state and truthful availability, or support cancel-and-settle editing/removal.
  • P2: History search misses copied text containing repeated whitespace. history-search.ts:181 collapses corpus whitespace while :225 does not normalize query whitespace. Chromium Worker and fallback paths both return zero matches for alpha beta and one for alpha beta against the same source. Normalize both consistently.
  • UX follow-up: The enabled microphone silently refuses to start during generation because panel.ts:800 returns false and speech-input.ts:233 exits. Source review only. Align voice draft entry with the new typed queue, or visibly explain its unavailable state.

Optimization evidence is separate from correctness: shared ChatView restoration of 1,000 synthetic messages (1,122 characters per assistant answer) produced 19,023 DOM nodes and a 135ms pending-timer delay on one Chromium machine. Render the latest window first, then load earlier turns. The CPU exact-token budget also repeatedly recounts one-turn-shorter histories; this is a pre-existing CPU-path issue, not a measured GPU regression. Real local-GPU first-visible-text timing remains unmeasured.

Verification

Conclusion basis: Verified

  • Final source 62c614c: 5,664 unit tests in 194 files passed; production build, workspace/application type checks and formatting passed. Quality checks verified all 1,511 immutable evaluation artifacts.
  • Twenty-two final-head serialized real-editor cases passed: first-use/Office/PDF dictation, history including 1,000 saved conversations, context events, actual process feedback, request queue, editable draft/focus and Stop followed by new questions. The prior source checkpoint also passed 70 related editor cases (three unavailable legacy corpus cases skipped).
  • Local and deployed Cloudflare-preview Chromium probes deliberately delayed automatic IndexedDB history startup and verified the early draft survives restoration and History/Escape. Controlled unit regressions also cover manual restore and a different draft owner created during hydration.
  • Chromium verified title navigation, draft-only conversation access, per-chat draft ownership, empty-history fallback and live-answer preservation. Deferred Send preparation restores input focus without stealing deliberate focus elsewhere.
  • History, pending requests and selected-text context were inspected in English/Chinese, three panel widths and light/dark. Disclosure opening, closing, reversal, keyboard and reduced motion passed.
  • Exact Hello uses one answer request and zero body walks; ordinary chat uses two requests and zero body walks; a trusted document read uses one grounded answer request and one body walk with no tools.
  • Synthetic 108KB partial-answer Stop: 1.07ms handler, stopping feedback on the next frame at 9.37ms, unchanged raw source/draft/caret and one host cancellation.

Limits
Physical local-GPU first-token/drain time and the user's microphone were not measured. Three legacy corpus-format cases are unavailable locally. Long conversations trim older complete turns to fit the model budget; this PR does not add semantic summarization.

All 20 reported checks passed at exact head 62c614c, including regular, Docker-image and Cloudflare-semantics E2E, timing budgets, lint, preview smoke and deployment. The formerly failing regular/Docker history shards both passed.

Exact-head CI.

Preview.

Acceptance record.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Deploying document with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62c614c
Status: ✅  Deploy successful!
Preview URL: https://1628791b.document-7hm.pages.dev
Branch Preview URL: https://fix-speech-first-permission.document-7hm.pages.dev

View logs

@chaxus chaxus changed the title fix(assistant): preserve dictation during first-use setup perf(assistant): improve history and request responsiveness Oct 15, 2026
@chaxus chaxus changed the title perf(assistant): improve history and request responsiveness feat(assistant): improve conversation continuity and responsiveness Oct 15, 2026

This branch has not been deployed

No deployments
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