Skip to content

test(codex): give the native toggle fixture its own service-manager evidence - #6834

Merged
lidge-jun merged 1 commit into
devfrom
codex/n3-codex-toggle-fixture
Oct 9, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/n3-codex-toggle-fixture

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Fixes #6776. tests/codex-integration/native-codex-toggle.test.ts ("the status read follows an off-then-on round trip…") failed with a service-home ownership refusal on machines that have an opencodex service registered.

Enabling Codex runs production admission, which calls inspectServiceManagerInstallation (src/integrations/native/ownership-preflight.ts). That probe asks the real service manager (launchctl print gui/<uid>/… on macOS, systemctl --user show opencodex-proxy on Linux), and HOME cannot redirect either. The fixture's service-state.json is read correctly (kind: "valid"), but a live registration the sandbox plist cannot explain makes ownership unprovable, so the write is refused and the status reads absent. Hosted runners have no registration, which is why CI passed.

Test-only change: the fixture stubs inspectServiceManagerInstallation to { kind: "absent" } in beforeEach and restores it in afterEach, and a new case asserts the probe is consulted during enable, so the stub stays on the admission path. The fixture's state file is still validated by the real reader. The production ownership boundary is unchanged.

Verification

All local runs started Bun with a fresh temporary HOME, USERPROFILE and CLAUDE_CONFIG_DIR.

  • Simulated registered service manager on dev: 12 pass / 1 fail with the reported refusal (state: "absent"). Same simulation with this change: 14 pass / 0 fail.
  • bun test tests/codex-integration/native-codex-toggle.test.ts: 14 pass, 0 fail.
  • Independent review confirmed the new call assertion fails when the production probe call is bypassed, and that the spy is restored before fixture cleanup.
  • bun test tests/ci-workflows/file-size-ratchet.test.ts: pass. bun run typecheck: exit 0.
  • The full suite was not run locally; it runs in hosted CI on this head.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (Test-only; no user-facing change.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (The ownership boundary is untouched.)

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 9, 2026 11:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-09T11:48:05.972478Z c6addbb 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 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 40db241b-d6e0-4902-a0f0-104ad5e57541

📥 Commits

Reviewing files that changed from the base of the PR and between 37e9294 and c6addbb.


📒 Files selected for processing (1)
  • tests/codex-integration/native-codex-toggle.test.ts


  • 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.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 9, 2026
@lidge-jun
lidge-jun merged commit c4baa30 into dev Oct 9, 2026
30 checks passed
@lidge-jun
lidge-jun deleted the codex/n3-codex-toggle-fixture branch October 9, 2026 12:59
lidge-jun added a commit that referenced this pull request Oct 9, 2026
* docs(devlog): record the #6777 fixture implementation

* docs(devlog): record the #6776 fixture implementation

* docs(devlog): close the N3 test-infra unit (#6775, #6777, #6776)

Moves devlog/_plan/261009_n3_test_infra to devlog/_fin with an Outcome section recording #6835 (7f642e3), #6833 (6d7e5f4) and #6834 (c4baa30), their exact-head CI, the union check, and the scope left as follow-ups.

* docs(devlog): say which N3 CI jobs were skipped
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