Repository navigation
feat(session-title): 注入式 Prompt 载荷剥离与历史标题回填,Session 标题恢复业务语义 - #290
Open
ThreeFish-AI wants to merge 4 commits into
Open
ThreeFish-AI wants to merge 4 commits into
ThreeFish-AI wants to merge 4 commits into
Conversation
release(1.x.x): v0.5.2a7 → v0.5.2 —— 流式错误日志乱码修复 / 供应商状态复位 / v0.5.2 周期收口
- 新增注入式模板家族表(记忆压缩/会话命名/分支命名/单命令/通用 You are), 剥离固定话术头、按 User query: 等分隔符截取真实业务载荷,产出 「[家族标签] 载荷」标题;通用家族无分隔符时按真实输入处理防误伤 - task-notification 载荷凝缩:实体解码先行、summary 提取限定通知块内 - 整条通知/续接摘要消息跳过;[Image #N] 与 <pasted_content> 外壳剥离; ide_opened_file 纳入噪声白名单 - 豁免前缀同时作用于清洗文本与注入式标题,命中时逐条跳过 - Level 1 提取重构为 _derive_title_from_user_texts,供请求路径与历史回填共用 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
- 扫描 ~/.claude/projects 转录、复用请求路径同一推导逻辑重算标题, 干跑预览 + sqlite3 backup API 备份后仅回写 session_meta - 读取运行配置:title_exempt_prefixes 透传推导器、title_vendor_bindings 绑定前缀默认并入保护集,避免改写参与供应商绑定的标题 - loader 过滤 isMeta/sidechain/本地 slash 命令记录,有效候选计数上限 - 本机已回填 1807 条:You are a memory... 模板类全部转为 「[记忆压缩] 载荷」等可识别标题 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
This branch has not been deployed
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.
变更摘要
Session 标题提取新增「注入式 Prompt 载荷剥离」能力,并附带基于 Claude Code 转录的历史标题回填脚本,解决 Dashboard Sessions 页 Title 不可识别的问题(
You are a memory...模板 600 字截断 / 无 session_meta 行显示-)。机制层(executor.py)
You are兜底。命中后剥离固定话术头,按User query:/First request:等分隔符截取真实业务载荷,产出[家族标签] 载荷形式标题(如[记忆压缩] Agent "四测 T4 学通迁移" finished);具名家族无分隔符则跳过该条继续查找,通用家族无分隔符按真实输入处理(防误伤手打You are ...的用户消息)。<summary>提取限定在通知块内;无 summary 时剥块取残余文本。[Image #N]占位符与<pasted_content>外壳剥离;ide_opened_file纳入噪声白名单。title_exempt_prefixes)同时作用于清洗文本与派生的注入式标题,命中时逐条跳过而非丢弃 Level 1。_derive_title_from_user_texts,供请求路径与历史回填共用(单一事实源)。回填脚本(scripts/backfill_session_titles.py)
~/.claude/projects/*/<session_id>.jsonl转录,复用请求路径同一推导逻辑重算标题;干跑预览 → sqlite3 backup API 备份 → 仅 UPDATE/INSERTsession_meta,不触碰usage_log。title_exempt_prefixes透传推导器;title_vendor_bindings绑定前缀默认并入保护集,不改写参与供应商绑定的标题。动机
全量数据分析(7986 个活跃 session):24h 窗口 87% 的标题是注入式 Prompt;2268 个可回溯 session 中 82% 首条 user 消息为注入式模板(OpenViking 记忆压缩器子会话 1681 个),真实任务内嵌在模板分隔符之后;1781 个 session 因全层级候选为空从未写入标题。剥离模板头、截取载荷即可恢复业务语义。
验证
风险点
You are家族已通过句界锚定分隔符 + 无分隔符回退真实输入收窄误伤面。