Skip to content

fix(service): match canonical Codex home ownership - #658

Closed
luvs01 wants to merge 5 commits into
devfrom
codex/propose-fix-for-junction-backed-service-issue
Closed

luvs01 wants to merge 5 commits into
devfrom
codex/propose-fix-for-junction-backed-service-issue

Conversation

@luvs01

@luvs01 luvs01 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • A recent change canonicalized the default Codex home to the physical target of a junction, which made that path differ lexically from older recorded service install state and caused ownership checks to reject stop/uninstall operations.
  • The same spelling problem applied to every recorded home (opencodexHome, codexSqliteHome, and the ownership record) — comparing only the Codex home would still leave the guards and preflight rejecting the same physical install.
  • Add servicePathMatchesInstall in src/service/state.ts: lexical serviceHomeMatches first, then resolve both sides with realpathSync (via deps.realpathSync when injected) and compare the physical directories; a resolution failure stays fail-closed (false).
  • Route every recorded-home comparison through it: serviceCodexHomeMatchesInstall, the opencodexHome guard and the codexSqliteHome check in src/service/guards.ts, and the claim-ownership, mirror-vs-mirror, and foreign-claim checks in src/integrations/native/ownership-preflight.ts (whose OwnershipDeps gains an optional realpathSync).
  • Document the rule in structure/codex-home.md and the service lifecycle guide: an alias spelling of the same physical home still counts as this installation; an unresolvable alias stays fail-closed.

Verification

  • bun test tests/codex-integration/codex-home-wsl.test.ts and the focused service suites pass, including a real junction exercised through the production resolver.
  • bun run typecheck and bun run structure:check pass.
  • bun run test:changed could not be executed in this environment because the checkout has no comparison dev ref, so focused regression coverage was used instead.

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.

Codex Task

Link to Devin session: https://app.devin.ai/sessions/4a96408ffbbd4381b14d4022a1764a21
Open in Devin Desktop: https://app.devin.ai/desktop/session/4a96408ffbbd4381b14d4022a1764a21?variant=devin
Requested by: @luvs01


Devin Review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6bf19066-263b-4bee-9679-3fdd3828ed4d


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.

devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 26, 2026
… as owned

The install-state guard and the unattended ownership preflight compared the
recorded SQLite/OpenCodex homes lexically, so an install recorded through a
junction alias rejected lifecycle operations once the runtime resolved the
canonical path. Reuse the same physical-directory fallback already applied
to codexHome for the SQLite home, the OpenCodex home, manager-claim homes,
and state-mirror comparisons.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
devin-ai-integration[bot]

This comment was marked as resolved.

…cked home

Also document alias-spelling ownership acceptance in the lifecycle guide.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits September 26, 2026 14:51
An unresolvable alias is only foreign when its recorded spelling also
differs from the current home; identical spellings are accepted without
resolving.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
@luvs01

luvs01 commented Sep 27, 2026

Copy link
Copy Markdown
Owner Author

이관됨: lidge-jun#6036

@luvs01

luvs01 commented Sep 27, 2026

Copy link
Copy Markdown
Owner Author

동일 수정이 상류 저장소에 제출되어 이 포크 PR의 목적은 달성됐습니다.

@luvs01 luvs01 closed this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant