0102a973a3
The first-round title guard compared the pre-RPC snapshot, so append_consultation_question had already rewritten the title and the model name never landed. Co-authored-by: Cursor <cursoragent@cursor.com>
42 lines
1.9 KiB
Markdown
42 lines
1.9 KiB
Markdown
# PROGRESS · 会话标题守卫写库(BUG-557)(2026-09-06)
|
||
|
||
工作树:`.worktrees/session-title-guard-fix-20260906`
|
||
分支:`codex/session-title-guard-fix-20260906`
|
||
基线:`origin/staging` @ `e2d6f203`(含任务书;代码基线 `e2f4b55c`)。
|
||
|
||
未改迁移、未改客户端、未改 `session-title-agent.ts`、未 bump Skill。本单不加 SQL。
|
||
|
||
| 任务 | 状态 | BUG |
|
||
| --- | --- | --- |
|
||
| 5.1 守卫取 RPC 后标题 | 完成 | BUG-557 |
|
||
| 5.2 BUG_HISTORY / CHANGELOG / testing | 完成 | — |
|
||
|
||
## 实现要点
|
||
|
||
- `shouldGenerateSessionTitle` 仍用 RPC 前的 `chatSession.title`,避免 ≤14 字问题被当成手改标题。
|
||
- `append_consultation_question` 成功后再 `select("title")`。
|
||
- 写入走 `persistGuardedSessionTitle`:`.eq("title", titleAfterRpc)` + `.select("id")`;0 行 `console.warn("session title guard missed")`。流事件仍返回 `session.title`。
|
||
|
||
## 既有断言改动
|
||
|
||
| 文件 | 原值 | 新值 | 原因 |
|
||
| --- | --- | --- | --- |
|
||
| `application-billing-contract` | 只锁 consult select 含 `title` | 另锁守卫用 `titleAfterRpc` | BUG-557 |
|
||
|
||
## 测试
|
||
|
||
| 命令 | 结果 |
|
||
| --- | --- |
|
||
| `npx tsx --test tests/session-title-persist-contract.test.ts tests/application-billing-contract.test.ts tests/session-title-agent.test.ts` | 17 pass / 0 fail |
|
||
| `./node_modules/.bin/tsc --noEmit` | 0 错 |
|
||
| 改动文件 `eslint --quiet` | 0 error |
|
||
|
||
## SQL(本单未改;清点给产品)
|
||
|
||
相对上次有记录的 staging 部署树 `afd14948`,仓里还多出两份未随本单应用的迁移,部署前仍要跑 Gitea **Migrate Staging Database**:
|
||
|
||
1. `20260905010000_personal_report_longform_appendices.sql`(`bab07187`,全量附录表)
|
||
2. `20260906010000_chat_session_context_summary.sql`(`bf8ad0d1`,`chat_sessions.context_summary`)
|
||
|
||
本机无 staging 库口令,不能读 `migration.schema_migrations` 做现场核对。
|