Skip to content

fix(link): Remote Link recovery texts never send the operator to disconnect a Child another link owns - #8685

Merged
lidge-jun merged 11 commits into
devfrom
fix/remote-link-force-remove-ownership
Nov 13, 2026
Merged

lidge-jun merged 11 commits into
devfrom
fix/remote-link-force-remove-ownership

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Several recovery texts on the Remote Link page and in the CLI told the operator to disconnect a Child unconditionally: ocx disconnect, or ocx-child detach on a lightweight Child. The texts are the Remove here only dialog, which the dashboard opens when the Home's disconnect fails; the step shown after an enrollment fails and may have left the Child connected; and ocx link cleanup's Windows step. Each can be read after the machine has joined another link, a hub or another Home, for example after it was enrolled again. Following the old text then removes that newer link.

#8662 fixes the CLI and guide side of the same problem: the guide's Remove here only block, the ocx link revoke --force output (src/cli/link.ts), the revoke help line, and recover's child_recover_unsupported and child_residual answers. Once #8662 is in, its link-bound refusals (remote_disconnect_failed with child_link_mismatch) reach this dialog. Land this PR first, or in the same train as #8662, before any release. On its own it makes nothing worse than dev.

  • Force-remove dialog, full Child: the dialog gives ocx disconnect only if the machine is still connected to this link, and says to leave it as it is otherwise. It shows the link id and asks the operator to note it, because nothing on the Home records that id after the removal.
  • Force-remove dialog, lightweight Child: the dialog points at ocx link recover --link-id <id>, run on the Home. That command cleans the machine only while it still belongs to this link, in one command. The forced removal leaves a tombstone that records the id.
  • After a forced removal: the page keeps one notice per forced removal until the operator dismisses it or leaves the page. Before, the dialog closed and the refresh removed the row, so the command and the id went with it. A full Child gets ocx connect status, then ocx disconnect, only if it shows Link: <id> or no connection. A lightweight Child gets the ocx link recover --link-id <id> line. After a reload, ocx link recover --list still lists a lightweight Child's tombstone; nothing records a full Child's removal.
  • Check, then disconnect: for a full Child and a Child of unknown type, checking the machine's link and disconnecting it are two commands. An enrollment that lands between them would be removed. The notice says so and gives the safe order, as fix(link): a revoke names its link (disconnect --expect-link), and no revoke removes a tombstone it did not write #8662's guide does for child_link_mismatch: run the two commands right after each other, and disconnect by hand only when the machine shows this link or no connection. Do not disconnect a machine that shows another link, a hub or another Home. This Home has already revoked its own link with the forced removal.
  • Child of unknown type: a link saved before the Home recorded the Child type has no childKind. The dialog and notice used to treat it as a full install. Its forced removal leaves no tombstone, so ocx link recover has nothing to settle. The dialog names no command, says the Home keeps nothing to recover from, and asks the operator to note the id. The notice asks for ocx connect status --json, or the lightweight agent's connect status --json; every ocx-child version prints its link there.
    • Where the agent lives: the notice names every place the product plants or finds an ocx-child. That is the planted ~/.cache/opencodex/bin/ocx-child; on Windows %LOCALAPPDATA%\opencodex\bin\ocx-child.exe, or %USERPROFILE%\.cache\opencodex\bin\ocx-child.exe where LOCALAPPDATA is not set; and a copy placed by hand in ~/.local/bin or elsewhere on PATH. To find the copy on PATH it gives command -v ocx-child, or where.exe ocx-child on Windows; plain where is an alias of Where-Object in PowerShell and prints nothing. The planted path stays as the example in the commands, which tell the operator to use the path of the copy the machine runs.
    • No link-bound detach: detach --expect-link is not offered for this Child. The earliest ocx-child ignored unknown detach flags and would detach whatever link it has.
  • Link id check: the dashboard's status parser refuses a row whose id is not lnk_ plus 16 hex digits. The store already enforces that form, so a real server never sends anything else. A malformed answer can no longer put shell syntax into a copied command.
  • Enrollment residual step: the dashboard's residual notice, ocx link add's failure text and the guide's sentence on residual Child configuration (English and Spanish) now put a check before the step. It names the command: ocx connect status, or ocx-child connect status --json on a lightweight Child. A live failure answer carries no link id, so the text says the attempt's link id is not shown. It says to treat any link the operator does not recognise as another's: leave the Child as it is and skip the step. The server's fixed recovery line in the apply answer is unchanged; the dashboard matches it word for word to pick its step, and the CLI never prints it.
  • ocx link cleanup, Windows: the recovery step used to say ocx disconnect on the recorded alias. It now asks the operator to check with ocx connect status --json that the machine is still connected to this link, and to leave it otherwise.
  • Keys in all 11 locales:
    • new: remoteLink.forceRemove.ephemeralBody, remoteLink.forceRemove.unknownBody, remoteLink.forceRemove.noteId, remoteLink.forceRemoved.ephemeral, remoteLink.forceRemoved.fullCheck, remoteLink.forceRemoved.fullDisconnect, remoteLink.forceRemoved.unknownCheck, remoteLink.forceRemoved.unknownLocate, remoteLink.forceRemoved.unknownLightweight, remoteLink.forceRemoved.unknownDisconnect and remoteLink.residual.ownership;
    • reworded: remoteLink.forceRemove.body.
    • A test pins every path, command and placeholder in these texts byte for byte across the locales.

