a `</think>` reply still names a conversation: the control-token title guard misses the think family
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 86/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- go
- 領域
- cli, documentation, testing
研究方向
Start with titleHasControlTokens, cleanTitle, and healedTitle in internal/session/title.go, then read the existing cases in internal/session/title_test.go. Run the deterministic unit tests and the tmux e2e naming path in internal/e2e. Done means think tags are rejected without rejecting ordinary angle-bracket titles, stored invalid titles fall back to the prompt label, and the manual page and change entry describe the behavior.
由索引模型根據 Issue 內容生成。
描述
What happened
2026-09-21, PR #1071 at 78ddda475 (on dev@49b4a58fb), codeaf against a throwaway home with deepseek/deepseek-v4-pro-0813 through OpenRouter. The naming call for a new conversation came back as a provider control token and it became the conversation's title on the tab, on Home and in the Sessions tab:
<|DSML|notice>
The fix commit on that PR added titleHasControlTokens in internal/session/title.go, which now rejects that family (<|, <|, [im_start], [im_end]) and repairs a stored one through healedTitle. It does not reject </think> or <think>, which contain neither marker. Those are the tokens this project has actually been bitten by before (the reasoning-tag loops behind #308 and the reply guard), from the same providers, so a naming reply of </think> or </think> fix the login bug will still be drawn as a title on every surface.
Replication
Deterministic (no model).
titleHasControlTokens("</think>") returns false today, and cleanTitle("</think> fix the login bug") returns a title that starts with the tag. A table case beside the existing control-token cases in internal/session/title_test.go shows it without a model. Through the real door: the tmux e2e suite's stub model (internal/e2e) answering the naming request with </think> names the conversation </think> on the tab row.
Field (real models).
Any conversation named by a DeepSeek or Qwen model on a day the provider leaks its reasoning close tag; it fires on the naming call, not on the reply, so it costs one short call. No control run needed: the deterministic case is the evidence.
Where
titleHasControlTokens in internal/session/title.go, and its two callers cleanTitle and healedTitle in the same file.
The fix
The guard also rejects <think> and </think> (case-insensitive, with or without surrounding text), on the same terms as the <| family: the reply is unusable, the conversation keeps its prompt label until naming produces a clean phrase, and a stored title carrying one is repaired on the next read. Legitimate titles that merely contain angle brackets (compare <div> and <span> rendering, fix the <T> generic bound) keep passing.
Acceptance
- e2e: through the naming road with a stub model whose title reply is
</think> fix the login bug: the tab row and the Home row show the prompt label, and the captured frame contains no</think>. - e2e: control: a stub reply of
compare <div> and <span> renderingis drawn verbatim on the tab row. - Unit:
titleHasControlTokensis true for</think>,<think>,<|im_start|>and<|DSML|notice>, false for<div>;healedTitleof a stored</think>returns the empty title so the caller falls back to the prompt label. - The manual page that covers conversation names says a reply that is a provider control token is not used as a name, and the change entry's
invalidatesnames what people believed before.
- 主要語言
- Go
- 星號
- 115
- 分支
- 14
- 平均合併
- 13 小時 23 分鐘
- 30 天內合併 PR
- 205
環境準備
我們還沒有檢查這個專案的環境設定檔。先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Agent-Field/CodeAF 的其他 Issue
-
area:chat bug sev:papercut
難度 2/5 1-3 小時 新手友好度 68/100
Agent-Field/CodeAF#1805 ·
維護者通常 1 天內回覆
-
area:session bug sev:papercut
難度 2/5 1-3 小時 新手友好度 82/100
Agent-Field/CodeAF#1779 ·
維護者通常 1 天內回覆
-
area:session bug sev:papercut
難度 2/5 1-3 小時 新手友好度 78/100
Agent-Field/CodeAF#1768 ·
維護者通常 1 天內回覆
-
area:chat bug sev:papercut
難度 2/5 1-3 小時 新手友好度 78/100
Agent-Field/CodeAF#1742 ·
維護者通常 1 天內回覆
-
area:build bug sev:papercut
難度 2/5 1-3 小時 新手友好度 88/100
Agent-Field/CodeAF#1679 ·
維護者通常 1 天內回覆
查看 Agent-Field/CodeAF 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 73/100
prime-radiant-inc/evener#5028 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
-
[BUG] v4.2.9 PostgreSQL 启动迁移失败:DROP INDEX CURRENT_SCHEMA() 语法错误可能已有人在做 @renovate 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
OpenListTeam/OpenList#3267 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
openpubkey/opkssh#670 ·
維護者通常 1 天內回覆