From 18e9a6b9c9024a562879fc69d04496fdcfbd87e4 Mon Sep 17 00:00:00 2001 From: Andy Kang Date: Sun, 31 May 2026 13:31:33 +0900 Subject: [PATCH 1/4] fix: distinguish identical clarify prompts by id --- static/messages.js | 1 + tests/test_sprint30.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/static/messages.js b/static/messages.js index 05dd8d2a6..6fd9f797f 100644 --- a/static/messages.js +++ b/static/messages.js @@ -2989,6 +2989,7 @@ function showClarifyCard(pending) { question, choices, sid: pending._session_id || (S.session && S.session.session_id) || null, + clarify_id: pending.clarify_id || null, }); const card = _ensureClarifyCardDom(); if (!card) return; diff --git a/tests/test_sprint30.py b/tests/test_sprint30.py index f34aac455..5bcdfd449 100644 --- a/tests/test_sprint30.py +++ b/tests/test_sprint30.py @@ -664,3 +664,5 @@ class TestClarifyCardTimerLogic: body = m.group(0) assert 'JSON.stringify' in body, 'showClarifyCard must compute a signature via JSON.stringify' assert '_clarifySignature' in body, 'showClarifyCard must check/set _clarifySignature' + assert 'clarify_id: pending.clarify_id || null' in body, \ + 'showClarifyCard signature must include clarify_id so a newly queued identical prompt is not mistaken for the previous one' From f9ff6df883b8bd2d36c00b1b7f3a3b39cd216597 Mon Sep 17 00:00:00 2001 From: mysoul12138 <839465496@qq.com> Date: Sun, 31 May 2026 13:54:02 +0800 Subject: [PATCH 2/4] fix: prevent browser autofill on clarify input (#clarify-autofill) Chrome's password manager aggressively autofills the clarify card's input field with saved credentials (e.g. provider base URLs) despite autocomplete='off'. This causes two bugs: 1. 'Clarification closed. Your draft was kept in the composer.' appears on every session completion because _stashClarifyDraft reads the autofilled value and treats it as a user draft. 2. The autofilled URL gets injected into the main composer, confusing the user. Fix: add readonly attribute to the clarify input element so Chrome's autofill ignores it. When showClarifyCard() makes the card visible, readonly is removed programmatically so the user can type normally. Both the static HTML (index.html) and the dynamic DOM creation (_ensureClarifyCardDom in messages.js) are patched. --- static/index.html | 2 +- static/messages.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index 5969bde24..07d1ad084 100644 --- a/static/index.html +++ b/static/index.html @@ -496,7 +496,7 @@
- +
Pick a choice, or type your own answer below.
diff --git a/static/messages.js b/static/messages.js index df823092e..dad00ed82 100644 --- a/static/messages.js +++ b/static/messages.js @@ -2834,7 +2834,7 @@ function _ensureClarifyCardDom() {
- +
Please choose one option, or type your own response below.
@@ -3137,6 +3137,7 @@ function showClarifyCard(pending) { if (input) { if (!sameClarify) input.value = ''; input.disabled = false; + input.removeAttribute('readonly'); input.onkeydown = (e) => { if (e.key === 'Enter') { e.preventDefault(); From eddb17028d2d5058fb514f51db066f316aa1109f Mon Sep 17 00:00:00 2001 From: allenliang2022 Date: Sun, 31 May 2026 14:32:48 +0800 Subject: [PATCH 3/4] fix(updates): prevent startup crash on non-UTF-8 (GBK) locales _run_git used subprocess.run(text=True) without an explicit encoding, so on Chinese Windows (and other non-UTF-8 codepages) git stdout was decoded with the locale codepage. _dirty_suffix() runs `git diff --binary HEAD`, whose binary bytes are not valid GBK, raising UnicodeDecodeError in the subprocess reader thread. That left r.stdout = None, so `r.stdout.strip()` raised AttributeError during module import of api.updates, crashing server.py before it could bind its port. Force UTF-8 decoding with errors=replace and guard against None defensively. --- api/updates.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/updates.py b/api/updates.py index 4269e1996..55d0c75a2 100644 --- a/api/updates.py +++ b/api/updates.py @@ -166,9 +166,13 @@ def _run_git(args, cwd, timeout=10): r = subprocess.run( ['git'] + args, cwd=str(cwd), capture_output=True, text=True, timeout=timeout, + encoding='utf-8', errors='replace', ) - stdout = r.stdout.strip() - stderr = r.stderr.strip() + # On non-UTF-8 locales (e.g. Chinese Windows GBK), a binary git + # output that fails to decode used to leave r.stdout = None and crash + # the whole import with AttributeError. Guard against None defensively. + stdout = (r.stdout or '').strip() + stderr = (r.stderr or '').strip() if r.returncode == 0: return stdout, True return stderr or stdout or f"git exited with status {r.returncode}", False From 907b00a44902f500c4427171e8062b1919872e61 Mon Sep 17 00:00:00 2001 From: nesquena-hermes <[email protected]> Date: Sun, 31 May 2026 06:50:40 +0000 Subject: [PATCH 4/4] docs(changelog): v0.51.185 Release FE (stage-batchE) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 971a0bc11..523e8716f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ ## [Unreleased] +## [v0.51.185] — 2026-05-31 — Release FE (stage-batchE — clarify-card bug-fix batch: identical-prompt dedup + autofill guard + GBK startup crash) + +### Fixed +- The clarify popup could remain visible with stale input state after sending a response when the next queued clarification prompt was text-identical to the previous one. The dedupe signature now includes the prompt's `clarify_id`, so a newly queued identical prompt is treated as new instead of being mistaken for the one already answered (#3245, closes #3241). +- Chrome's password manager could autofill the clarify-card input with saved credentials (typically a provider base URL), causing a phantom "Clarification closed" toast on every session completion and injecting the saved URL into the main composer. The clarify input now carries `autocomplete="off"` plus a `readonly` guard that is lifted only when an actual clarification prompt is shown (or on focus), so the browser's heuristic autofill skips it (#3247). +- Prevent a server startup crash on non-UTF-8 Windows locales (e.g. Chinese GBK codepage): `_run_git()` now decodes git subprocess output as UTF-8 with `errors='replace'` and defensively guards against `None` streams, instead of letting a `UnicodeDecodeError` on binary `git diff --binary` output leave `stdout=None` and take down `import api.updates` with an `AttributeError` (#3249). + ## [v0.51.184] — 2026-05-31 — Release FD (stage-batchD — raw audio upload mode + scroll-preserve + non-POSIX test skip) ### Added