2.1 KiB
2.1 KiB
Goal 消息与标题链路
已确认入口
public/app.js:buildMsgElement()把完整消息对象作为meta传给createMsgElement(),适合直接读取ccwebGoalCommand,同时覆盖实时和历史消息。server.js:persistCodexAppGoalDisplayMessage()创建role: user、ccwebDisplayOnly: true、带ccwebGoalCommand.action: 'set'的持久消息,并统一保存会话。server.js:handleCodexAppGoalSlashCommand()在普通消息运行时之前处理/goal,因此不会触发模型主动调用ccweb_set_title。server.js:ensureCodexAppGoalThread()复用codexAppThreadParams();codexAppThreadConfig()会从 runtime MCP 配置写入mcp_servers.ccweb。因此底层 Goal thread 已注册 ccweb MCP,缺口是thread/goal/set本身不是模型工具调用。server.js:普通消息只在标题为New Chat/Untitled时取正文前 60 字并设置titleSource: 'derived'。server.js:setCurrentConversationTitle()展示了session_renamed、publicTitleMetadata()和broadcastSessionList()的实时通知契约;该 MCP 路径使用titleSource: 'llm',不能直接复用其来源语义。server.js:handleRenameSession()将用户标题写为titleSource: 'manual';isTitleLockedByUser()可阻止自动覆盖。server.js:normalizeTitleHistory()只保留source: 'llm',普通derived标题不进入标题历史。
视觉与缓存边界
- 暗金荒野主题 ID 为
wasteland。 - Goal 标签只应命中专用 Goal user message selector,不能扩大到普通
.msg.user。 app.js使用动态__CC_WEB_FRONTEND_ASSET_VERSION__;style.css使用固定 query,CSS 变化后需要推进版本并同步回归断言。
并行工作边界
当前工作树另有 Codex App 重试修复,涉及 lib/codex-app-runtime.js、scripts/mock-codex-app-server.js、scripts/regression.js 及 Trellis 规范文件。实现可在 scripts/regression.js 的 Goal 场景追加断言,但必须保留并发改动,不得重排或还原整文件。