CommandCodeAI / CommandCodeAI/command-code
/learn-taste learns nothing from Codex sessions: extractor only reads legacy event_msg/user_message format
还没有人认领这个 Issue。
- 主要语言
- 没有语言数据
- 星标
- 4k
- 派生
- 350
- PR 合并指标
- 30 天内没有已合并 PR
描述
What happens
/learn-taste (and cmd learn-taste) finds my Codex sessions but learns nothing from them. Taste onboarding ends with "TASTE Skipped", and ~/.commandcode/taste/ stays empty. Projects whose history is Codex-only get zero taste signal.
Environment
- Command Code v1.53.1 (
command-codenpm global,cmdc), Windows 11, PowerShell - Codex CLI 0.154.0, sessions at
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl
Root cause: stale Codex prompt extractor
The session finder works (3-level YYYY/MM/DD walk + rollout-*.jsonl + session_meta.payload.cwd project match). But extractCodexPrompts only accepts lines shaped as:
{ "type": "event_msg", "payload": { "type": "user_message", "message": "..." } }
That shape no longer exists in Codex rollouts. Verified on this machine:
- Newest rollout (Sept 2026): 165 lines, 62
event_msg, 0 withpayload.type: "user_message".event_msgpayloads are onlyitem_completed,token_count,task_started,task_complete. - Search for
"user_message"across all September rollouts: 0 hits. A May 2026 archived rollout: also 0. - Conversation turns now live in
response_itementries:
{ "type": "response_item", "payload": { "type": "message", "role": "user", "content": [{ "type": "input_text", "text": "..." }] } }
(role is user / assistant / developer; user text parts use type: "input_text", assistant uses output_text.)
So extraction always yields [] → nothing to learn.
Suggested fix
In extractCodexPrompts, also handle type: "response_item" with payload.type: "message" and payload.role: "user", joining payload.content[].text for input_text parts. (Note: some role: "user" items are injected context like <environment_context> / skills text — you may want to skip those or let the taste model filter them.)
Secondary issue: case-sensitive cwd match on Windows
The project filter compares session_meta.payload.cwd === projectPath exactly. On Windows, recorded cwd case varies between sessions (e:\development\... vs E:\development\...), so matches are silently missed. Suggest case-insensitive comparison + separator normalization on win32.
Repro
- Have Codex-only history in a project (any recent Codex CLI).
- Run
cmdc, then/learn-taste(orcmdc learn-taste) from that project dir. - Observe: sessions are scanned, but no taste is learned.
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 extractCodexPrompts 开始,跟踪 /learn-taste 和 cmd learn-taste 使用的会话处理逻辑。处理 response_item 条目中的用户消息,然后检查 session_meta.payload.cwd 项目过滤器在 Windows 上的大小写和分隔符差异。完成的标志是,最近的仅 Codex 会话能够生成 taste 输入,并且匹配的项目路径不会在 Windows 上被静默跳过。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- node.js
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 72/100