fix: preserve clarify drafts on timeout#1216
fix: preserve clarify drafts on timeout#1216sixianli wants to merge 3 commits intonesquena:masterfrom
Conversation
|
Thanks for the detailed PR, @sixianli! This addresses a real UX pain point — losing a long typed draft after a silent timeout is frustrating, and making the deadline visible + preserving the draft on expiry is the right fix. Overall assessment: well-scoped and thoughtfully implemented. A few things to verify before merge: Timeout metadata source Draft preservation — edge cases
Full test suite Minor nib Once the full test suite passes and the edge cases above are confirmed, this looks close to ready. Happy to do a follow-up review pass! |
|
Thanks for the follow-up commits, @sixianli! Two new additions since the last review:
The PR is looking solid across For the countdown steady fix specifically: is the issue timer drift (e.g. The PR is shaping up well — appreciate the iterative polish! |
|
I pushed two follow-up commits after the review feedback:
Timeout metadata sourceConfirmed. The timeout metadata is populated server-side in
The frontend only consumes those fields. It uses Draft preservation edge casesConfirmed and covered with follow-up tests. If the main composer already contains text, the clarify draft is appended with a blank-line separator instead of replacing the existing composer value. Explicit user actions do not trigger draft preservation:
Draft preservation is limited to timeout / terminal closure paths, not explicit submit or cancel paths. Countdown accessibilityThe urgent countdown state now has a non-color visual cue as well as the error color. I added a regression test to make sure the urgent styling is not color-only. Additional countdown fix found during manual testingWhile testing the deployed PR build, we found one more countdown issue. The pending clarify poll refreshes the same prompt every ~1.5s, and the previous implementation restarted the countdown interval on each refresh. That could make the visible countdown jump by two numbers within one second. Fixed in VerificationTargeted regression checks:
Full suite: I ran the full suite in a detached
The remaining failure is:
I reproduced that same failure on Manual verification:
|
|
Thanks for the detailed follow-up, @sixianli! The two additional commits address the remaining review feedback thoroughly. Timeout metadata source (confirmed): Good to have the explicit confirmation that Draft preservation edge cases (confirmed):
Countdown accessibility (confirmed): Non-color visual cue added alongside the error color for the urgent state, with regression coverage. Good. Countdown stability fix ( 88 passed on the targeted test modules and the full suite at 1 failed / 2791 passed. The remaining failure ( This looks ready for maintainer review and merge. Great thorough work on the follow-ups! 🎉 |
Thinking Path
What Changed
requested_attimeout_secondsexpires_atWhy It Matters
Open-ended clarify prompts are often used for higher-value input, such as describing an idea or clarifying intent. Losing that draft after a hidden timeout is frustrating and can interrupt the user's thought process.
With this change, users can see the timeout risk before it happens, and their typed draft remains available in the main composer if the clarify prompt expires.
Screenshots
Before: clarify prompt had no visible timeout.
After: clarify prompt shows a visible countdown.
After timeout/close: unsent clarify draft is preserved in the main composer.
Verification
uv run --with pytest pytest tests/test_clarify_unblock.py tests/test_sprint30.py -quv run --with ruff ruff check api/clarify.py tests/test_clarify_unblock.py tests/test_sprint30.pygit --no-pager diff --checkRisks / Follow-ups
pytest tests/ -v --timeout=60has not been run yet.Model Used
Provider: OpenAI
Model: GPT-5 via Codex desktop
Notable tool use: local shell, SSH deployment to a Linux test host, Git, targeted pytest/ruff verification