[Bug][Windows] Remote Link relay verification times out and leaves a stale Child connection after Home rollback
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Start with src/link/remote-probe.ts and src/server/management/link-enrollment.ts to trace the shared relay-verification deadline and the two Windows probes; then read src/server/management/link-route-state.ts for failure compensation. Reproduce the reported timeout and check how enrollment recovery preserves the attempt ID and phase. Done means Windows verification has a bounded budget for both probes and failed enrollment leaves a safe, actionable recovery state on both machines; the empty desktop-remote directory may warrant separate handling.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 16.9k
- Fork
- 1.3k
- Merge medio
- 1g 4h
- PR unite (30g)
- 814
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lidge-jun/opencodex
-
bug gui platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
lidge-jun/opencodex#9172 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log lineForse già presa @EnesKartal l’ha presa 4 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lidge-jun/opencodex#9057 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersForse già presa @sedoll l’ha presa 6 giorni fa. Apertacatalog provider provider-compatibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
lidge-jun/opencodex#9037 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug cli
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
lidge-jun/opencodex#9171 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
account-pool enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lidge-jun/opencodex
Issue simili
-
manually bump balena-preload to ^19.0.6Forse già presa @shaunmulligan l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 66/100
balena-io/balena-cli#3200 ·
I maintainer di solito rispondono entro 1 giorno
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMForse già presa @olegius88 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
melgarafael/DeskcommCRM#5340 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
I maintainer di solito rispondono entro 1 giorno