feat(ui): Agent 头像/头衔可编辑、回调会话路由修复、消息气泡折叠与 i18n 回退修复 - #331
Merged
Merged
Conversation
头像(Team Chat 顶部):
- 顶部 Agent 头像改为可点击上传(复用既有 AvatarUpload,targetType=agent)
- 上传成功后乐观写入本地 agents,顶部/L1/L2 同帧换图,不再等 GET /api/agents 全量刷新
- 上传中强制常显遮罩+转圈(原 opacity-0 group-hover 会把反馈藏掉)
- 点击外部 / Esc 关闭浮层;补齐 zh-CN/en/es 文案
头像缓存:
- 上传返回带 ?v=<时间戳> 的版本化 URL,避免同名文件命中一年期 immutable 缓存
- 头像响应改为 no-cache(serveStaticFile 支持覆盖),存量无版本号 URL 也能即时刷新
- 带哈希的静态资源仍保持 immutable
Agent 头衔:
- 新增 AgentProfile.displayTitle,持久化到本 Agent 的 profile JSON
- PATCH /api/agents/:id/config 接受 title,两个 GET 读取覆盖
- 前端保存目标仅改一处;不写共享角色模板,避免串改其他 Agent
回调会话路由(callback_result):
- TurnSessionHint 补第五种 kind:'memory'(显式表达继续某内存会话)
- deliverCallback 在 in_session 投递时写入 extra.sessionHint,不再让下游猜
- resolveTurnSession 新增 memory 分支;解析失败则告警并保持当前会话
- 消费端删除 sys_${id}_${ts} 自造兜底,只在 origin 已知时传 sessionId
消息气泡渲染:
- 工具调用失败不再把图标变警告(收敛为两态 running/done),失败次数保留在文字中
- 流式结束后,最终正文之前的过程块(中间正文/思考/工具行)折叠为一行「已工作 N 秒 / N 分 N 秒」,可展开收起
- 流式期间不折叠;单正文简单回复不折叠;无正文块不折叠
i18n:
- react.i18n nsMode 设为 'fallback',修复 useTranslation([...]) 只绑 namespaces[0] 导致 team/common 回退链失效、渲染出 execution.workedForMinutes 这类 key
- formatWorkedFor 改用显式 common: 前缀,不依赖调用方绑定的 ns
- 清理 AgentProfile 未使用的 AvatarUpload 导入及死键 processRun.state.error
验证:
- pnpm typecheck 通过
- 全量测试 5718 passed;唯一失败 packages/cli/test/commands-start-integration.test.ts > auto-runs quickInit(60s 超时),已在 HEAD a004a3d 干净基线上复现同样失败,确认与本批改动无关
- 新增回归测试:回调投递必须表态 memory、无 origin 时绝不出现 sys_*、二次上传 URL 必须变化、头像响应不得含 immutable、上传挂起时遮罩常显、耗时文案三语可译
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.
头像(Team Chat 顶部):
头像缓存:
Agent 头衔:
回调会话路由(callback_result):
消息气泡渲染:
i18n:
验证: