Repository navigation
Description
Client or integration
OpenCodex dashboard
Also reproduced through the ocx link add CLI.
Area
Platform (Windows / macOS / Linux)
Windows Remote Link enrollment, relay verification, and failure recovery.
Summary
Adding a Windows Child from a Home can establish the SSH tunnel, persist the Child connection, and synchronize its catalog, but then fail during relay verification because two Windows SSH/PowerShell probes share a 15-second deadline.
The failed enrollment leaves inconsistent state:
- The Home stops the tunnel and removes its link record, so the device disappears from its dashboard.
- The Child retains
runtimeRole: clientand the saved Home/link identity. Its dashboard still says it is managed by that Home. - The Child's live connection check reports
linkTunnel.state: downwithreason: home_unreachable. - Retrying Add Child fails because the Child is already configured as a client.
The retry error therefore obscures the initial verification timeout. Expected: sufficient bounded verification time on Windows, and consistent recovery or an explicit recoverable partial-enrollment state on both machines.
Reproduction
Environment: two Windows x64 computers, OpenCodex installed globally through npm, Windows Task Scheduler background services, connected through Tailscale and Windows OpenSSH with existing key-based authentication.
- Start with the Child in standalone mode. If reproducing after a failed attempt, first disconnect the specific stale link and verify that the Child has returned to standalone.
- From the Home, run:
ocx link add <child-alias> --expect-fingerprint <verified-fingerprint> --json
- Observe the tunnel establish and the Child save its connection/catalog.
- On the affected setup, enrollment then fails with
child_relay_timeout. - Compare:
# Home ocx link status --json # Child ocx connect status --json
- Retry adding the same Child from the Home.
Before the controlled CLI reproduction, the Home diagnostics also contained three attempts that reached tunnel state connected and then stopped approximately 53–60 seconds later. Those events alone do not identify each attempt's original failure. The controlled reproduction captured the precise timeout below.
This is timing-dependent; it is not claimed to reproduce on every Windows installation.
Version
@bitkyc08/opencodex 2.100.5 on both Home and Child.
The original failure was reproduced before applying the local patch described below.
Operating system
- Home: Microsoft Windows 11 Pro, version 26H2, OS build 26300.9711, x64.
- Child: Microsoft Windows 11 Pro, version 26H2, OS build 26300.9974, x64.
Both OS editions, display versions, and full build numbers were queried directly on the respective machines. Both OCX services use Windows Task Scheduler.
Provider and model
Not provider-specific: the failure occurs during Remote Link enrollment and catalog relay verification.
Post-fix inference validation used the existing deepseek/deepseek-flash route with a synthetic “Reply with exactly OK.” prompt.
Logs or error output
First captured failure, with the recovery guidance shortened and the link identity redacted:
Error: Remote Link failed during Child relay verification:
ssh command exceeded 4180ms.
The Child may still be connected.
Run ocx disconnect --expect-link <attempt-link-id> on the Child ...
(code child_relay_timeout)
Exit code: 1
Subsequent attempt:
The Child is still linked to a Home (config runtimeRole client).
To end that link and move it here, on the Child run:
ocx disconnect, then ocx restart.
The inconsistent state, reduced to non-sensitive fields:
{
"home": {
"role": "standalone",
"links": []
},
"child": {
"state": "connected",
"transport": "link",
"catalog": "present",
"rotation": "clean",
"readiness": "ready",
"linkTunnel": {
"state": "down",
"reason": "home_unreachable"
}
}
}The saved state: connected / readiness: ready values did not imply that the live tunnel was up.
Screenshots and supporting files
Source-level findings in the installed 2.100.5 package
src/link/remote-probe.tsdefinesLINK_RELAY_VERIFY_MS = 15_000.- In
src/server/management/link-enrollment.ts, the post-restart health check and catalog relay verification share one deadline:The remaining time is passed to each successive remote command.const deadline = now() + LINK_RELAY_VERIFY_MS;
- Each Windows probe starts a separate SSH/PowerShell command.
- In the captured failure, only 4180ms remained for the second command. Approximately 10.8 seconds of the shared budget had already been consumed by the preceding check and intervening work.
- A separate no-business-operation SSH + PowerShell invocation took approximately 3.6 seconds on this setup. This is a local measurement, not a universal Windows baseline.
compensateNewLink()insrc/server/management/link-route-state.tsrevokes the issued key, stops the tunnel, and removes the Home record. After the observed failure, the full OCX Child installation still retained its client configuration.
Additional recovery obstacle: empty desktop-remote directory
Cleaning up the controlled failed enrollment with ocx disconnect --expect-link <attempt-link-id> was refused with desktop_lifecycle_unsafe because %USERPROFILE%\.opencodex\desktop-remote existed but contained neither Claude Desktop remote state nor a disconnect receipt.
Inspection confirmed that this directory was empty and was not a reparse point. Renaming it to a backup location, without deleting it or modifying client configuration, allowed disconnect to complete.
This is an additional recovery obstacle, not asserted to be the cause of the original timeout. It can be split into a separate issue if preferred.
Local workaround and validation
A minimal local patch on the Home changed only the overall Windows relay-verification deadline:
- const deadline = now() + LINK_RELAY_VERIFY_MS, remaining = () => Math.max(1, deadline - now());
+ const deadline = now() + (remotePlatform === "windows" ? 60_000 : LINK_RELAY_VERIFY_MS), remaining = () => Math.max(1, deadline - now());Each individual HTTP probe remains capped at 15 seconds. Authentication, runtime-role checks, and the complete authenticated catalog-relay verification were preserved.
Observed after the patch and Home service restart:
- Bun build check of the changed module passed.
- A fresh Home-initiated enrollment exited 0 and retained the Child in the Home's link list.
- The Child reported
readiness: ready,rotation: clean, andlinkTunnel.state: up. - The Child's local models endpoint returned HTTP 200 and 23 models.
- An actual Child → Home → provider request returned HTTP 200, content
OK, and finish reasonstop.
This supports insufficient shared verification time as the cause of the captured failure. 60 seconds is a locally successful workaround, not a claim that this fixed value is the best upstream design. No full upstream test suite or broader Windows matrix was run.
Requested behavior
- Account for Windows SSH/PowerShell startup overhead in the bounded relay-verification budget, so the first probe does not starve the second.
- Restore consistent state after failed enrollment where safe. If the Child cannot safely be restored, retain an explicit recoverable record on the Home and provide recovery scoped to the exact attempt/link ID.
- Preserve the original failed phase and reason in the dashboard; distinguish saved Home ownership from live connection health.
- Provide a safe, actionable recovery path for an empty
desktop-remotedirectory.
Redacted configuration
Relevant state only; this is not a full configuration export:
{
"beforeEnrollment": {
"childRuntimeRole": "standalone",
"childPort": 10100
},
"afterFailedEnrollment": {
"homeLinks": [],
"childRuntimeRole": "client",
"transport": "link",
"linkId": "<attempt-link-id>"
}
}Actual hostnames, SSH aliases, addresses, fingerprints, link/key identifiers, account details, and credentials have been omitted or replaced with placeholders.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
coderabbitai commentedon Nov 19, 2026
🔗 Related PRs
#8249 - fix(link): report stale Child connection readiness [merged]
#7560 - fix(link): keep retrying failed Home tunnels, report Child link readiness, record tunnel diagnostics [merged]
#7832 - feat(link): Windows Remote Link Children and Child credential/connection attestation [merged]
#8496 - fix(link): show a Child's tunnel state in ocx connect status [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
ZhenyuXiao commentedon Nov 19, 2026
Follow-up: empty
desktop-remotedirectory also blocks normal disconnectionThe empty-directory recovery obstacle described above recurred after successful enrollment. This affects normal Home-initiated disconnection as well as cleanup after failed enrollment.
Environment: OCX 2.100.5 on both machines; Home Windows 11 Pro 26H2 build 26300.9711 x64, Child Windows 11 Pro 26H2 build 26300.9974 x64, as reported in the issue. The Home had the local relay-verification timeout workaround described above.
Observed behavior
ocx disconnect --expect-link <link-id>on the Child.ocx connect status --jsonon the Child still reported the matching link,readiness: ready, andlinkTunnel.state: up.%USERPROFILE%\.opencodex\desktop-remoteon the Child existed again as an ordinary, empty directory (zero entries).The installed source's
desktopLifecycleRefusal()mapsroot_without_stateto a refusal ending indesktop_lifecycle_unsafe: the directory exists but contains neither Claude Desktop remote state nor a disconnect receipt. The earlier cleanup attempt in this issue captured that refusal directly. For this later dashboard attempt, we did not capture the complete backend error response or rerun the failing disconnect during diagnosis; the successful workaround above is user-confirmed.Expected behavior
desktop-remotedirectory safely, or provide an explicit, actionable recovery message identifying that directory. Preserve safeguards for nonempty, unreadable, or otherwise ambiguous state.Please treat this as additional evidence for the recovery obstacle already included in this issue, or split it into a separate defect if preferred. Hostnames, connection identifiers, and credentials are omitted.