Force-remove dialog, full Child, before and after, then with the link id to note:

Force-remove dialog for a full Child, before

Force-remove dialog for a full Child, after

Force-remove dialog for a full Child with the link id to note

Force-remove dialog, lightweight Child, before and after:

Force-remove dialog for a lightweight Child, before

Force-remove dialog for a lightweight Child, after

After Remove here only on a full Child. Before, the row was gone and nothing remained:

Page after a forced removal of a full Child, before

After, the notice names the link id and the check:

Page after a forced removal of a full Child, after

After Remove here only on a lightweight Child:

Page after a forced removal of a lightweight Child, after

A Child of unknown type, the dialog and the notice after removal. In both captures the wording is one round older: the head prints where.exe ocx-child, and the dialog now says the steps stay until they are dismissed or the page is left, and shows the link id to note.

Force-remove dialog for a Child of unknown type

Page after a forced removal of a Child of unknown type

Enrollment residual step, before and after:

Residual step after a failed enrollment, before

Residual step after a failed enrollment, after

Stays inert by default. Only copy, a notice and the stricter id check change. What the dialog sends ({ "force": true }) is unchanged, no new request is sent, and nothing runs on its own. Server answers are unchanged.

Known limits:

Verification

Tests that failed first:

  • gui/tests/remote-link.test.tsx "disconnect failure opens force confirmation and sends force body" expects the full-Child condition. The ephemeral --purge flow expects ocx link recover --link-id <id>, no ocx-child detach, no request to note the id, and then the notice with that chip.
  • "a status row whose id is not a link id is refused" covers shell syntax, link-1, a non-hex digit and a 17-digit id. It failed on the old parser.
  • "a forced removal of a full Child leaves a notice" checks the following, and it failed on each missing piece in turn:
    • the dialog asks to note the id;
    • the row goes and the notice shows Link: <id>;
    • the notice states the two-command risk and its safe order;
    • the chips are ocx connect status and ocx disconnect;
    • Dismiss removes the notice.
  • "a forced removal of a Child of unknown type" checks the following, and it failed on the full-install text, the missing locations, where ocx-child, the risk clause and the old persistence promise:
    • the dialog names no command, says how long the steps stay, and asks to note the id;
    • the notice gives five chips: ocx connect status --json, command -v ocx-child, the planted ocx-child connect status --json, ocx disconnect and the planted ocx-child detach;
    • it names ~/.local/bin, PATH, both Windows locations and where.exe ocx-child, and no ocx link recover.
  • The residual step tests (dashboard) and tests/cli/cli-link-enrollment.test.ts (three cases) expect the ownership check for a residual answer, before the step, with its command and the missing-id sentence, and its absence otherwise. They failed on the old order and wording.
  • tests/cli/cli-link-cleanup.test.ts: the Windows step's text.
  • "every locale keeps the force-remove and ownership texts' paths, commands and placeholders byte for byte" is a pin. Changing where.exe in one locale fails it.

GUI fixtures use store-form link ids (lnk_ plus 16 hex digits).

At the head:

  • cd gui && bun test tests/remote-link.test.tsx tests/locale-parity.test.ts tests/remote-link-child-ops.test.tsx: 116 pass, 0 fail.
  • bun test tests/cli/cli-link tests/ci-workflows/docs-spanish-localization.test.ts: 311 pass, 0 fail.
  • cd gui && bun run lint:i18n: exit 0. cd gui && bun run build: exit 0.
  • bun run typecheck: exit 0. bun run structure:check: exit 0.

The captures come from a scratch harness that serves this build against stubbed answers. In it, a disconnect answers remote_disconnect_failed and an apply answers key_cleanup_failed with a residual. The "before" captures used the previous head's gui/src.

Local Bun runs set OCX_GIT_CONFIG_GUARD_CHECKOUT to a directory without .git. On this macOS machine the preload's git-config guard (#8652) cannot run git under the test environment, and fails the first test of every file independent of any change.

NOT RUN:

  • the full bun run test;
  • bun run test:changed, because Bun's --changed reports "no working git found" on this machine;
  • the full GUI suite;
  • a native-speaker review of the ten translations.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (the English and Spanish Remote Link guides).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. A command chip carries only a link id that passed the status parser's lnk_ plus 16 hex check; no new request is sent.

…the operator to disconnect a Child another link owns

The dashboard dialog after a failed disconnect (Remove here only) told the operator to run ocx disconnect, or a plain ocx-child detach on a lightweight Child, on the machine afterwards. A forced removal is also the way out when that machine now belongs to another link, a hub or another Home, and such a disconnect would remove that link. A full Child now gets the command only if it is still connected to this link, and to leave it otherwise; a lightweight Child gets the link-bound ocx link recover --link-id <id>, run on the Home, which cleans it only while it still belongs to this link (new key remoteLink.forceRemove.ephemeralBody in all 11 locales). ocx link cleanup's Windows step carries the same condition. Tests updated first; they failed on the old text.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 13, 2026
… so no copied command carries anything else

The force-remove dialog copies a row's id into ocx link recover --link-id <id>, and the parser accepted any nonempty string. It now refuses a row whose id is not lnk_ plus 16 hex digits, the form the store already enforces, so a malformed status answer cannot put shell syntax into a copied command. Test fixtures use store-form ids; the new test failed on the old parser.
…hild's next step until it is dismissed

Remove here only closed the dialog and the refresh removed the row, so the command and the link id the operator needs once the Child answers vanished with it. The page now keeps one notice per forced removal until it is dismissed: a lightweight Child gets ocx link recover --link-id <id>, run on this Home, which cleans the machine only while it still belongs to that link; a full Child gets ocx connect status, then ocx disconnect only if it shows Link: <id>, and is left alone when another link, a hub or another Home owns it. Three new keys in all 11 locales. Tests failed first on the missing notice.
…a Child that has since joined another link

After a failed enrollment that may have left the Child connected, the dashboard, ocx link add and the guide told the operator to run ocx disconnect (or ocx-child detach, or its --purge) on the Child, unconditionally. The step can be acted on long after the attempt, when the same Home or another one has enrolled that machine into a newer link, and following it then removes that link. Each residual step now ends with: check the Child first; if it has since joined another link, a hub or another Home, leave it as it is (new key remoteLink.residual.ownership in all 11 locales; the English and Spanish guides). The server's fixed recovery line is unchanged: the dashboard matches it exactly and the CLI never prints it. Tests failed first on the missing sentence.
lidge-jun added a commit that referenced this pull request Nov 13, 2026
lidge-jun added a commit that referenced this pull request Nov 13, 2026
lidge-jun added a commit that referenced this pull request Nov 13, 2026
lidge-jun added a commit that referenced this pull request Nov 13, 2026
lidge-jun added a commit that referenced this pull request Nov 13, 2026
@lidge-jun lidge-jun changed the title fix(link): the force-remove dialog and the cleanup report never send the operator to disconnect a Child another link owns fix(link): Remote Link recovery texts never send the operator to disconnect a Child another link owns Nov 13, 2026
…nstall's link instead of assuming a full install

