Skip to content

fix(remote-link): name the Windows purge for a Windows Child and show Child commands as chips - #8637

Merged
lidge-jun merged 2 commits into
devfrom
fix/remote-link-residual-followups
Nov 13, 2026
Merged

lidge-jun merged 2 commits into
devfrom
fix/remote-link-residual-followups

Conversation

@lidge-jun

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

Copy link
Copy Markdown
Owner

Summary

Follow-up to #8617 (merged), from its final review. When an apply leaves a Windows Child possibly connected because the planted binary could not be purged, the Remote Link page told the user to run ~/.cache/opencodex/bin/ocx-child detach --purge, a POSIX path that does not exist on Windows. The server wrote that line too.

Change.

  • Server, at the source. The live apply answer for a Child that may still be connected (src/server/management/link-enrollment.ts, new liveResidual) now carries the closed words journalled replies already use: residualKind (plant when only the managed binary's purge removes it, else enrollment), plus remotePlatform when the Child's platform is known. Its fixed recovery line names both locations a Windows plant uses: "%LOCALAPPDATA%\opencodex\bin\ocx-child.exe" detach --purge (Command Prompt), or "%USERPROFILE%\.cache\opencodex\bin\ocx-child.exe" detach --purge where LOCALAPPDATA is not set. The POSIX and enrollment lines are unchanged.
  • Page. readLinkJson maps residualKind: "plant" with remotePlatform to a POSIX or a new Windows purge step (with a second line for the %USERPROFILE% location). A plant whose platform is not known, which is what a journalled --operation-id reply carries, gets a step that lists every managed location. Without those words the page still matches the fixed recovery lines, now including the Windows one. The server's text is never shown.
  • Commands as chips. The purge, Windows purge and ocx-child steps put their one command in a {cmd} chip through Trans, as gui/AGENTS.md asks. The full-install step names two commands (ocx disconnect and ocx restart), which a single Trans chip cannot hold, so it stays prose. The ocx-child step now names only ocx-child detach, its primary command, instead of also offering ocx disconnect in prose.
  • Terminology. zh, zh-TW, vi and fr translate the Child role almost everywhere (子设备, 子裝置, máy con, Enfant), so their residual steps now use that word instead of "Child". In zh, zh-TW and vi, link_pin_conflict used one word for both Home and host; it now reads "主机(Home)… SSH 主机密钥" and the like. ko, ja, de, pt, ru and tr mix "Child" with a translated role, so there is no rule to apply and they keep "Child".

Before (a Windows Child whose plant rollback failed):

before

After (Windows with its fallback location, a plant whose platform is not known, and macOS or Linux):

after

An ocx-child Child without a fresh plant gets one chip, ocx-child detach (capture).

The captures come from a scratch Vite page that mounts the real LinkErrorNotice in the dashboard theme. They are on the pr-assets branch, linked by commit SHA, and are not committed to this branch.

Stays inert by default. Nothing changes until an apply fails in a way that may leave the Child connected. The answer only gains fields; older dashboards that read only recovery keep working for POSIX and enrollment lines, and show their generic step for the new Windows line.

Verification

Tests that failed first, with this change's source files restored to origin/dev:

  • gui/tests/remote-link.test.tsx: 6 failed. These were the four "names its Child command as a chip" cases (POSIX recovery line, plant+posix, plant+windows, ocx-child), the locale check that every locale has the Windows step and uses {cmd} exactly in the chip steps, and the readLinkJson variant test.
  • tests/server/link-enrollment-ephemeral-child.test.ts: failed to load (liveResidual did not exist). The POSIX rollback case now also checks residualKind and remotePlatform.

Review round 1 (gpt-6.1-terra) found that the Windows step missed the %USERPROFILE% location the plant uses without LOCALAPPDATA, and that a journalled plant reply, which names no platform, lost its purge step. Both are fixed; against the first head, the Windows-chip, journal-replay, locale and readLinkJson tests failed (4) and the server test failed.

Test changes from the #8617 review: link_pin_conflict is driven through a stubbed confirm-host refusal, the route the server answers it from, and every apply case goes through the one refusedAt/applyRefusal helper instead of repeating the flow.

At head 206b015:

  • cd gui && bun test tests/remote-link.test.tsx tests/locale-parity.test.ts: 74 pass, 0 fail.
  • bun test tests/server/link-enrollment-ephemeral-child.test.ts tests/server/link-enrollment.test.ts: 59 pass, 0 fail.
  • cd gui && bun run lint:i18n: exit 0, no findings.
  • cd gui && bun run build (tsc -b and both Vite builds): exit 0; only the existing chunk-size warning.
  • bun run typecheck, bun run privacy:scan, bun run structure:check: exit 0.

NOT RUN: the full bun run test and the full GUI suite; a real Windows Child.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (structure/remote-link.md describes the new answer fields).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults: the page still never echoes server text; the answer gains two closed words.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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
…anaged location when the platform is unknown
@lidge-jun
lidge-jun marked this pull request as ready for review November 13, 2026 04:15
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 04:15
@lidge-jun
lidge-jun merged commit 6b36883 into dev Nov 13, 2026
33 checks passed
@lidge-jun
lidge-jun deleted the fix/remote-link-residual-followups branch November 13, 2026 04:15
@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-13T04:16:49.403171Z 206b015 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
No conflicts: dev's change to src/server/management/link-enrollment.ts and structure/remote-link.md merged with this branch's edits on its own.
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