Skip to content

fix(native-chat): show Codex goal-mode digests (mobile empty transcript) - #13985

Open
OrcaWin wants to merge 1 commit into
stablyai:mainfrom
OrcaWin:OrcaWin/gh-13629
Open

OrcaWin wants to merge 1 commit into
stablyai:mainfrom
OrcaWin:OrcaWin/gh-13629

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Codex goal mode writes Active-goal / handoff digests as response_item messages with phase: final_answer and Response-API output_text blocks. Those never had an event_msg twin, and the shared Claude content mapper dropped output_text, so native chat (desktop + mobile) kept the working indicator while goal progress was missing.
  • Decode final_answer via codexTurnItemBlocks, keep dual-written commentary on the event_msg path only, surface thread_goal_updated as a system Goal: … row, and classify codex_internal_context / goal_context reinjections as harness noise.
  • Decoder-only; no RPC/opcode/wire shape changes. Shared by desktop IPC and mobile nativeChat.subscribe.

Evidence

From a live Orca-managed Codex goal session (rollout-2026-08-11T10-32-53-…jsonl):

  • 80 commentary assistant turns dual-wrote to event_msg (already visible)
  • 4 goal digests (## Active goal, ## Handoff summary, ## Active orchestration) existed only as response_item final_answer + output_text and were previously dropped
  • Fixture regression now asserts goal digests + thread_goal_updated render without duplicating commentary

Related

Emulator QA

  • Windows host: 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.
  • Validation is fixture + unit tests on the shared host decoder used by mobile RPC.

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.ts
  • pnpm exec oxlint on touched files
  • pnpm run check:max-lines-ratchet
  • git diff --check
  • Manual: pair mobile to a host with an active Codex /goal session; confirm Active-goal digests and Goal: system row appear while agent is working

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.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Codex response_item messages now use dedicated decoding. Commentary duplicates and copied Response-API text are filtered, while final-answer content is retained. thread_goal_updated events now produce trimmed system messages. Goal-mode transcript tests cover these behaviors. Harness detection now supports underscores and recognizes codex_internal_context and goal_context as injected turns.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the native-chat fix for displaying Codex goal-mode digests and the mobile empty-transcript issue.
Description check ✅ Passed The description explains the problem, implementation, linked issue, testing, and platform limitations, but omits several template headings and checklist details.
Linked Issues check ✅ Passed The decoder changes address issue #13629 by exposing Codex goal digests and goal updates through the shared mobile transcript path.
Out of Scope Changes check ✅ Passed The changes remain focused on Codex transcript decoding, goal-update rendering, duplicate filtering, and related harness-noise classification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fd2afc1 and 6b2a12a.

📒 Files selected for processing (4)
  • src/main/native-chat/transcript-line-decoders-codex.ts
  • src/main/native-chat/transcript-reader-codex-history-mode.test.ts
  • src/shared/harness-injected-user-turns.test.ts
  • src/shared/harness-injected-user-turns.ts

return null
}
return { id, role, blocks, timestamp, source: 'transcript' }
return codexResponseMessage(payload, id, timestamp)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
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)
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile: Codex goal mode shows only “agent is working” (no transcript content)

1 participant