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 摘要。