Repository navigation
Merged
Conversation
Expose only owner-scoped managed Codex model metadata and validate updates against provider-supported reasoning levels. Add ordinary-user settings controls without granting model catalog or provider administration access.
Persist only a one-way account binding on managed Codex profiles. Hide and reject stale or legacy-unbound reasoning controls until a successful catalog refresh, and do not carry overrides across account switches.
Contributor
Author
|
@pancacake Could you please review this updated PR? It has been rebased onto the current Local verification on the updated head:
The PR description contains the security-review findings and full verification details. |
pancacake
added a commit
that referenced
this pull request
Aug 12, 2026
An adversarial pass over #818 / #789 / #780 after merging. **Codex sign-ins from before this week stopped working (#789).** ``validate_runtime_profile`` compared the profile's ``codex_account_binding`` for equality, but that key is written only by ``sync_codex_catalog`` — every managed profile published by #690/#774 has none, so ``None != <hash>`` made each of them look like another account's and locked its owner out of Codex until they re-ran "Refresh models". Absent now reads as legacy; a binding that is present and different is still an account switch and still refused. **Overriding reasoning effort for one turn returned 409 (#789).** The same function also required the request's effort to be byte-equal to the value stored in the catalog. Effort is a per-request knob, not part of the identity that ties a config to a token — the check now stops at model membership. Its test asserted the old behaviour and has been rewritten around what the function is actually for. **The reasoning-effort endpoint left the runtime caches stale (#789).** It writes the catalog the runtime resolves against, like every other catalog write in this router, but skipped ``_invalidate_runtime_caches()``. **OrcaRouter claimed Anthropic prompt caching (#818).** ``supports_prompt_caching`` makes ``_build_kwargs`` inject ``cache_control`` blocks into any ``anthropic/*`` or ``claude*`` request — an OpenRouter extension. No other gateway sets it and nothing established the second one accepts it; a strict gateway would 400 every Claude turn. Also fixed ``anthropic/claude-sonnet-4.6`` in the fallback list, which the rest of the repo spells with dashes, so a user picking it from our own menu would have got "model not found". **OrcaRouter inserted itself into the curated menus (#818).** The featured lists are hand-picked and rendered as a positional numbered menu, so adding an entry shifted Ollama from [10] to [11]. The registry entry alone already makes a provider reachable via "Show all" and the Settings dropdown; which providers are featured is a maintainer decision. The README paragraph goes with it — no other provider has per-provider prose there, and it would have been translated into ten languages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codex_supported_reasoning_levels, preserve valid overrides by stable model slug, and fall back to provider defaults when support changesAuthorization boundary
The ordinary-user endpoint accepts only a model slug and a reasoning-effort value. Server-owned profile metadata, model IDs, context windows, provider configuration, and OAuth credentials remain authoritative and cannot be changed through this path.
Managed profiles persist only a SHA-256 account binding, not the raw OAuth account ID. Status responses expose neither value. A profile with a missing or mismatched binding is hidden from reasoning controls, excluded from personal model options, and rejected at the outbound provider boundary.
On an OAuth account change, the old managed profile and active selection are retired synchronously with the credential commit, before catalog invalidation or fetch can yield. A failed account-B catalog fetch therefore cannot leave account A's model or reasoning override paired with account B's token. Same-account reauthentication preserves valid overrides.
The extension does not broaden credential ownership or cross-user access. It reuses the existing owner-scoped Codex service, continues to reject partner callers, and leaves the admin-only catalog APIs unchanged.
Verification
Rebased onto
upstream/devat515a754band verified at head6e16cb4d:env -u PYTHONPATH .venv/bin/pytest -q --tb=short.venv/bin/ruff check ..venv/bin/ruff format --check .cd web && npm run test:nodecd web && npm run buildcd web && npm run lintcd web && npm run i18n:checkenv -u PYTHONPATH .venv/bin/pip checkgit diff --checkIndependent review
b74164edadded account-bound managed profiles and stale Settings-write protection.dev, a separate read-only reviewer inspected frozen commitf151314aand returned BLOCK: account B's credentials could be committed while account A's managed profile remained active during a delayed or failed catalog fetch. The review also found that an incomplete catalog payload could detach the reconciledservices.llmstructure.6e16cb4dfixes the runtime window, adds outbound and personal-option binding checks, and attaches reconciled catalog containers before preserving provider-owned metadata.Design sync
design-sync: not applicable— this repository has no project design or architecture draft to update. The account-switch and outbound-validation invariants are recorded in the service implementation, regression tests, and this PR description.