Repository navigation
fix(routing): inspect hard-lock fallback without selecting candidates - #7683
Conversation
Apply fallback policy to the ranked profile selection before authentication or dispatch. Keep hard-lock pre-admission unchanged and cover refused and allowed selections with a synthetic caller-owned credential and strict fetch stub.
…rk750-parent-ceef-20261024
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Declared-destination preflight src/server/responses/main-hard-lock-routing.ts, structure/fallback-policy.md, src/server/responses/request-prepare.ts, docs-site/src/content/docs/guides/fallback-off.md, tests/codex-integration/main-account-hard-lock-fallback-off.test.ts |
applyMainHardLockFallbackOverride checks declared combo and profile destinations without selecting a candidate. It refuses only when all destinations resolve and are denied. Tests cover policy precedence, unresolved targets, aliases, redirects, and preservation of selection state. |
Selected-destination checks and dispatch validation src/server/responses/core-combo.ts, structure/fallback-policy.md, tests/codex-integration/main-account-hard-lock-fallback-off.test.ts, tests/codex-integration/main-account-hard-lock-profile-dispatch.test.ts |
The actual selected destination is still checked against the hard lock. Tests check refusals, dispatch-budget use, and fallback-event recording. |
Bun test-runner version and validation
| Layer / File(s) | Summary |
|---|---|
Test-runner pin and verification package.json, tests/test-layout-tooling.test.ts, tests/ci-workflows/install-scripts.test.ts |
The testRunnerBun pin and its test expectation change to 1.4.4. Runner tests cover caller-version matching, incorrect overrides, and test spawning. |
Runtime-role and promotion guidance .github/actions/setup-project-bun/action.yml, .github/workflows/ci.yml, CONTRIBUTING.md, Dockerfile, docs-site/src/content/docs/contributing.md, structure/runtime.md, tests/ci-workflows/ci-scope-gaps.test.ts |
Documentation and comments describe 1.4.4 defaults for both roles, independent validation, and promotion after a successful full cross-platform lane=all run on the candidate head. |
Early TLS response upload test
| Layer / File(s) | Summary |
|---|---|
Early-response fixture and assertion tests/claude-integration/claude-picker-upload.test.ts |
The buffered early-response test uses a TLS server fixture and asserts that the response flushed before the request body completed. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant RequestPreparation
participant applyMainHardLockFallbackOverride
participant allDeclaredTargetsDenied
participant NormalDispatch
participant SelectedDestinationCheck
RequestPreparation->>applyMainHardLockFallbackOverride: Check fallback declaration
applyMainHardLockFallbackOverride->>allDeclaredTargetsDenied: Resolve declared destinations and evaluate policy
allDeclaredTargetsDenied-->>applyMainHardLockFallbackOverride: Return all-denied or mixed/unresolved result
applyMainHardLockFallbackOverride->>NormalDispatch: Continue without selecting or committing a hop
NormalDispatch->>SelectedDestinationCheck: Check actual selected destination against hard lock
Possibly related issues
- lidge-jun/opencodex issue 7587: It describes the exhausted-main-account workflow involving profile or combo destinations. This pull request changes the corresponding hard-lock preflight behavior; the broader desktop compatibility work is not included.
Possibly related PRs
- lidge-jun/opencodex#7627: It supplies the Bun 1.4.4 test-runner transition and related validation changes.
- lidge-jun/opencodex#7606: It changes the shipped Bun runtime pin to 1.4.4, which this pull request matches for the test-runner role.
- lidge-jun/opencodex#7589: It added the actual first ranked routing-profile destination guard that this pull request retains alongside the new preflight.
Merge Risk: 
Minimal · up to 083e4
-
The changes appear mergeable after normal checks; no actionable issue is established.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title accurately summarizes the primary change: hard-lock fallback preflight now inspects declared destinations without selecting combo or profile candidates. It is concise, specific, and directly related to the routing changes.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 9 files. (9 skipped: 9 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
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.
Comment @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
…k-preflight-no-selection # Conflicts: # tests/claude-integration/claude-picker-upload.test.ts
|
Integration evidence (owner decision decision:b607a677, approved): after #7627 landed the maintainer merged origin/dev into this branch, leaving only this PR's own change (hard-lock fallback inspection (main-hard-lock-routing.ts, core-combo.ts, request-prepare.ts)); independent gpt-6.1-sol review PASS at exact head c1de534. Exact-head PR CI run 40156543505 and exact-head ci.yml lane=all run 40156893227 (maintainer mirror branch at this SHA) both succeeded. Static merge simulation on current dev 6728882 (this Mac): dev=6728882a30c998ba025ac24769a00239a13a393f base=323a5e11772c38c15b271d23c7696c5947bb97da pr_files= 7 overlap=[]; merge clean; install exit=0; gui install exit=0; tsc exit=0; tsc doctor exit=0; structure:check exit=0; privacy:scan exit=0; layout+ratchet guards exit=0 54 pass 0 fail ; Merged by the triage manager as maintainer integration (MAINTAINERS.md, dev only) with green exact-head PR CI, an independent review PASS, and the owner's approval of this bundle. |
Summary
Hard-lock fallback preflight currently selects a combo/profile candidate before normal dispatch, consuming selection state and potentially judging a mixed candidate set from one speculative choice. Inspect declared destinations without selecting them, and refuse early only when every resolved destination is policy-denied. Empty, mixed, same-destination, or unresolved declarations defer to normal selection and its actual-destination checks.
The previous #7589 dependency has landed. This branch includes the shared Bun 1.4.4 test-runner transition from #7627 so validation uses the security baseline for both runtime and tests. The comparison with
devcontains seven routing/documentation/test files and eleven shared transition files. It targetsdev; directly using the older #7627 branch as base would expose unrelated intervening changes.Verification
Candidate
083e4a89eadde42baf007083371bc6bcc7273d4e, official Bun 1.4.4 on Windows. A frozen install preserved the lockfile and verified actual consumer resolution of Hono 4.13.13, ip-address 10.7.4, and qs 6.16.1.Ran each of these files once with
CI=true bun test --isolate --timeout 60000:tests/codex-integration/main-account-hard-lock-fallback-off.test.tstests/codex-integration/main-account-hard-lock-profile-dispatch.test.tstests/codex-integration/main-account-hard-lock-fallback-routing.test.tstests/routing/fallback-policy.test.tstests/codex-integration/main-account-hard-lock-policy.test.ts202 passed, 0 failed, 0 skipped, 554 assertions; every process exited 0. Reference TypeScript, structure consistency, changed-file privacy/file-size checks, and
git diff --checkpassed. Independent source review found no blocking defect. Test fixtures and owned processes were cleaned up; no live provider calls were made.Full Bun 1.4.4 CI passed on this exact head: all four Linux test shards, all nine Windows shards, all three macOS shards and the macOS control succeeded. Path-filtered jobs were skipped as recorded in that run. The focused local tests above complement that hosted validation. No GUI change.
Checklist
Summary by CodeRabbit
Bug Fixes
Documentation
Tests