Repository navigation
Merged
Conversation
pancacake
added a commit
that referenced
this pull request
Aug 6, 2026
…ack everywhere #784 fixed the launcher, but the same address is rendered on two other paths that kept "localhost": the Docker entrypoint (render_environment) and the last-resort default in web/proxy.ts. On a dual-stack host that name resolves to ::1 first while uvicorn binds 0.0.0.0 (IPv4 only), so every rewritten /api/* request fails to connect — the launcher and container paths are meant to stay in sync, and after #784 they no longer did. Also disambiguates the two same-named _optional_positive_int helpers added by #774: catalog's drops junk from a live API response, contracts' rejects it as cache corruption. Same name, opposite behaviour — the strict one is now _require_optional_positive_int and says why it differs.
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.
Description
Codex OAuth model discovery currently drops
context_windowandmax_context_windowfrom the/codex/modelsresponse before publishing the read-only managed model profile. As a result, downstream runtime configuration cannot use the provider metadata and may fall back to a conservative default, encouraging users to create a second manual profile.This PR:
context_windowandmax_context_windowvalues from Codex model metadata;CodexModelcontract while remaining compatible with caches written before these fields existed;context_windowto managed catalog models withcontext_window_source: metadata;max_context_windowwhen the current context field is absent;No context-window value is hardcoded in production code.
Related Issues
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstests...Checklist
pre-commit run --all-filesand fixed any issues.Verification
pre-commit run --files <changed files>: passed (including Ruff, format, JSON, detect-secrets, Bandit, and MyPy)pytest -q tests/services/codex_auth tests/services/test_model_catalog.py tests/services/config/test_provider_runtime.py tests/services/config/test_context_window_detection.py:139 passedThe all-files pre-commit run was attempted. It rewrites tracked
web/.next-deeptutorbuild artifacts and unrelated pre-existing frontend formatting; those unrelated changes were reverted rather than included here.Additional Notes
This intentionally does not add editable reasoning-effort overrides to the read-only OAuth-managed profile. That is a separate UI/configuration design change and should be reviewed independently.
Design sync: not applicable — this preserves the existing OAuth-managed catalog architecture and restores provider metadata that was already present upstream.