[Bug][Windows] Remote Link relay verification times out and leaves a stale Child connection after Home rollback
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 16.9k
- フォーク
- 1.3k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 814
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lidge-jun/opencodex のほかの issue
-
bug gui platform
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
lidge-jun/opencodex#9172 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log line対応中かも @EnesKartal が 4 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
lidge-jun/opencodex#9057 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offers対応中かも @sedoll が 6 日前に担当しました。 オープンcatalog provider provider-compatibility
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
lidge-jun/opencodex#9037 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug cli
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
lidge-jun/opencodex#9171 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
account-pool enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
lidge-jun/opencodex の issue をすべて見る
似ている issue
-
manually bump balena-preload to ^19.0.6対応中かも @shaunmulligan が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 66/100
balena-io/balena-cli#3200 ·
メンテナーはふだん 1 日以内に返信
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOM対応中かも @olegius88 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
難易度 1/5 1時間未満 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
melgarafael/DeskcommCRM#5340 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
メンテナーはふだん 1 日以内に返信