Repository navigation
Conversation
📝 WalkthroughWalkthroughCodex model discovery now parses and exposes service-tier metadata through runtime capability schemas. Native chat converts discovered capabilities into dynamic Codex catalog options, including reasoning effort and Fast mode, with authoritative option merging. Enrichment retries after empty or failed probes and isolates results by host. Native chat toggle controls now display descriptions, and single-option pill labels use the option’s localized name. Tests cover local, remote, runtime, catalog, enrichment, and UI behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 2
🧹 Nitpick comments (1)
src/shared/agent-session-option-catalog-claude-codex.ts (1)
121-163: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated
applyblock betweencodexEffortandcodexDiscoveredEffort.The
applyobject (launchArgs/agentArgsOverride/midSession) is identical in both functions. Extracting a shared constant would prevent the two from silently diverging later.♻️ Proposed refactor
+const CODEX_EFFORT_APPLY: CatalogOption['apply'] = { + launchArgs: (value) => ['-c', `model_reasoning_effort=${String(value)}`], + agentArgsOverride: hasCodexEffortOverride, + midSession: { kind: 'agent-picker', command: '/model' } +} + function codexEffort(includeExtraHigh: boolean): CatalogOption { return { ... - apply: { - launchArgs: (value) => ['-c', `model_reasoning_effort=${String(value)}`], - agentArgsOverride: hasCodexEffortOverride, - midSession: { kind: 'agent-picker', command: '/model' } - } + apply: CODEX_EFFORT_APPLY } } function codexDiscoveredEffort(model: CommitMessageModelCapability): CatalogOption | null { ... - apply: { - launchArgs: (value) => ['-c', `model_reasoning_effort=${String(value)}`], - agentArgsOverride: hasCodexEffortOverride, - midSession: { kind: 'agent-picker', command: '/model' } - } + apply: CODEX_EFFORT_APPLY } }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4330cfd4-3c3d-4482-a9d4-d185ff24bda0
📥 Commits
Reviewing files that changed from the base of the PR and between 5610142 and 4e19f7377f1d753383bc334ae7cf424c2fdff806.
⛔ Files ignored due to path filters (1)
docs/assets/codex-fast-mode.pngis excluded by!**/*.png
📒 Files selected for processing (18)
src/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/text-generation/commit-message-text-generation.test.tssrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsxsrc/renderer/src/components/native-chat/native-chat-pty-session-options.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-discovery.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.tssrc/renderer/src/components/native-chat/native-chat-session-option-labels.tssrc/renderer/src/runtime/runtime-git-client.test.tssrc/shared/agent-session-option-catalog-claude-codex.tssrc/shared/agent-session-option-catalog-types.tssrc/shared/agent-session-option-catalog.test.tssrc/shared/agent-session-option-catalog.tssrc/shared/commit-message-agent-spec.test.tssrc/shared/commit-message-agent-spec.tssrc/shared/types.ts
|
reviewing |
|
Following up on this PR — I've addressed all actionable CodeRabbit feedback (casing fix in 8e1cad5c and the empty-discovery guard with a regression test). Happy to make further adjustments based on your review. Also noting that the PR Checks workflow needs maintainer approval to run (first-time external contributor). Could someone approve the workflow so CI can execute? I'll keep the branch rebased on main in the meantime. |
Deduplicate the identical apply block between codexEffort and codexDiscoveredEffort so the two cannot silently diverge. Constraint: CodeRabbit nitpick — duplicated apply object Confidence: high Scope-risk: narrow Tested: local typecheck Not-tested: full test suite (no local pnpm install)
8e1cad5 to
3e4c25a
Compare
Greptile SummaryThis PR adds a capability-gated Fast mode to Orca's Codex native-chat model picker. It runs
Confidence Score: 5/5Safe to merge; all capability paths are guarded, discovery failures back off correctly, and the seed effort picker is preserved when the CLI only reports a Fast tier. The two concerns raised in the previous round — unbounded discovery retries and silent loss of the seed effort picker on fast-only discovery — are both addressed cleanly. The backoff state machine is straightforward and well-tested. No logic issues were found in the merge, parse, or UI paths during this review. Files Needing Attention: The JSDoc on
|
| Filename | Overview |
|---|---|
| src/shared/agent-session-option-catalog-claude-codex.ts | Adds codexCatalogModelFromCapability, codexDiscoveredFastMode, and codexDiscoveredEffort; correctly gates optionsAuthoritative on effort presence only, fixing the previous concern about fast-only discovery silently dropping the seed effort picker. |
| src/shared/agent-session-option-catalog.ts | Adds mergeOptionsById helper and updates mergeCatalogModels to respect optionsAuthoritative; non-authoritative discovered models now augment seed options rather than replace them. |
| src/shared/agent-session-option-catalog-types.ts | Adds optionsAuthoritative field to CatalogModel; the JSDoc comment does not match the implementation which only sets it true when effort levels were discovered. |
| src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts | Adds exponential backoff (200ms base, 30s cap) for failed discovery with consecutiveFailures tracking; correctly transitions state to idle on failure to allow future retries after the backoff window. |
| src/shared/commit-message-agent-spec.ts | Adds parseModelServiceTiers with correct filtering of malformed/blank entries and maps Codex CLI name field to label; serviceTiers propagated through CommitMessageModel and CommitMessageModelCapability. |
| src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts | Replaces the previous stub (options: []) with catalogModelFromDiscoveredCapability, correctly routing codex to capability-aware construction and other agents to the simple form. |
| src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx | Toggle-command menu items now use ChoiceBody to render provider descriptions alongside the label; case-lowering removed so labels display with correct capitalisation. |
| src/renderer/src/components/native-chat/native-chat-session-option-labels.ts | nativeChatOptionsPillTitle/Label now use the single descriptor's label when no effort descriptor exists, so a Fast-only picker shows 'Fast mode' instead of the generic 'Session options'. |
| src/main/runtime/rpc/methods/git-params.ts | Zod schema for CommitMessageModelCapability extended with optional serviceTiers array, keeping RPC backward-compatible with older peers. |
| src/shared/types.ts | CommitMessageAiModelCapability extended with serviceTiers in the shared types file, consistent with other capability-related changes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([Native-chat surface opens]) --> B{catalog.listModels\npresent?}
B -- No --> C([Use static seed catalog])
B -- Yes --> D{enrichmentByAgentHost\nstate for agent+host?}
D -- pending / settled --> C
D -- idle, retryAfter > now --> C
D -- idle, retryAfter <= now --> E[Set state = pending\nspawn codex debug models]
E --> F{Result?}
F -- non-empty --> G[parseCodexCatalogModels\ncreate CatalogModel per capability]
G --> H{optionsAuthoritative?}
H -- true: effort discovered --> I[Replace seed options\nwith CLI options]
H -- false: fast-only or none --> J[mergeOptionsById:\naugment seed with discovered]
I --> K[Notify listeners\nstate = settled]
J --> K
F -- empty or error --> L[consecutiveFailures++\nretryAfter = now + backoffDelay\nstate = idle]
L --> C
Reviews (2): Last reviewed commit: "fix(native-chat): add discovery backoff ..." | Re-trigger Greptile
…ast-only discovery Address two Greptile P2 findings: 1. Enrichment resets to idle on failure/empty with no backoff, so a caller that retries immediately spins in a tight loop. Add exponential backoff (200ms base, 30s cap) so persistent failures don't hammer discovery while transient blips still recover quickly. 2. optionsAuthoritative is set true whenever any option is discovered, even if only a Fast tier was found. This causes mergeCatalogModels to replace the seed effort picker entirely. Only mark authoritative when effort levels were actually discovered; for Fast-only results, augment the seed options instead of replacing them. Constraint: Greptile P2 findings — no backoff + silent seed drop Rejected: capping retry count instead of backoff | backoff recovers transient failures while capping gives up permanently Confidence: high Scope-risk: narrow Tested: 20 focused tests pass (catalog + enrichment), 32 shared spec tests pass Not-tested: renderer component tests need path-alias resolution not available in this shallow clone
Summary
codex debug models, so the selected model exposes only capabilities reported by the installed CLI./fasttoggle.Screenshots
Captured from Orca's Electron UI with a deterministic Codex capability fixture.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildCompleted checks:
pnpm run typecheck: all three TypeScript targets passed.git diff --checkpassed.pnpm run build:desktoppassed./fastcommand.Environment limitations:
pnpm lintreached only pre-existing localization-catalog failures in unrelated workspace/sidebar components; this PR adds no translation key.pnpm testencountered unrelated sandbox socket/daemon failures; the focused affected suites pass.pnpm buildcompleted the desktop build, then the native Swift package was blocked by the local CommandLineTools/SDK Swift version mismatch and unavailable user cache paths.AI Review Report
Debugger, project-manager, and UI/UX reviews each reached 10/10 after fixes. The review explicitly checked:
Issues found and resolved during review included stable-ID gating to avoid label false positives, malformed service-tier filtering, retry after transient discovery failures, host isolation, transport/RPC coverage, visible provider descriptions, and an accessible Fast-only label.
Security Audit
codex debug modelsoutput as untrusted JSON and filters malformed, null, or blank capability entries.No security follow-up is required.
Notes
priorityorfastservice-tier ID./fast; launch-time Fast selection is intentionally outside this scoped change.ELI5
Codex can run in a Fast mode. Orca learns what your installed Codex CLI supports and shows a Fast toggle in the model picker when it is available. That works locally, over SSH, and on paired runtimes.