Repository navigation
Conversation
Goal-mode Active-goal/handoff turns land only as response_item final_answer with output_text; the Claude block mapper dropped them, so chat kept the working indicator while goal progress was invisible. Decode those turns, surface thread_goal_updated, and treat goal reinjections as harness noise.
📝 WalkthroughWalkthroughCodex 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c81b2c47-8d8b-4945-90fd-2e9a1c82b4a6
📒 Files selected for processing (4)
src/main/native-chat/transcript-line-decoders-codex.tssrc/main/native-chat/transcript-reader-codex-history-mode.test.tssrc/shared/harness-injected-user-turns.test.tssrc/shared/harness-injected-user-turns.ts
| return null | ||
| } | ||
| return { id, role, blocks, timestamp, source: 'transcript' } | ||
| return codexResponseMessage(payload, id, timestamp) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Apply codexResponseMessage to unwrapped message records.
Line 69 applies phase and duplicate handling only to wrapped response_item payloads. codexUnwrappedResponseItem() still decodes top-level type: "message" records directly. A phase: "commentary" record in that supported format bypasses the new filter and can duplicate its event_msg message.
Route the unwrapped message branch through codexResponseMessage(record, id, timestamp). Add unwrapped commentary and final_answer fixtures.
Proposed fix
function codexUnwrappedResponseItem(
record: Record<string, unknown>,
id: string,
timestamp: number | null
): NativeChatMessage | null {
if (record.type !== 'message') {
return codexResponseItem(record, id, timestamp)
}
- const role = record.role === 'assistant' ? 'assistant' : record.role === 'user' ? 'user' : null
- const blocks = codexTurnItemBlocks(record.content)
- return role && blocks.length > 0 ? { id, role, blocks, timestamp, source: 'transcript' } : null
+ return codexResponseMessage(record, id, timestamp)
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return codexResponseMessage(payload, id, timestamp) | |
| function codexUnwrappedResponseItem( | |
| record: Record<string, unknown>, | |
| id: string, | |
| timestamp: number | null | |
| ): NativeChatMessage | null { | |
| if (record.type !== 'message') { | |
| return codexResponseItem(record, id, timestamp) | |
| } | |
| return codexResponseMessage(record, id, timestamp) | |
| } |
Summary
response_itemmessages withphase: final_answerand Response-APIoutput_textblocks. Those never had anevent_msgtwin, and the shared Claude content mapper droppedoutput_text, so native chat (desktop + mobile) kept the working indicator while goal progress was missing.final_answerviacodexTurnItemBlocks, keep dual-writtencommentaryon theevent_msgpath only, surfacethread_goal_updatedas a systemGoal: …row, and classifycodex_internal_context/goal_contextreinjections as harness noise.nativeChat.subscribe.Evidence
From a live Orca-managed Codex goal session (
rollout-2026-08-11T10-32-53-…jsonl):commentaryassistant turns dual-wrote toevent_msg(already visible)## Active goal,## Handoff summary,## Active orchestration) existed only asresponse_itemfinal_answer+output_textand were previously droppedthread_goal_updatedrender without duplicating commentaryRelated
Emulator QA
orca emulator devices→ empty;orca emulator list→spawn serve-sim ENOENT(no iOS Simulator / no Android AVD in this session). No raw serve-sim invoked.Test plan
pnpm exec vitest run --config config/vitest.config.ts src/main/native-chat/transcript-reader-codex-history-mode.test.ts src/main/native-chat/transcript-reader.test.ts src/shared/harness-injected-user-turns.test.tspnpm exec oxlinton touched filespnpm run check:max-lines-ratchetgit diff --check/goalsession; confirm Active-goal digests and Goal: system row appear while agent is working