fix(session): 修复 /session 标题长期为 New Session,并统一单行展示#534
fix(session): 修复 /session 标题长期为 New Session,并统一单行展示#534pionxe merged 3 commits into1024XEngineer:mainfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| summaries, err := s.sessionStore.ListSummaries(ctx) | ||
| if err != nil { | ||
| return nil, err | ||
| } |
There was a problem hiding this comment.
ListSessions now conditionally calls LoadSession per default-titled summary, which introduces an N+1 read pattern (ListSummaries + up to N LoadSession calls). On larger history sets this can noticeably increase latency for opening the session picker. Consider deriving a promotable title at write time only (already done in InputPreparer) or adding a batched store API for title backfill instead of per-row loads in list path.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
还有没有要改的 |
|
@xgopilot 请你帮我分析当前pr的修改会不会导致出现TUI绕过Gateway直连Runtime的风险?以及是否存在冗杂函数或没有复用已有函数的情况? |
结论
发现的问题(按严重度)
关于你关心的“绕过 Gateway”
|
|
/code 请提高测试覆盖率到百分之百,并提交pr到对应的fork分支 |
处理结果已按本次 PR 变更点补充覆盖测试并完成提交,新增覆盖主要针对:
已执行验证
提交信息
未完成项说明尝试将提交直接推送到你指定的 fork 分支 |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: creatang <165447160+creatang@users.noreply.github.com>
test(pr-534): improve coverage for session title backfill branches
背景
/session列表中大量会话标题显示为New Session,且部分会话标题会出现多行显示,影响会话识别与选择效率。根因
New Session建档,但后续缺少稳定的“标题回填”机制。TrimSpace,未折叠换行/制表符,导致列表出现多行标题。变更内容
New Session且存在有效用户输入时,自动将标题提升为首条有效用户文本摘要。/sessionpicker 渲染层做二次兜底,确保历史脏数据也只展示单行。影响范围
internal/sessioninternal/runtimeinternal/tui/core/app测试
已补充并通过相关单测:
本地验证:
go test ./internal/sessiongo test ./internal/tui/core/app -run ...go build ./cmd/neocode