Repository navigation
Conversation
…ei#3149) dsh's native lane rides the anthropic wire, where the title system prompt sits in the TOP-LEVEL system field while messages[] holds only the user blob. isDshTitleRequest scanned messages[role=system] only (ranxianglei#2503 covered the OpenAI carrier), so the sidecar looked like a main turn: it claimed the raw session anchor and the real conversation forked onto a persisted |sub:<fp> ghost — one dsh session listed twice in the Web UI. Scan every system carrier (anthropic system string/text-block array, responses instructions, google systemInstruction.parts, and system/developer entries inside messages/input) before the prefix match. The no-tools veto and the caller's x-bili-plugin=dsh gate are unchanged.
deshark42
force-pushed
the
2026-10-14_dsh-title-sidecar-anthropic
branch
from
October 14, 2026 08:03
dc319a0 to
a73169c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3149
问题
dsh 原生 lane 走 anthropic 线:标题生成提示词在顶层 `system` 字段,`messages` 里只有人类消息 blob。`isDshTitleRequest` 原本只扫 `messages[role=system]`(#2503/#2554 覆盖的是 OpenAI 形态),于是标题旁路请求被当成主回合:
两条路都会走管线落盘,`walkSessionFiles`(src/web/sessions-data.ts)各列一行 ⇒ 同一个 dsh 会话在 Web UI 显示两行(现场 28 条记录里 11 条是 487 字符的标题提示词幽灵)。标题先到时还有 #2156 的伤害形态:宿主盖章的 `compress`/`acp_status` 按裸 id 路由到标题幽灵的空账本。
修复
`src/server/side-request.ts`:抽出 `systemCarrierTexts()`,对全部系统载体做前缀判定后再决定是否旁路——
前缀常量与 no-tools 否决不变;调用点仍是 handle.ts 的 `pluginAgentHeader === "dsh"` 门控,其它宿主不受影响。
证据 / 测试
与 #2944 v2 的关系
这不是身份阶梯的问题:#2944 的顺序优先解析器(`src/session-resolve.ts`)里,携带 persona tag 的浅 blob 依然会 claim 裸 key(:173-177),tag 变化且历史不延续时依然 fork 到 `|sub:<fp16(tag)>`(:238-240)。本修复的作用是把标题请求挡在解析器之前(`!sideRequestLike` 门),因此与 #2944 正交、在 master 上仍必要。
影响面 / 纪律