You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(codex): accept the context route in Desktop observation - #9099
Accept the /backend-api/codex base path in Windows Desktop observation when the native context-management experiment is enabled and the URL targets the verified local listener.
Reuse the existing context opt-in and path constant. Preserve checks for the built-in provider, native login configuration, actual listener address and port, and existing observation invalidation.
Cover the URL emitted by context integration, the optional trailing slash, and rejected paths and targets. Update the English and Korean guides and the Desktop compatibility contract.
On Windows with Bun 1.4.4, the two new cases failed against the original validator and passed after the change.
bun test tests/clients/desktop-compatibility-routing.test.ts tests/codex-integration/context-compat.test.ts tests/clients/desktop-compatibility-runtime.test.ts tests/server/server-desktop-compatibility-startup.test.ts — 117 passed.
bun test with the other eight tests/clients/desktop-compatibility-*.test.ts files and three tests/server/management-desktop-compatibility-*.test.ts files — 130 passed.
bun run typecheck, bun run structure:check, bun run privacy:scan, and git diff --cached --check passed.
In docs-site/, bun install --frozen-lockfile and bun run build passed. The build produced 820 pages.
bun run test:changed found the five changed files but selected zero tests on this Windows checkout. The explicit tests above cover the affected routing check, context opt-in, and Desktop service and management paths. The full repository suite and a live Store-app recovery trial with the patched build are pending.
Checklist
Scope stays focused and avoids unrelated cleanup.
Docs or release notes were updated when needed.
Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
New Features
Windows Desktop compatibility can now use the /backend-api/codex route when experimental context management is enabled, provided the URL points to the active local listener.
Documentation
Updated English and Korean guides and compatibility documentation to describe the supported route and its opt-in requirements.
Allow the opted-in context-management alias on the verified local OpenCodex listener. Cover the injected URL and rejected alternatives with routing preflight tests.
Reviewing files that changed from the base of the PR and between e5fa9bd and 3ba5706.
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
No actionable comments were generated in the recent review.
Walkthrough
The Windows Desktop routing preflight now accepts the managed /backend-api/codex path when experimental context management is enabled. Tests cover the route conditions, and English, Korean, and runtime documentation describe the alias.
Changes: Desktop routing compatibility
Layer / File(s)
Summary
Accept the context-management route alias src/codex/desktop-compatibility/routing-preflight.ts, tests/clients/desktop-compatibility-routing.test.ts, docs-site/src/content/docs/guides/codex-integration.md, docs-site/src/content/docs/ko/guides/codex-integration.md, structure/clients/codex-desktop.md
The preflight accepts normalized /v1 paths and accepts /backend-api/codex when experimental context management is enabled. Tests check opt-in, the active local route, and rejection cases including a stale port, non-local host, extra path segments, and query parameters. The documentation describes the alias.
Windows Desktop observation can now start when experimental context management is on and the generated /backend-api/codex URL points at the local OpenCodex listener. Existing provider, login, address and port checks still apply. No actionable merge-blocking risk was found; the full test suite and the live Store-app recovery trial are still pending.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(codex): accept the context route in Desktop observation" matches the main change. The PR lets Windows Desktop observation accept the /backend-api/codex base path when experimental conte…
Linked Issues check
Directly linked issue #9098 requires Windows Desktop observation to accept the managed /backend-api/codex base path when experimental context management is enabled and the URL targets the same OpenC…
Out of Scope Changes check
The whole-PR diff against the merge base changes these files: - src/codex/desktop-compatibility/routing-preflight.ts: the gated /backend-api/codex acceptance for #9098. This is the core change. - …
Full details: Title check
Explanation
The title "fix(codex): accept the context route in Desktop observation" matches the main change. The PR lets Windows Desktop observation accept the /backend-api/codex base path when experimental context management is enabled and the URL targets the verified local listener. The routing change in routing-preflight.ts, the tests, and the docs all relate to this. The title is specific and concise. It does not name the loopback or opt-in conditions, but it does not need to cover every detail.
Full details: Linked Issues check
Explanation
Directly linked issue #9098 requires Windows Desktop observation to accept the managed /backend-api/codex base path when experimental context management is enabled and the URL targets the same OpenCodex loopback listener. Existing provider, native-auth, loopback-address, and port checks must still apply.
At head, src/codex/desktop-compatibility/routing-preflight.ts (matchesNativeCompatibilityRouting) now does the following:
Keeps the existing checks for http: protocol, loopback hostname, no credentials, no query or hash, and a present port.
Normalizes one trailing slash from url.pathname into basePath.
Accepts basePath === "/v1" as before.
Accepts basePath === CONTEXT_BACKEND_PREFIX only when contextExperimentalEnabled(text) is true. Any other path is rejected.
Keeps the existing built-in-provider, forced_login_method, owner.loopbackPort, and owner.port checks after this gate.
The routing digest and invalidation logic in createNativeRoutingVerifier are unchanged, so observation invalidation still applies. The reported test changes in tests/clients/desktop-compatibility-routing.test.ts cover the context-compatible URL, the trailing-slash variant, and rejection for missing or disabled opt-in, stale port, non-local host, extra path segments, and query parameters.
Limits of this review: I did not rerun the reported test commands. I read the routing diff and head file only. I did not inspect contextExperimentalEnabled or CONTEXT_BACKEND_PREFIX in src/codex/context-compat. Their behavior is inferred from the imports and the PR description. The live Store-app trial is non-coding and is not assessed.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against the merge base changes these files:
src/codex/desktop-compatibility/routing-preflight.ts: the gated /backend-api/codex acceptance for #9098. This is the core change.
tests/clients/desktop-compatibility-routing.test.ts: tests for the new acceptance and its rejection cases. These support the change.
docs-site/src/content/docs/guides/codex-integration.md and docs-site/src/content/docs/ko/guides/codex-integration.md: documentation that states the new accepted base path and its opt-in condition. The PR description requires these updates.
structure/clients/codex-desktop.md: the Desktop compatibility contract. It now lists the /backend-api/codex alias under the same opt-in. The PR description requires this update.
Each file connects directly to the #9098 objective. The PR description states that the change avoids unrelated cleanup. The diffs reviewed show no unrelated behavior change. The stated test scope covers the affected Desktop routing, context opt-in, runtime, startup, and management paths.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
all PR quality gates passed; the review readiness checklist is complete.
Review readiness checklist
✅ Required local validation passed; commands, results, and any full-suite exception are documented.
✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
✅ I resolved all correct Codex and CodeRabbit findings.
✅ My PR is ready for review.
✅ 4/4 boxes ticked.
This pull request has been marked Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers notified: @lidge-jun@Ingwannu
Maintainer integration into dev (MAINTAINERS.md, dev-only path), recorded before merge.
Head: 3ba57063981c703c205f568887930ae51d97fb9e. It is 5 commits behind dev at 414faafffc.
PR checks passing on this head: Catalog async contracts (ubuntu-latest), api usage, changes, ci, docker smoke, docs site build, enforce / enforce-target, enforce / resolve-pr, gates, hygiene / hygiene, label / label, npm-global ubuntu-latest, select windows runner, storage policy, structure gate, test changed, validate-source. The remaining jobs were skipped by the PR lane policy.
Local checks on the earlier head e5fa9bdc6f (dev merge only): bun run typecheck found no errors in 2,701 files. bun run test:changed ran 13,887 tests across 576 files with 1 failure: link-ocx-child-e2e, which needs a cargo toolchain that this host does not have. Focused tests on the current head: desktop-compatibility-routing 10/10, context-compat 22/22.
The relaxed behind-dev gate was checked before merging:
(c) intervening dev commits change 35 files; overlap with PR files: none; shared-class files touched by the PR: none
(d) on local unpushed merge 389a4eed70 (3ba5706 + dev 414faaf): typecheck: ✓ No type errors in 2,703 files [341.33ms]; structure:check: structure/ SSOT checks passed; tests: clients/desktop-compatibility-routing.test.ts 10 pass 0 fail ;codex-integration/context-compat.test.ts 22 pass 0 fail ;test-layout.test.ts 2 pass 0 fail ;test-layout-tooling.test.ts 27 pass 0 fail ;ci-workflows/file-size-ratchet.test.ts 9 pass 0 fail ;ci-workflows/skill-ocx.test.ts 15 pass 0 fail
Independent review (GPT-6.1 Terra): APPROVE with no findings. The local listener address, port, authentication and provider checks are unchanged. The /backend-api/codex alias qualifies only with the experimental context-management opt-in.
I ticked the readiness checklist after doing this validation myself.
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
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
/backend-api/codexbase path in Windows Desktop observation when the native context-management experiment is enabled and the URL targets the verified local listener.Closes #9098
Verification
bun test tests/clients/desktop-compatibility-routing.test.ts tests/codex-integration/context-compat.test.ts tests/clients/desktop-compatibility-runtime.test.ts tests/server/server-desktop-compatibility-startup.test.ts— 117 passed.bun testwith the other eighttests/clients/desktop-compatibility-*.test.tsfiles and threetests/server/management-desktop-compatibility-*.test.tsfiles — 130 passed.bun run typecheck,bun run structure:check,bun run privacy:scan, andgit diff --cached --checkpassed.docs-site/,bun install --frozen-lockfileandbun run buildpassed. The build produced 820 pages.bun run test:changedfound the five changed files but selected zero tests on this Windows checkout. The explicit tests above cover the affected routing check, context opt-in, and Desktop service and management paths. The full repository suite and a live Store-app recovery trial with the patched build are pending.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
/backend-api/codexroute when experimental context management is enabled, provided the URL points to the active local listener.