Skip to content

test: fix Windows default-home isolation fixtures - #7242

Merged
lidge-jun merged 3 commits into
devfrom
codex/fix-owner-registry-windows-isolation
Oct 16, 2026
Merged

lidge-jun merged 3 commits into
devfrom
codex/fix-owner-registry-windows-isolation

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fix the owner-registry and service-state home-isolation fixtures on Windows. homedir() follows USERPROFILE changes there: the fixtures changed that variable to a worker home but still expected the registry/mirror seeded in the startup home. This caused both owner-registry assertions and the service-state production read to fail.
  • Keep each production fixture's default home stable while switching OPENCODEX_HOME. Guarded callers still exercise worker-home rewrites; the owner-registry fixture restores the protected home before its unpinned refusal check. Every existing registry, mirror, alias, contents and refusal assertion remains.
  • Product behavior is correct: production uses the OS default home, guarded callers use their selected config home, and the guard protects the captured real home. No runtime change is needed. Both isolation test files were introduced on October 15 and are absent from the October 14 main head; that earlier green main run did not cover them.
  • Searched tests/ for home-isolation, startup-home and HOME/USERPROFILE rewrite patterns. Only these two fixtures assume a cached home while asserting startup-home contents. Related wrapper, guard, Claude home and OpenCode transport tests were included in expanded remote checks.
  • Merged current dev (050bb444a0, including fix(gui): restore keep-native-v1 qualifier placement #7237) before final validation. The PR diff remains two test files only.

Verification

  • Final head: 0f4dffc8ecd882aacef9cd48aafbfe9952527e1a.
  • No tests or typecheck ran locally on macOS, per the coordinator's constraint. Local verification was static (git diff --check). Full-suite coverage is delegated to hosted CI because parallel worktrees share local resources.
  • Windows baseline 4ed45e9516, ocx-lane-ci2.sh label f6-base-repro-win-1016: typecheck exit 0; owner-registry 0 pass, 2 fail, matching hosted assertions. The service-state suite on the first PR head reproduced 1 pass, 1 fail with before: null, matching the additional hosted failure.
  • Windows Bun 1.4.3, Bun 1.3.14 and Node probes confirmed that homedir() changes with USERPROFILE; changing/restoring/changing it toggled the result. Reproduction on another host with fixture-owned startup paths and deleted registry overrides supports a fixture assumption failure rather than runner-image drift, inherited registry overrides or path casing.
  • Final-head remote commands on Windows mini and Linux lidge: OCX_TEST_NO_QUEUE=1 OCX_LANE_SLOTS=3 ~/bin/ocx-lane-ci2.sh 0f4dffc8ecd882aacef9cd48aafbfe9952527e1a <label> <test files>. Labels: f6-final-win-1016, f6-final-linux-1016. Each ran typecheck plus:
    • tests/config/owner-registry-isolation.test.ts
    • tests/config/owner-registry-acl.test.ts
    • tests/service/service-state-isolation.test.ts
    • tests/ci-workflows/test-runner.test.ts
    • tests/ci-workflows/test-home-guard.test.ts
    • tests/claude-integration/claude-config-home-isolation.test.ts
    • tests/providers/opencode-management-transport.test.ts
  • Linux lidge: typecheck exit 0; 145 pass, 3 skip, 0 fail across 7 files. bun run structure:check and bun run privacy:scan also passed on the final head.
  • Windows mini: typecheck exit 0; all 10 owner-registry/ACL/service-state tests passed. Expanded run: 147 pass, 1 fail across 7 files. The sole failure is the unchanged test-home-guard.test.ts:639 whole-tree scan exceeding its 5-second deadline (6.48s). It also failed on the previous head (7.94s), and a single-test --parallel=1 run on the unmodified baseline 4ed45e9516 reproduced it (7.76s). This existing performance/timeout issue remains outside this fixture repair; no timeouts were increased. Other wrapper, guard, Claude-home and OpenCode tests passed.
  • Hosted PR CI: SUCCESS, attempt 1, event pull_request, exact head 0f4dffc8ecd882aacef9cd48aafbfe9952527e1a. All four Ubuntu test shards, gates, API usage, storage policy, keyring, Docker smoke and ci completed successfully. React Doctor and PR hygiene also passed. Policy-excluded jobs were skipped and are not counted as passing cross-platform evidence.
  • Explicit hosted cross-platform CI, attempt 1, event workflow_dispatch, lane=all, same exact head: all nine Windows shards completed successfully. Raw logs confirm both service-state cases in Windows 2/9 and both owner-registry cases in Windows 5/9 passed.
  • The cross-platform run is not an overall pass: macOS 1/3 failed tests/ci-workflows/import-cycle-ratchet.test.ts:59 (directory index.tsx imports close cycles); macOS 3/3 and macOS control failed tests/codex-integration/codex-provider-routing.test.ts:176 (concurrent sync processes leave a complete restorable config); desktop shell failed Rust clippy's manual_noop_waker at desktop/src-tauri/src/process_spawn.rs:173. These areas are unchanged by this PR and were left for their owners. A remaining dispatch test job was still finishing at handoff. Earlier superseded dispatches were cancelled and are not passing evidence.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (Test fixtures only; product contracts unchanged.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (No runtime or security-boundary changes; all fail-closed assertions retained.)

Windows homedir() follows USERPROFILE at call time. Keep the production fixture default home stable and restore the protected home before testing guarded unpinned refusal, while retaining worker-home rewrite coverage for guarded callers.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 16, 2026 09:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T09:41:39.891589Z 8238efc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9438f0b8-584c-40c5-ad5c-e5255fcb4ef9
📥 Commits

Reviewing files that changed from the base of the PR and between 050bb44 and 0f4dffc.

📒 Files selected for processing: 2
  • tests/config/owner-registry-isolation.test.ts
  • tests/service/service-state-isolation.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

📝 Walkthrough

The owner registry and service state isolation tests now change HOME and USERPROFILE to the worker home only in guarded mode. The owner registry test restores the startup home before checking unpinned access.

Changes: Home-directory test isolation

Layer / File(s) Summary
Guard home-directory environment changes
tests/config/owner-registry-isolation.test.ts, tests/service/service-state-isolation.test.ts
Both tests preserve the startup home in production mode and use the worker home in guarded mode. The owner registry test resets both environment variables to the startup home before checking unpinned access.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~7 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 0f4df

The fixture-only changes present no identified merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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 accurately and concisely describes the main change: correcting Windows default-home isolation test fixtures in owner-registry and service-state tests.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches: 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun lidge-jun changed the title test(config): fix owner registry isolation on Windows test: fix Windows default-home isolation fixtures Oct 16, 2026
@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer landing note: every PR-scope check passed on head 0f4dffc8ec, and the windows 9/9 shards passed in the branch lane=all run. The remaining red jobs in that run (desktop shell, macos 1/3, macos 3/3, macos control) are failures already present on dev 4ed45e9. They come from the clippy manual_noop_waker lint, the import-cycle scanner (#7241) and the concurrent Codex sync test (#7244), and this test-only diff does not touch them. Fixes are tracked in their own PRs.

@lidge-jun
lidge-jun merged commit 64ed834 into dev Oct 16, 2026
64 of 72 checks passed
@lidge-jun
lidge-jun deleted the codex/fix-owner-registry-windows-isolation branch October 16, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant