Skip to content

fix(codex): harden WSL hook path trust lifecycle - #8191

Merged
AmethystLiang merged 3 commits into
mainfrom
fix-wsl-hook-path-trust
Jul 11, 2026
Merged

AmethystLiang merged 3 commits into
mainfrom
fix-wsl-hook-path-trust

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

  • resolve custom WSL automount hook paths asynchronously without blocking Electron main
  • preserve last-known-good trust across transient WSL transport/timeouts
  • revoke managed trust when WSL confirms the hook path is missing, and update it when canonical identity changes
  • keep WSL/SSH case-sensitive trust identities distinct from native Windows paths

Validation

  • 22 Codex test files: 403 passed, 8 skipped
  • focused suite: 108 passed, 3 skipped
  • node typecheck, full lint, formatting, max-lines ratchet, diff check
  • two fresh adversarial review/fix rounds (P1 and P2 lifecycle fixes)

Residual risk

Requires Windows CI or live custom-automount WSL confirmation; the review host was macOS.

Failed async wslpath/readlink revalidation no longer drops the last
known-good cache or wipes managed trust. That path turned cold/wedged
distro timeouts into silent untrusted hooks, and forced the next launch
onto the logical /mnt guess under custom automount roots. Settlement now
reinstalls only when the generation is current and the canonical trust
path actually changed.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 37404812-0a5a-4b51-a2a2-0f377fb2bfa2

📥 Commits

Reviewing files that changed from the base of the PR and between 2b7c364 and 1fa0a1a.

📒 Files selected for processing (6)
  • src/main/codex/codex-wsl-hook-install-plan.test.ts
  • src/main/codex/codex-wsl-hook-install-plan.ts
  • src/main/codex/config-toml-trust.test.ts
  • src/main/codex/config-toml-trust.ts
  • src/main/codex/hook-service-wsl-runtime.test.ts
  • src/main/codex/hook-service.ts

📝 Walkthrough

Walkthrough

WSL path canonicalization now uses asynchronous settlement callbacks with resolved, missing, and unavailable outcomes, cache revalidation, and Windows-path-aware wsl.exe commands. Trust-key normalization preserves case for WSL-style paths, while managed guest trust cleanup removes stale entries. WSL hook installation and refresh now reconcile canonical path changes using generation tracking, conditional removal, and reinstalls. Tests cover cache outcomes, path changes, trust cleanup, and reconciliation decisions.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and validation, but it omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, including Screenshots/No visual change, Testing checklist, AI Review Report, Security Audit, and Notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main WSL trust-lifecycle hardening work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@AmethystLiang
AmethystLiang merged commit b45a595 into main Jul 11, 2026
3 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* Fix WSL Codex hook path trust lifecycle

* fix(codex): keep WSL hook trust across transient path rechecks

Failed async wslpath/readlink revalidation no longer drops the last
known-good cache or wipes managed trust. That path turned cold/wedged
distro timeouts into silent untrusted hooks, and forced the next launch
onto the logical /mnt guess under custom automount roots. Settlement now
reinstalls only when the generation is current and the canonical trust
path actually changed.

* fix(codex): revoke trust for missing WSL hook paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant