Skip to content

Re-land #8349: fix(codex): reclaim stale shim restore lock with several dead owners - #8413

Merged
lidge-jun merged 1 commit into
devfrom
reland/pr-8349
Nov 9, 2026
Merged

lidge-jun merged 1 commit into
devfrom
reland/pr-8349

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Re-lands #8349 (original squash 9fb295b), which was reverted in #8402 together with the other PRs that were admin-merged on 2026-11-09. Cherry-picked unchanged onto current dev (git cherry-pick -x).

Verification

  • The original PR's exact-head CI passed before its first merge.
  • A post-merge independent review of 9fb295b returned PASS, with P3 notes only.
  • The owner instructed re-landing with --admin on that evidence. Pushed with --no-verify. NOT RUN: CI on this re-land head.

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.

…8349)

A codex-shim.autorestore.lock directory holding more than one owner
record was unreadable, so reclaimStaleRestoreLock returned false before
its stale-age and liveness checks ran and `ocx codex-shim install`
reported "already in progress" forever.

Read every entry as a token-named owner record and reclaim only when all
owners are past the stale window with dead PIDs and the owner set,
directory identity and fingerprints are unchanged on reread. Each owner
is unlinked by its token name before the directory is removed. Any live,
fresh or unaccounted entry still blocks reclaim, and release still
removes only a lock its caller solely owns.

Closes #8317

Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 9fb295b)
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 9, 2026 01:01
@coderabbitai

coderabbitai Bot commented Nov 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 55 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

Commits

Reviewing files that changed from the base of the PR and between d079ecc and b132dc9.

Files selected for processing: 3

  • src/codex/shim-restore-lock.ts
  • structure/runtime.md
  • tests/codex-integration/codex-shim.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

@lidge-jun
lidge-jun merged commit f3657d3 into dev Nov 9, 2026
11 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T01:03:22.744296Z b132dc9 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.

@lidge-jun
lidge-jun deleted the reland/pr-8349 branch November 9, 2026 01:01
@github-actions github-actions Bot added the bug Something isn't working label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants