Skip to content

feat(codex): add account picker visibility setting - #1096

Open
chrisae9 wants to merge 1 commit into
lidge-jun:devfrom
chrisae9:split/1019-01-picker-setting
Open

feat(codex): add account picker visibility setting#1096
chrisae9 wants to merge 1 commit into
lidge-jun:devfrom
chrisae9:split/1019-01-picker-setting

Conversation

@chrisae9

@chrisae9 chrisae9 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the optional codexAccountPickerEnabled config field without changing fresh defaults
  • preserve the existing behavior implied by a non-empty hand-written selector map when the field is omitted
  • degrade malformed persisted values to false without discarding providers, accounts, or selector bindings
  • reject malformed, inherited, or accessor-backed live values without invoking getters
  • keep exact account-qualified routing independent from picker visibility

This is the first slice from #1019 after the requested split. It intentionally establishes only the setting contract and pure default resolver. Selector initialization, catalog convergence, and management API/dashboard behavior follow in separate PRs after their dependencies land.

Part of #425.

Verification

  • rebased onto dev@e9d957bf
  • feature suite: 197 passed (config, namespace, router, and Codex injection coverage)
  • latest upstream delta: corrected composed-acceptance suite 6 passed; the preceding integration suites passed 228 tests
  • bun run typecheck
  • bun run privacy:scan
  • bun test tests/repo-hygiene.test.ts
  • node --test .github/scripts/pr-sponsored-surface.test.cjs
  • git diff --check upstream/dev...HEAD
  • canonical full-suite run on the preceding rebased head: 9,226 passed, 10 skipped, with one unrelated order-dependent native-profile test failure; that complete test file passes 3/3 in isolation. Exact-head GitHub CI is pending.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features

    • Added an optional setting to control visibility of account-qualified Codex models.
    • Existing account selector configurations remain visible by default for compatibility.
    • Account-qualified models continue routing to the configured Codex account and namespace when the picker is hidden.
  • Bug Fixes

    • Invalid configuration values now fail safely, preserve other settings, and provide warnings.
    • Configuration validation rejects non-boolean picker values and malformed configuration entries.
    • Improved handling of configuration updates to prevent invalid picker settings from being saved.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ed6dc5e4-e6e9-4546-8ef7-390dc157ed0b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds optional codexAccountPickerEnabled support. Populated namespace maps remain enabled by default. Explicit false hides picker rows. Malformed persisted values fail closed. Account-qualified routing remains unchanged.

Changes

Account picker control

Layer / File(s) Summary
Picker visibility contract
src/types.ts, src/codex/account-namespaces.ts, tests/codex-account-namespaces.test.ts
OcxConfig adds the optional flag. codexAccountPickerEnabled enables picker rows when the flag is unset or true and the namespace map is populated. Tests cover overrides, empty maps, missing maps, and malformed values.
Configuration persistence and validation
src/config.ts, tests/config.test.ts
Config parsing converts malformed persisted values to false and emits warnings and diagnostics. Candidate validation accepts omission or undefined. It rejects invalid, inherited, and accessor properties.
Routing behavior verification
tests/router.test.ts
Routing preserves the OpenAI provider, model ID, account ID, namespace, pool mode, and forwarded authentication when picker visibility is disabled.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Config
  participant codexAccountPickerEnabled
  participant AccountQualifiedCatalog
  participant ConfiguredCodexAccount
  Config->>codexAccountPickerEnabled: Provide picker flag and namespace map
  codexAccountPickerEnabled-->>AccountQualifiedCatalog: Return picker visibility
  AccountQualifiedCatalog->>ConfiguredCodexAccount: Route account-qualified native model
  ConfiguredCodexAccount-->>AccountQualifiedCatalog: Preserve account, namespace, and authentication
Loading

Possibly related PRs

Suggested reviewers: wibias, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a Codex account picker visibility setting.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 6, 2026
@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 02:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7953272eca

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/codex/account-namespaces.ts
Comment thread src/types.ts
@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 03:28
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 7953272 to de6e0aa Compare August 6, 2026 03:29
@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 03:48
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/router.test.ts`:
- Around line 134-140: Expand the assertion for routeModel when
codexAccountPickerEnabled is false to also verify codexAccountMode is "pool" and
provider.authMode is "forward", preserving the existing provider, model, account
ID, and namespace checks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 39991cf9-2ce1-462c-b975-6447b6690682

📥 Commits

Reviewing files that changed from the base of the PR and between 7425855 and de6e0aa.

📒 Files selected for processing (6)
  • src/codex/account-namespaces.ts
  • src/config.ts
  • src/types.ts
  • tests/codex-account-namespaces.test.ts
  • tests/config.test.ts
  • tests/router.test.ts

Comment thread tests/router.test.ts
@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 03:50
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from de6e0aa to ce32336 Compare August 6, 2026 04:07
@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 04:08
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 04:18
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from ce32336 to e62ff78 Compare August 6, 2026 05:02
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

4/4 boxes ticked.

This pull request is already Ready for Review.
CodeRabbit/Codex review was requested via the review-ready label. If no review appears, comment @coderabbitai review to request one.
Maintainers: @lidge-jun @Ingwannu @Wibias

@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 05:05
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The pull request is marked ready. I will review the changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The pull request is ready for review. I will review the changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 05:15
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from e62ff78 to a44af1f Compare August 6, 2026 05:18
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1096 at head 8dc372258d26c5211cd82e906b86461a7ab21aad.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 11:43
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 8dc3722 to 283fc83 Compare August 6, 2026 11:44
@chrisae9
chrisae9 marked this pull request as ready for review August 6, 2026 11:45
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1096.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 13:19
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 283fc83 to c37dc5a Compare August 6, 2026 13:21
@chrisae9
chrisae9 marked this pull request as ready for review August 6, 2026 13:22
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 13:58
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from c37dc5a to 435ade0 Compare August 6, 2026 13:59
@chrisae9
chrisae9 marked this pull request as ready for review August 6, 2026 14:00
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1096.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness checklist is complete. I will review pull request #1096.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Labels

enhancement New feature or request review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants