Repository navigation
feat(antigravity): 透传通道写入会话标题,Sessions 页 Title 列不再显示「–」 - #331
Merged
Merged
Conversation
信封解析带出首个 user 回合文本与客户端标题(只采证);新增 title.py 只认 <USER_REQUEST> 壳内文本成题,COMPACTED_HISTORY / 未知 XML 块 / 裸文本一律 不成题并记 DEBUG 原因码;标题在响应后的记账路径写入,写失败只记 WARNING; 会话 key 日志前缀经安全字符净化;title_exempt_prefixes 经 create_app 注入 gateway,不接 title_vendor_bindings。 🤖 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>
user-guide §4.8 补 Title 列来源与不成题形态;api-reference §14 与 config-reference §11.1/§12 注明标题写入与两键作用域(title_vendor_bindings 仅路由链、title_exempt_prefixes 双通道);testing.md §2.8 登记 test_antigravity_gateway.py。 🤖 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 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.
摘要
Antigravity 透传会话在 Dashboard Sessions 页的 Title 列恒显示「–」:
session_meta.title的唯一写者在路由链(_RouteExecutor._maybe_write_session_title),antigravity_gateway透传通道只旁路取 model 与会话 key 记账,从不写标题。用量库实证:antigravity 会话 4 个、有标题 0 个(cc 会话 13582 个、有标题 11835 个)。本 PR 让透传通道在响应后的记账路径写入会话标题,CC 链路零改动。实现
RequestEnvelope增user_texts(首个 user 回合的文本 part,role 缺省按 user 语义)、client_title(信封里Conversation ID: <uuid>, Title: <title>的客户端标题,只采证记 DEBUG 长度,不写入)、content_roles(无 user 文本时的 role 分布,取证用)与log_key(会话 key 前 12 位的日志安全形态;②③级回退 key 取自客户端 requestId,可含换行,防日志伪造)。<USER_REQUEST>开头且闭合的壳内文本成题;<COMPACTED_HISTORY>(压缩后首见的会话)、未知 XML 块、裸文本(sub-agent 父 prompt、系统提醒等)一律不成题,只记 DEBUG 原因码(COMPACTED_HISTORY_BLOCK/XML_BLOCK:<tag>/BARE_TEXT/NO_USER_CONTENT roles=…)。候选交给与 CC 链路同一个_derive_title_from_user_texts(600 字上限、空白折叠、title_exempt_prefixes豁免),单一事实源。title_exempt_prefixes(二次归一化存 tuple);标题写入放在响应后的记账路径(_record_usage/_record_failure),流式 finally、非流式、上游 502、读体断连四处覆盖,数据库争用不占转发延迟;写失败只记 WARNING(异常类型名 +log_key),不影响透传与记账;title_vendor_bindings不接入(透传会话没有路由可绑)。config.session_policies.title_exempt_prefixes(热切换随 generation 重建生效)。title_vendor_bindings仅路由链;title_exempt_prefixes双通道)。标题取的是用户首条请求
<USER_REQUEST>壳内的原文(本机首回合中位数约 211 字符),与 CC 会话同为「用户首轮原文」口径,152px 列宽下悬停看全文。明确不做与后续 Issue
dev: · acct:行、对透传会话无效的 Model Bind 下拉)验证
tests/test_antigravity_gateway.py69 项(原 33 + 新增 36):信封收集边界、标题准入规则、handler 四分支写标题、写失败降级、日志净化、落库后/api/dashboard/sessions返回 title、豁免前缀接线。pytest2320 passed / 17 deselected;ruff check与ruff format --check全绿。CODING_PROXY_HOME+ mock 上游,不碰 :3392):带壳会话 Sessions 页 Title 显示标题、无壳会话保持「–」,API 与截图双确认。风险点
<USER_REQUEST>壳形态来自本机客户端 transcript 与客户端二进制静态字符串(系统提示模板明示该包裹),发布后需真机核对(Antigravity 透传会话在 Sessions 页无标题:修复已实施,待发布后真机验证 #330 回访清单);准入规则 fail-closed,识别不了的形态保持「–」而不是写垃圾标题。任务台账:
docs/.agents/issue.mdI-017。🤖 Generated with Claude Code