Repository navigation
fix(link): bind every failed-enrollment step to the attempt's link id, and finish a bound detach killed while restoring its own attach - #8694
Merged
Conversation
…hile it restored an interrupted attach
…rogress, and ends in --force when the answer repeats
… link's id for its revoke
…and an --operation-id recover names where the link id comes from
…, the cleanup restart, the race reason, the Windows Command Prompt paths, and the /1 reason
…link id and binds the Child's step to it
…mpt's link id, never a plain disconnect or detach
…link id in every locale, and is left without one
… Child step bound to the attempt's link id
Contributor
|
Caution Review failedThe pull request is closed.
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. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
…e reserved link id and the bound purge
…x-child path for its platform and a copy placed by hand
…ch also finishes a detach that stopped while restoring its rollback
… recover it again, or resolve it
…ssage nor its recovery line
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
lidge-jun
added a commit
that referenced
this pull request
Nov 15, 2026
…ntity-file texts; close #8694 remedy gaps (#8754) * fix(link): refuse a route edit while a removal of the link is unfinished (#8678) A route edit made after a failed revoke rewrote the link record without reading its retirement receipt, so every later revoke compared the edited record with the receipt copy and answered link_changed for good. handleLinkRouteEdit now refuses with 409 link_retirement_pending while a receipt is outstanding (an unreadable one counts), checked before the probe and again under the config mutation lock at the commit. ocx link routes names the way out, and the link_changed next step no longer says a current Home edit can cause it. * docs(link): scope the identity-file refusal texts to this user (#8723) P3-A..D from the #8722 review: chmod go-w only on a private folder this user owns (its own, or one a tool made for it), in the directory and ancestor texts and every copy; read access only with chmod u+r / u+rx and never group or other; chmod 600 only on a key of this user own, never chown or chmod another user or the system key. Updates the pinned strings and the two stale test comment/title nits. * fix(link): close the remedy gaps the #8694 review left (#8696) ocx-child: a bound detach accepts its own ownership record in phase cleanup complete (a detach killed inside release() between marking it and removing it), which only release() writes; covered by a kill test at that point. Residual steps name a copy placed by hand in ~/.local/bin (%USERPROFILE%\.local\bin on Windows), which discovery tries first; the plant purge says what a not-found binary means (server text, dashboard in all 11 locales, guides). The link add capability text labels Command Prompt, adds the USERPROFILE fallback, separates the lightweight step from ocx restart and says what to do when an older build refuses --expect-link. child_restart_unsupported says that ocx disconnect ends the link the machine uses now. * test(gui): pin the residual purge not-found step in the Remote Link fixtures (#8696)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The follow-ups from #8691's final review, and the last item of this lane. A failed enrollment that may have left the Child connected used to print a plain
ocx disconnectorocx-child detach(or a status check that could not tell this attempt's link from another's). Read long after the attempt, that step could remove a link the machine joined since. The answer now carries the attempt's link id, and every surface prints a step bound to it. A boundocx-child detachalso finishes its own detach that was killed while it restored an interrupted attach.Failed-enrollment remedy (the out-of-scope item: CLI, server, journal replay, dashboard, guides en/es, capability text, structure):
Apply fixes the attempt's link id when it starts (the journal's reserved id, else a new one), before any plant. A residual answer carries it as
linkId, withresidualInstall(ephemeralorfull) next toresidualKindandremotePlatform. A journalled replay carries the reserved id, and so does the first answer of a journalled apply whose plant did not report (it returns before the live residual is built).One builder,
src/link/residual-recovery.ts, writes the step for the server answer and the CLI:ocx disconnect --expect-link <id>, thenocx restartif it disconnected;detach --expect-link <id>through its managed path for the Child's platform (~/.cache/opencodex/bin/ocx-child, or both Windows locations in Command Prompt), which need not be onPATH, or through the pathcommand -v ocx-child(where.exe ocx-child) prints for a copy placed by hand;detach --purge --expect-link <id>, both Windows locations named.Each acts only while the Child's records name that link or nothing at all. A build older than the flag refuses it before acting; then a full install falls back to "run the plain commands only if
ocx connect status --jsonshows that id, right after the check", and a lightweight Child is left. Without an id, nothing can be bound and the Child is left.The CLI keeps
linkId(link-id shape only),residualInstallandremotePlatformfrom the error body. The dashboard picks its step from those closed fields instead of matching the server's prose, and shows the bound commands as chips in all 11 locales. The old "check the Child, treat links you do not recognise as another's" line is gone.ocx-child (P3-1):
check_expected_linknow finishes the owner's own interrupted operation in phase attaching or detaching, when any attach rollback names no link or this one. Before, a bound detach that marked the record detaching and then died while restoring that rollback left(L, detaching)plus the rollback, and every later bound detach answered residual with a reason that was false there. A rollback naming another link is still refused earlier. Test: kill the detach atrestore-before-write, then a seconddetach --expect-linkfinishes it (it failed with exit 6 before the fix).Text items:
child_link_mismatch: "a connect or key rotation of it may be in progress … if the same answer comes back, revoke this link with--forceonce any enrollment of this link has finished".alias_linked: "then runocx link recover --link-id <id>again" (never automatic). The CLI's revoke names--link-id <that link's id>, shown by ocx link status.child_recover_unsupported: "once the machine is gone, or a person on that machine has checked and cleaned its ocx-child records by hand". An--operation-idrecover names that operation id:alias_linkedsays to runocx link recover --operation-id <op>again, and the way out for either refusal isocx link operations resolve --operation-id <op> --yes(an operation's target comes from the journal, and--listshows only tombstones).ocx link cleanuprestarts only "if it disconnected";.exepath;/1residual reason drops "written by an older ocx-child", since a current build also writes/1when it adopts a pre-ownership attachment.Item 7,
tests/ci-workflows/structure-ssot.test.tslocally: this machine'sgitis a shell shim (~/.local/bin/git) that finds the real binary under$HOME. The test preload replacesHOMEwith a sandbox, so every git call in the test exits 127. The two git-scaffold cases fail on that directly. The tree check, unable to read the index, falls back to the filesystem, where this worktree has nonode_modules/@openai/codex,codex-win32-x64,.package-lock.jsonor.pnpm. CI has a real git, so it passes there; nothing in the repository to fix.Residual step after a failed enrollment, full install, before and after:
Residual step after a failed plant rollback, before and after:
Commits, one per item:
Known limits: a lightweight Child whose
ocx-childpredates--expect-linkis left as it is after a failed enrollment, because no step can be bound there. Its configuration names a link whose key the Home revoked.Verification
All on the final head,
ee0098a03plus these commits:native/ocx-childon Rust 1.100.0:cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass (54 unit, 27owner_link, the other binaries).bun test tests/cli/cli-link*.test.ts tests/server/link-*.test.ts tests/ci-workflows/docs-spanish-localization.test.ts tests/ci-workflows/skill-ocx.test.ts(temporaryHOME/OPENCODEX_HOME, empty git guard): 1005 pass, 0 fail.cd gui && bun test tests/remote-link.test.tsx tests/locale-parity.test.ts: 78 pass, 0 fail (remote-link.test.tsx), andlocale-parity.test.tspasses.lint:i18nandbuildexit 0.bun run typecheck,structure:check,skill:surface:check,privacy:scan: pass.ocx-childthat need not be onPATH), both fixed test-first in their own commits. Each behaviour change failed its test first: the Rust kill test (exit 6), the server, CLI and GUI residual tests, and the text tests.NOT RUN: full
bun run test(focused suites only; CI runs the rest); Windows and real SSH execution.Checklist