A link saved before the Home recorded the Child type has no childKind. The force-remove dialog and the notice treated it as a full install and named ocx connect status and ocx disconnect, which cannot clean a machine that runs only ocx-child; its forced removal also leaves no tombstone, so ocx link recover has nothing to settle. The dialog now names no command and says the Home kept nothing to recover from. The notice asks for ocx connect status --json, or ~/.cache/opencodex/bin/ocx-child connect status --json on a lightweight Child (every ocx-child prints its link there), and only if the output names this link, ocx disconnect or that ocx-child's detach; otherwise leave it. A link-bound detach --expect-link is not offered because the earliest ocx-child ignored unknown detach flags. Four new keys in all 11 locales; the full-Child test fixture now says childKind full. The new test failed on the full-install text.
lidge-jun added a commit that referenced this pull request Nov 13, 2026
lidge-jun added a commit that referenced this pull request Nov 13, 2026
…live and how to find the one on PATH

The notice for a Child of unknown type named only the planted ~/.cache/opencodex/bin/ocx-child. The Home also runs an ocx-child placed by hand in ~/.local/bin or on PATH, and on Windows plants it under %LOCALAPPDATA%\opencodex\bin, or %USERPROFILE%\.cache\opencodex\bin where LOCALAPPDATA is not set. A new line (remoteLink.forceRemoved.unknownLocate) names those locations and gives command -v ocx-child (where ocx-child on Windows) to find the copy on PATH; the planted path stays as the example in the commands, which now say to use the path of the ocx-child the machine runs if it is not the planted copy (remoteLink.forceRemoved.unknownLightweight, reworded). All 11 locales. The test failed first on the missing locations and chip.
…k and the disconnect and keep another link's machine untouched

Both the full-install and the unknown-type notice ask for a check of the machine's link and then a disconnect: two commands, and an enrollment that lands between them would be removed. The disconnect line (remoteLink.forceRemoved.fullDisconnect, remoteLink.forceRemoved.unknownDisconnect) now says to run them right after each other, to disconnect by hand only when the machine shows this link or no connection, and not to disconnect a machine that shows another link, a hub or another Home, since this Home has already revoked its own with the forced removal (as #8662's guide says for child_link_mismatch). The lightweight Child's notice keeps the link-bound ocx link recover and is unchanged. All 11 locales. The tests failed first on the missing sentences.
lidge-jun added a commit that referenced this pull request Nov 13, 2026
lidge-jun added a commit that referenced this pull request Nov 13, 2026
…lso works in PowerShell

In PowerShell 'where' is the alias of Where-Object and prints nothing, which reads as no ocx-child on PATH. where.exe works in Command Prompt and PowerShell. All 11 locales (remoteLink.forceRemoved.unknownLocate); the test failed first on the old text.
…nknown-type text says how long the steps stay

The forced-removal notice is page state: a reload or leaving the page loses it, yet the unknown-type dialog promised the steps stay on this page afterwards. It now says they stay until the operator dismisses them or leaves the page (remoteLink.forceRemove.unknownBody), and for a full Child or one of unknown type, whose removal leaves no tombstone, the dialog shows the link id with a request to note it (new remoteLink.forceRemove.noteId). A lightweight Child's tombstone records the id, so its dialog does not ask. All 11 locales; the tests failed first on the missing sentences.
…step, names its command, and says the attempt's link id is not shown

