Skip to content

fix(native-chat): add direct Codex model selection - #12657

Open
brennanb2025 wants to merge 3 commits into
mainfrom
brennanb2025/fix-native-chat-model
Open

fix(native-chat): add direct Codex model selection#12657
brennanb2025 wants to merge 3 commits into
mainfrom
brennanb2025/fix-native-chat-model

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

  • expose live Codex model changes as native selectable values in desktop and mobile chat
  • send /model <model-id> directly while retaining bare /model as the agent-picker fallback
  • keep Codex effort changes on the existing terminal-picker path
  • update shared, renderer, and mobile regression coverage

Testing

  • pnpm exec vitest run --config config/vitest.config.ts src/shared/native-chat-session-option-commands.test.ts src/shared/native-chat-session-option-snapshot.test.ts src/renderer/src/components/native-chat/native-chat-pty-session-options.test.ts src/renderer/src/components/native-chat/NativeChatComposer.test.tsx — 64 passed
  • mobile Vitest suite — 3,296 passed, 3 skipped
  • changed-file oxlint — passed
  • root and mobile typechecks — passed
  • Electron QA against a live Codex session — GPT-5.6 Terra selected and confirmed
  • iPhone 17 Pro simulator QA against the same live session — GPT-5.6 Sol selected and confirmed; no Metro redbox/runtime errors

QA screenshots

Desktop — model picker

Desktop native Codex model picker

Desktop — applied model confirmation

Desktop live Codex model confirmation

Mobile — model picker

Mobile native Codex model picker

Mobile — applied model confirmation

Mobile live Codex model confirmation

Follow-up observations

  • the desktop live app returned to terminal view after its selection even though the direct command succeeded
  • after the mobile switch to Sol, the desktop composer pill remained on Terra while the agent state and mobile pill showed Sol

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 716cf336-33b5-4aa1-b1be-9414fb6d8be6

📥 Commits

Reviewing files that changed from the base of the PR and between a9466f0 and aa5032f.

📒 Files selected for processing (2)
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts

📝 Walkthrough

Walkthrough

Codex model selection now sends /model <value> directly during active sessions. Shared option descriptors expose native selectable model values without an agent-picker action. Renderer and mobile tests verify the new command and confirm that model changes do not switch to the terminal. PTY agent exits now validate the foreground process, coordinate stale reads, and restore prior agent status when the agent remains active. Related tests cover these exit conditions.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change, screenshots, and testing, but omits the required AI Review Report and Security Audit sections. Add the AI Review Report and Security Audit sections, including cross-platform compatibility checks and reviewed security risks.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: direct Codex model selection in native chat.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

🧹 Nitpick comments (1)
src/renderer/src/components/native-chat/NativeChatComposer.test.tsx (1)

566-577: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Extend both regression tests beyond command dispatch.

The tests prove that /model gpt-5.5 is sent, but they do not fully prove the user-visible selection outcome.

  • src/renderer/src/components/native-chat/NativeChatComposer.test.tsx#L566-L577: drive the model selector or assert its handler, then verify that onSwitchToTerminal is not called.
  • mobile/src/session/use-mobile-native-chat-session-options.test.ts#L101-L108: assert that the post-selection snapshot reports currentValue: 'gpt-5.5'; cover reported-model reconciliation if this hook owns remote updates.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 276a85f3-bdcb-475a-8b08-e41b32b17bee

📥 Commits

Reviewing files that changed from the base of the PR and between 003114d and a8611e2.

📒 Files selected for processing (7)
  • mobile/src/session/use-mobile-native-chat-controller.ts
  • mobile/src/session/use-mobile-native-chat-session-options.test.ts
  • src/renderer/src/components/native-chat/NativeChatComposer.test.tsx
  • src/renderer/src/components/native-chat/native-chat-pty-session-options.test.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/native-chat-session-option-commands.test.ts
  • src/shared/native-chat-session-option-snapshot.test.ts

@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-native-chat-model branch from 7dc27b7 to a9466f0 Compare August 5, 2026 07:35
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron QA after a9466f0: live Codex model switches complete while the native chat composer remains visible.

Terra:
Native chat remains visible after switching to GPT-5.6 Terra

Sol:
Native chat remains visible after switching to GPT-5.6 Sol

@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: dad303b0-1ab3-488f-86ba-f98212dc3fe3

📥 Commits

Reviewing files that changed from the base of the PR and between a8611e2 and a9466f0.

📒 Files selected for processing (4)
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/shared/agent-title-status.ts
  • src/shared/terminal-output-side-effects.ts

Comment thread src/main/runtime/orca-runtime.ts
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Final-head Electron QA addendum (aa5032f727): the Codex model picker exposes direct model choices, and the applied-state evidence above remains valid because the final follow-up only contains unavailable-foreground-probe handling.

Codex model picker with direct model choices

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.

1 participant