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@3c246291
  • feature suite: 197 passed (config, namespace, router, and Codex injection coverage)
  • latest upstream-delta gate suites: 207 passed (PR hygiene, target enforcement, and CI workflow changes)
  • 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: 19ba3a22-4937-4905-a534-6d42cbb778a3

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, and 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 and empty or malformed maps.
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, and rejects invalid, inherited, or accessor properties.
Routing behavior verification
tests/router.test.ts
Routing preserves the OpenAI provider, model ID, account ID, and namespace when picker visibility is disabled.

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

Sequence Diagram(s)

sequenceDiagram
  participant Config
  participant codexAccountPickerEnabled
  participant AccountQualifiedRouter
  Config->>codexAccountPickerEnabled: Provide picker flag and namespace map
  codexAccountPickerEnabled-->>AccountQualifiedRouter: Return picker visibility
  AccountQualifiedRouter->>AccountQualifiedRouter: Select account and namespace
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

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 commit 3ac1d7559c5c4559739a9c78e3f136448cd0938b.

⚠️ 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 07:30
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 3ac1d75 to 62f33d7 Compare August 6, 2026 07:32
@github-actions
github-actions Bot marked this pull request as ready for review August 6, 2026 07:34
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions The readiness gate 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.

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I reviewed the exact head 62f33d7e and found no code-level blocker in this foundation slice.

The compatibility behavior is sound: an existing non-empty selector map remains picker-enabled when the new field is omitted, explicit false hides only generated catalog rows, and exact account-qualified routing remains independent. Persisted malformed values degrade to false without replacing providers/accounts/selectors, while live config candidates reject non-boolean, inherited, and accessor-backed values before reading the accessor. The helper is intentionally not wired into catalog generation in this slice, so this PR does not yet claim a user-visible picker change; documentation belongs with the consuming slice.

Local verification on this head:

  • bun test tests/codex-account-namespaces.test.ts tests/config.test.ts tests/router.test.ts — 159 passed, 0 failed
  • bun run typecheck — passed

I am not approving yet because the repository's required ci check has not run on this head; only hygiene/target/label checks are attached. Once exact-head CI is green, this small contract slice is worth landing before the catalog/management follow-ups.

@chrisae9
chrisae9 marked this pull request as draft August 6, 2026 09:37
@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from 62f33d7 to e230f3c Compare August 6, 2026 10:39

chrisae9 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Rebased this slice again onto the latest dev@3c246291; the exact head is now 283fc830.

The incoming delta is limited to PR-gate/CI hardening and does not overlap this feature. Exact-head local gates are green: 197 feature tests, 207 upstream-delta gate tests, typecheck, privacy scan, repository hygiene, sponsorship gate, and diff check. The PR description's stray literal \n was also removed before the new hygiene gate ran; exact-head hygiene is green.

The repository full harness completed on a preceding rebased head with 9,226 passing and 10 skipped; its only failure was an upstream WebSocket close-callback timing assertion. The changed PR tests ran after that failure, the relevant upstream code is byte-identical, and the complete failing file passes 100/100 under isolated stress.

Cross-platform CI and React Doctor are attached to this exact head but show action_required because the fork workflows need maintainer approval: https://github.com/lidge-jun/opencodex/actions/runs/31098485454

@chrisae9
chrisae9 force-pushed the split/1019-01-picker-setting branch from e230f3c to 8dc3722 Compare August 6, 2026 10:54
@chrisae9
chrisae9 marked this pull request as ready for review August 6, 2026 11:33
@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.

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