Repository navigation
feat(ui): recover unfinished optional-question drafts - #154473
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 6:36 AM ET / 10:36 UTC (Revision 3). ClawSweeper reviewWhat this changesThe Control UI saves unfinished optional-question answers in its existing browser draft store and restores them across reloads, reconnects, and conversation navigation. Merge readiness✅ Ready for maintainer review This remains useful work absent from current main. The earlier Skip finding is resolved, and the pinned diff has no remaining blocking correctness finding. Priority: P2 Review scores
Verification
How this fits togetherOptional questions arrive in conversation history and appear above the chat composer. This change connects their unfinished answers to authenticated browser draft storage while keeping submitted answers authoritative in conversation history. flowchart TD
A[Conversation history] --> B[Optional question panel]
B --> C[User edits answer]
C --> D[Scoped draft adapter]
D --> E[Existing browser draft store]
E --> B
A --> F[Saved answer reconciliation]
F --> D
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +352, Tests +599. Total +951 across 20 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep unfinished-answer recovery with the existing authenticated draft owner and preserve canonical history as the authority for completed answers. Do we have a high-confidence way to reproduce the issue? Yes, from source: enter an optional answer and change the conversation or connection scope; current main replaces its draft map. This review did not execute that flow. Is this the best way to solve the issue? Yes. Reusing the authenticated composer store avoids a competing persistence owner, and the additive payload preserves existing records without a database migration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 017146c2b957. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
bd554cf to
7a25c10
Compare
|
Merged via squash.
|
|
Umbrella coordination for #154395: this already-merged PR provides unfinished optional-question draft recovery in the same browser for the authenticated Gateway identity, with seven-day expiry, shared 20-record capacity, and Incognito/deletion privacy. It recovers unfinished drafts only; saved-answer reconstruction is #154312, reversible dismissal is #154692, and outbox delivery/retry remains open in #154486. No state change is needed here. |
Recover unfinished optional-question answers across reloads, reconnects, and conversation navigation using the existing authenticated composer draft store. Keep submitted answers authoritative and preserve deletion, Incognito, and owner-change fences. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: VACInc <[email protected]>
Related: #154395
What Problem This Solves
Fixes unfinished answers disappearing after a refresh, reconnect, or session switch, and being hidden when later work finishes.
User Impact
Users can resume an ordinary optional-question answer without retyping it. Editing protects the question from automatic archival; merely reopening it does not permanently pin it.
Recovery is local to the same browser and authenticated Gateway identity. Switching Gateway or authenticated identity retires the old in-memory owner, so returning cannot bypass a deletion tombstone. Same-owner conversation navigation and reconnect retain the draft. It follows the existing draft store's seven-day expiry and shared 20-record budget; Incognito and conversation deletion retire the saved answers. No migration or user action is required.
Why This Change Was Made
Question drafts now reuse the existing authenticated composer storage and conflict protection. Canonical answers in conversation history remain authoritative, and question content/identity checks prevent a draft from moving to another prompt. Storage failures keep the live answer usable and explain that it was not saved.
Evidence
The saved-answer prerequisite, originally contributed by @jb510, has landed in #154312. This candidate replays only this PR's owned change onto canonical main
c012df06114a927c8aa3d567884f31a63a408b28, preserving the prerequisite and the landed compact/multiline controls.7a25c100af2bda0fc5d092bb6d204702205837d3passed 78 focused unit tests in 8.60 seconds (9.51 seconds whole-command wall), 28 mocked-Gateway/real-IndexedDB browser scenarios in 55.03 seconds, and dependency-cycle inspection with zero cycles. The complete 20-file changed-file check passed at that exact commit in 278.18 seconds with an unchanged clean checkout, including core/UI types, formatting, lint, i18n, ratchets, and dead-export checks. Exact-head hosted CI run35584896136 passed; native completed-evidence preparation accepted that head at 2026-09-21T10:08:13Z.bd554cf9passed 64 focused tests/4 files in 3.04s, 22 mocked-Gateway/real-IndexedDB browser scenarios/2 files in 38.12s, UI types, and type-aware lint. These support the recovered source; they are not a current-head CI claim.5beff9c33cc), verified present in the replay base. The old deletion fixture minted a wall-clock revision that could equal/trail the retirement fence; its replacement edit now advances the observed fence without relaxing assertions or deadlines.Before / after
Review scope
Production LOC: +426/-74 (net +352) | Tests: +611/-12. The growth adds the missing durable question-draft adapter and its typed state while reusing the existing authenticated composer store, CAS, expiry, budget, and deletion owner. A second persistence store or transport owner was rejected because those responsibilities already exist.
Provenance: the pane-only scope-reset behavior was carried forward by 764ea2bffa1 (#144664, 2026-09-11; code author, PR author, and merger @steipete). The original saved-answer contributor @jb510 is credited above for the prerequisite, not blamed for draft loss.