CommandCodeAI / CommandCodeAI/command-code

/learn-taste learns nothing from Codex sessions: extractor only reads legacy event_msg/user_message format

未关闭
#847 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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-code npm 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 with payload.type: "user_message". event_msg payloads are only item_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_item entries:
{ "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

  1. Have Codex-only history in a project (any recent Codex CLI).
  2. Run cmdc, then /learn-taste (or cmdc learn-taste) from that project dir.
  3. Observe: sessions are scanned, but no taste is learned.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。