You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(assistant): a judgement draft can close and reopen a topic in the same wake, overriding the user decision — and the notebook prompt still describes the old reopen rule #6388
Two related gaps in the notebook topic lifecycle introduced by #6368:
1. A reopen in the same draft as the close overrides the user's just-expressed decision — and the message goes out in the same wake.commitDraft processes feedbackDecisions (writing closed rules) beforereopened (notebook.ts:369-381), and reopenTopic's guards pass on freshly-written state: the topic is closed ✓ and the draft's own note has a larger seq than the governing feedback ✓. So a judgement draft that contains feedbackDecisions: [close X], a note on X, reopened: [X], and messages: [about X] atomically closes, reopens, and sends the message about X in the same wake — the user just said "stop recommending X" and immediately receives a recommendation about X. The docstring's own rule ("a later message about the topic is still allowed") only holds for feedback from an earlier wake; the validator intercepts reopens without notes and reopens of open topics, but not "closed and reopened within the same draft".
2. NOTEBOOK_RULES was not updated for the new reopen semantics. The prompt (prompt.ts:26) still tells the model reopens must come from "明确用户反馈" (explicit user feedback), while the same commit updated the README and the wake contract: reopening is now the judgement's own call on material change ("只有当用户已关闭或暂缓的主题出现重大变化…时才写 reopened"). The controller's prompt-version hash covers NOTEBOOK_RULES, so existing worker sessions keep receiving the contradictory text until replaced; fresh sessions see rules that can suppress legitimate reopens or prompt the model to invent "user feedback" justifications.
Deterministic reproduction
For (1): feed the commitDraft path a judgement draft carrying a close decision, a note on the same topic, a reopen of it, and a message on it — all four commit atomically and forwardPrepared delivers the message in the same wake; on main nothing rejects the reopen. The fix PR carries this as the regression.
For (2): a first-wake session receives NOTEBOOK_RULES containing the outdated reopen rule alongside the new contract in the per-turn injection — directly observable in the prompt text.
Root cause
(1) is a processing-order gap: the reopen guard validates against state that the same transaction just wrote, without distinguishing "closed by the user earlier" from "closed by this draft". (2) is a missed copy update in the same commit.
Suggested fix
(1) Reject a reopen whose governing feedback was written by the same draft (the commit knows its own operation id / the feedback events it just wrote — require the governing feedback to predate the draft, i.e. the reopen may only reopen topics the user closed in an earlier wake). (2) Update NOTEBOOK_RULES to the material-change wording the README and the per-turn contract already use.
Source
Found by an AI-assisted read-only audit (GLM-5.3-Flash via ZCode) over main@112883c85; the processing order, the reopenTopic guards, and the prompt-version hash coverage were re-verified line by line before filing.
Activity
ggbdpq commentedon Oct 27, 2026
take
fix(assistant): reject same-draft reopens and align rules wording