The ownership sentence came after the command it guards and named no check. In the dashboard (remoteLink.residual.ownership, its own element before the step), in ocx link add's residual text and in the English and Spanish guides it now comes first: check the Child with ocx connect status (ocx-child connect status --json on a lightweight Child). A live failure answer carries no link id, so the text says the attempt's link id is not shown and to treat any link the operator does not recognise as another's: leave the Child as it is and skip the step. All 11 locales; the dashboard and CLI tests failed first on the old order and wording.
…and placeholders across all 11 locales

An operator copies these literals. The test requires each one (the planted and Windows paths, ~/.local/bin, PATH, where.exe ocx-child, ocx-child connect status --json, Link: {linkId} and the placeholders) to appear in every locale exactly when it appears in English. Changing where.exe in one locale fails it.
lidge-jun added a commit that referenced this pull request Nov 13, 2026
lidge-jun added a commit that referenced this pull request Nov 13, 2026
@lidge-jun
lidge-jun marked this pull request as ready for review November 13, 2026 11:18
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 11:18
@lidge-jun
lidge-jun merged commit b20ea69 into dev Nov 13, 2026
33 checks passed
@lidge-jun
lidge-jun deleted the fix/remote-link-force-remove-ownership branch November 13, 2026 11:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-13T11:20:14.760064Z 1164b28 Draft marked ready
ℹ️ 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 added a commit that referenced this pull request Nov 13, 2026
…und detach finishes its own interrupted attach (#8691)

* fix(cli): O1c-8, the journalled revoke's guidance runs as printed and follows every state a repeat can leave

Follow-ups to #8654's review:
- operation_journal_unreadable printed "ocx link revoke --force without --operation-id also runs", a usage error as printed. It now names ocx link revoke --link-id <id> --force --yes, without --operation-id, built from the validated link id like the retirement guidance.
- An unknown revoke whose record is already gone and whose receipt this id still owns: the repeat's resume settles the entry committed, and clearing the receipt can still answer 503. The unknown-outcome text and the structure paragraph now say: if it reads committed, the removal finished: repeat it once more to clear what it left.
- The structure's alias-lock sentence said a waiter that gets the lock can still finish before the CLI calls the outcome uncertain; it now uses alias-lock.ts's own wording (the wait is bounded, the finish is not promised).
- "A resume reopens the entry" holds only while the record is still listed (link.ts comment and structure).
- The tombstone-limit test's title and comment use the text's own words (the link, its key or the Child).

The two behaviour tests failed first on the old texts.

* fix(link): alias_linked checks the machine first, keeps it when the check cannot tell, and gives the forget way out on its own with the link id

#8662 delta review, P3 1, 3 and 4:
- A machine that cannot be reached, whose state cannot be read, or that shows a connect or key rotation in progress now counts as running that link: leave it, and the tombstone waits until that link is removed.
- The server message and the en and es CLI reference now carry the check step the CLI text and the guide had: check which link the machine runs (ocx connect status --json, or the planted ocx-child's), and revoke the other link only if it shows neither that link nor a connect or key rotation in progress.
- The forget way out was inside the branch that keeps the machine running that link; it is its own sentence now (once the machine is confirmed clean or gone), and the CLI fills the link id it was called with instead of printing <id> (the placeholder stays for --operation-id).

The CLI and server tests failed first on the old texts.

* fix(link): expect_link_unsupported says how to tell the other link is stale, and keeps the pinned-key case apart

#8662 delta review, P3 2. The parenthesis mixed the same-pinned-key case into the staleness test and never said how to check it. The step now reads: revoke the other link first only if it is stale too, that is, ocx connect status --json on the machine (the planted ocx-child's on a lightweight Child) does not show its id; if the check cannot be run, leave it, since through a shared route its revoke would disconnect it. Under the same pinned host key its revoke is refused the same way, so use --force instead. CLI hint, server message, en and es guide. The CLI hint test failed first.

* fix(link): child_disconnect_pending finishes a disconnect by hand only when the machine shows no connection

#8662 follow-up P3-a. The remedy said to check "whose it is" with ocx connect status, which cannot answer that, and to finish the disconnect when it shows this link's id or no connection. It now says the status cannot tell whose disconnect it is, finishes it with ocx disconnect only when the machine shows no connection, and sends every other answer (any link, a hub or another Home, an unreadable state, an unreachable machine) to --force. CLI hint, server message, en and es guide, structure row. The CLI hint tests failed first.

* fix(link): child_link_mismatch has a branch for a machine that shows this link's id, and one for a check that cannot answer

#8662 follow-up P3-b. A Child refuses a bound disconnect of its own link while a connect or key rotation of it is in progress (pending_operation), so the status can show this link's id. The remedy now says so: let it finish on the Child, then revoke again (a new or the same operation id by outcome). An unreadable state is repaired on the Child; if that is not possible, or the machine cannot be reached, revoke this link with --force once any enrollment of this link has finished. CLI hint, server message, en and es guide. The CLI hint tests failed first.

* fix(link): a forced revoke's full-Child step uses ocx disconnect --expect-link, which closes the race between a check and a plain disconnect

#8662 follow-up P3-c. The force texts said to check ocx connect status and then run a plain ocx disconnect right after, accepting that an enrollment landing between the two would be removed. ocx disconnect --expect-link <id> (from #8662) acts only while the machine is connected to this link, so it is the step now; an OpenCodex older than the flag refuses it as a usage error before it acts on the link, and only then does the check-then-disconnect order apply, with "its state cannot be read" added to the leave-it branch. The forced revoke's output, the revoke usage line, the guide's Remove here only block and code block (en and es), the CLI reference (en and es), the capability text and the generated skill reference, and the recipe. The force-output tests failed first.

* fix(link): a forced revoke of a link without a recorded Child type names the steps for either install

#8662 follow-up P3-d. A link saved before the Home recorded childKind keeps no tombstone (link-routes.ts writes one only for a known ephemeral Child), yet the forced revoke's output gave the full-install step only, and the guide and CLI reference had no step at all. The CLI now tells three cases apart (ephemeral, full, unknown, where unknown also covers a link the store does not list or a store it cannot read): for unknown it names ocx link recover when ocx link recover --list shows the link, and otherwise ocx disconnect --expect-link <id> on a full install or the planted ocx-child's detach --expect-link <id> on a lightweight Child (with its paths), the fallback for a build older than the flag, and the leave-it branch. The guide (en and es) and the CLI reference (en and es) say the same. Released ocx-child builds all parse detach's arguments strictly (since v2.100.0), so the bound form never detaches a link it does not name. The force-output tests failed first.

* fix(ocx-child): a bound detach finishes this link's own attach interrupted before its state write

#8662 follow-up P3-f. An attach of link L interrupted after it wrote the owner record (phase attaching) but before state.json was refused as residual by detach --expect-link L, with a reason telling the operator to run a plain detach, while the Home's texts say never to run one; nothing could clean it. check_expected_link now finishes it as a plain detach would when no other link is involved: the record names L in phase attaching and any rollback snapshot names no prior link or L (a rollback naming another link is still refused as residual earlier in the check). The remaining refusal reasons no longer recommend a plain detach. A test barrier (attach-before-state-write) marks the point after the CODEX_HOME change and before the state write. Two tests in owner_link.rs (an attach stopped right after the record, and one stopped after it changed CODEX_HOME and left its rollback) failed first with residual (exit 6) and now restore the original config and release the record; another link's bound detach still answers conflict. structure/remote-link.md says so.

cargo fmt --check, cargo clippy --locked --all-targets -D warnings and cargo test --locked (Rust 1.100.0): pass.

* fix(link): child_recover_unsupported gives a way out that runs as printed, and the purge path's dead remedy text goes

#8662 follow-up, the rest of P3-e. After recover answered child_recover_unsupported (the planted ocx-child predates detach --expect-link) the operator was told only not to detach and, for a gone machine, to forget. The answer now gives the check first: that ocx-child's connect status --json; only if it shows this link's id, its plain detach right after the check removes this link's attachment; another link, nothing, an unreadable state or an unreachable machine: leave it. Recover cannot confirm either case with that build, so the forget command follows with this link's id filled in. The purge path's own remedy for expect_link_unsupported (remote-plant.ts) never reached a user, since the route answers the hint's fixed message; it now names only what happened, with a comment saying where the remedy lives. The recover test failed first on the old message.

* fix(link): the Windows planted path is said to be a Command Prompt path, and recover's promise says what it really checks

#8662 follow-up, the rest of P3-h.
- %LOCALAPPDATA%\opencodex\bin\ocx-child.exe expands only in Command Prompt (PowerShell spells it $env:LOCALAPPDATA). The child_link_mismatch check (CLI hint, server message, en and es guide) now says "in Command Prompt on Windows".
- "It cleans the machine only while it still belongs to this link" was not what recover checks: it acts when the machine's records name this link or nothing at all (then it only removes the planted binary) and refuses a machine another link owns. The forced revoke's output, the guide (en and es) and the capability text with its generated skill reference now say so.
The CLI tests failed first on the old texts.

* fix(cli): ocx link cleanup's Windows steps run as printed and use the link-bound disconnect

#8662 follow-up (F3 from #8685's review). The report printed ocx link revoke --link-id <id> --yes, which the CLI refuses (--yes requires --force), and tests/cli/cli-link-cleanup.test.ts pinned that line. The step is the ordinary revoke, which disconnects through the recorded SSH trust and, since #8662, only while the machine is connected to this link: ocx link revoke --link-id <id>. The step on the machine now runs ocx disconnect --expect-link <id> and then ocx restart; an OpenCodex older than the flag refuses it before it acts on the link, and only then the check-then-disconnect order applies, with the leave-it branch for another link, a hub, another Home or an unreadable state. The cleanup test failed first.

* fix(gui): the force-remove dialog and notices use the link-bound commands, and a Child's refusal gets its own title and reason

#8662 follow-ups for the dashboard (P3-g, the dialog title and hint, and the same steps as the CLI for P3-c and P3-h):
- A Child of unknown type: the notice named a plain ocx-child detach first. Every released ocx-child parses detach's arguments strictly (since v2.100.0), so the link-bound forms come first: ocx disconnect --expect-link <id> on a full install, or the planted ocx-child's detach --expect-link <id>; each acts only while the machine still belongs to this link. The check and the plain commands follow only for a build older than the flag.
- A full Child: the dialog and the notice name ocx disconnect --expect-link <id>, which closes the race between a check and a plain disconnect; the check-then-disconnect lines stay for an OpenCodex older than the flag, now with an unreadable state in the leave-it branch.
- A lightweight Child: "it cleans the machine only while it still belongs to this link" now says what recover checks: it acts only when the machine's records name this link or nothing at all, and refuses a machine another link owns.
- After #8662 a link-bound refusal (remote_disconnect_failed with hint child_link_mismatch, child_residual, child_disconnect_pending or expect_link_unsupported) opens the Remove here only dialog. It was titled "This machine could not reach {alias}", which is false when the Child answered, and it never showed why. The dialog now says "{alias} refused to disconnect from this link" with the reason from that closed set; any other hint keeps the unreachable title.
Seven changed and seven new keys in all 11 locales; the byte-for-byte pin covers the new ones. The dialog, notice and locale tests failed first on the old texts.

* docs(ocx-child): the residual classification comment no longer calls a plain detach the way out

* fix(link): alias_linked leaves the other link, since no status check can show it is stale

* fix(link): expect_link_unsupported no longer judges the other link stale from a status check

* fix(link): no remedy advises a plain ocx-child detach on the strength of a status check

* fix(gui): the unknown-type notice offers no unbound ocx-child detach, in every locale

* fix(cli): ocx link recover prints its own child_recover_unsupported text with the link id

* docs(link): the structure note and recover reference describe the bound detach finishing its own interrupted attach
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.

1 participant