Repository navigation
Closed
Description
Summary
A Home-initiated Remote Link to a macOS laptop Child drops every time the laptop sleeps, as designed. Two things then go wrong:
- The Child's own status lies. While the Home showed the link
failed(reason: timeout), the Child'socx connect statuskept reportingConnection: connected,readiness: ready, andKey rotation: clean. Every real request from Codex on that Child failed with503 home_unreachable("link tunnel unavailable"). Someone checking only the Child sees a healthy link and cannot tell why Codex is failing. - Recovery after wake is slow and looks like an outage. After the laptop woke, the link stayed
failedfor minutes. The next scheduled retry was up to 5 minutes away underHOME_TUNNEL_RETRY_POLICY(60 → 120 → 240 → 300 s cap). A manualocx link reconnecton the Home connected in 6 s, which confirms the network had been fine for a while.
Environment
- Home: macOS, opencodex 2.100.0
- Child: macOS 15.7.3 laptop on battery, joined via
ocx link add(Home-initiated,-Rtunnel), with Codex and Claude selected - Transport: Tailscale (shared device) + regular macOS sshd
Evidence (2026-11-10, KST)
Each tunnel drop in the Home's ~/.opencodex/link/diagnostics.jsonl matches a sleep entry in the Child's pmset -g log:
Child pmset |
Home tunnel transition |
|---|---|
| 00:46:07 Idle Sleep | 00:46:41 connected → reconnecting (network); 00:51:42 → failed (timeout) |
| 12:55:51 Wake (lid) | 13:01:11 failed → connected (+5m20s) |
| 13:56:56 Idle Sleep | 13:57:56 connected → reconnecting; 14:02:56 → failed (timeout) |
| 14:52:28 Wake (lid) | 14:56:03 failed → connected (+3m35s) |
| 15:53:04 Clamshell Sleep | 15:54:03 connected → reconnecting; 15:59:03 → failed (timeout) |
| 16:26:34 Wake (lid) | 16:27:16 retry still failed (network); next retry was due 16:32:16. Manual ocx link reconnect at 16:31:04 → connected at 16:31:10 |
While the link was failed (checked 16:30):
- From the Home, Tailscale ping and three plain
ssh <child> 'echo ok'calls to the Child all succeeded. - Child
ocx connect status:Connection: connected,Transport: link,Key rotation: clean, catalog present - Child
GET 127.0.0.1:10100/v1/models→ 0 models - Child
POST 127.0.0.1:10100/v1/responses→503 {"code":"home_unreachable","error":"link tunnel unavailable", ...}
After the manual reconnect, the same requests returned 30 models and a normal gpt-6.1-sol completion.
Expected
ocx connect status/readinesson a link Child reflects tunnel liveness. If the reverse-tunnel port has no listener, or the last relayed request failed withhome_unreachable, it should not reportconnected/ready. The request path already detects this.- A Child coming back from sleep heals in seconds, not up to five minutes.
Suggestions
- Child status: probe the tunnel port (or reuse the relay's last
home_unreachableresult) and report something likeconnected (tunnel down since …)ordegraded, so readiness is no longer static. - Faster wake recovery on the Home: while a link is
failedunder the 300 s cap, run a cheap reachability probe more often (e.g. TCP connect to the Child's sshd every 15–30 s, or a Tailscale peer-online signal). When it succeeds, reset the backoff and spawn right away. This keeps the "≤12 sshd attempts per hour" property for genuinely dead hosts. - Diagnostics: the failed retries were all labelled
networkand carried no stderr. Overlaps [Feature]: Add durable Remote Link failure diagnostics and opt-in tunnel debug logging #7297.
Context: the drop itself is expected (the policy comment in src/link/tunnel-state.ts calls out sleep explicitly). This issue is about the misleading Child status and the slow, invisible recovery afterwards.
Reacted by coderabbitai
Activity
coderabbitai commentedon Nov 10, 2026
🔗 Related PRs
#7560 - fix(link): keep retrying failed Home tunnels, report Child link readiness, record tunnel diagnostics [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!
lidge-jun commentedon Nov 10, 2026
The Child-side status half is in #8496:
ocx connect statuson a link Child now printsLink tunnel: up | down (<reason>) | unknown (<reason>)from the running Child's/readyzverdict, and--jsoncarries it aslinkTunnel.The other half, how fast the Home reconnects after a sleeping Child wakes, is a retry-policy choice, so I am leaving it for the owner instead of changing it here. Today
HOME_TUNNEL_RETRY_POLICY(src/link/tunnel-state.ts) reuses the client policy: timeout and forward failures retry after 60 s, doubling to a 300 s cap, and auth starts at 300 s, which limits a dead host to 12 sshd attempts an hour.Options:
timeout/forwardretries at 60 s for Home tunnels, keepingauthat 300 s. A sleeping host never reaches sshd, so these retries add no authentication attempts. Recovery is at most about 60 s after wake.Recommendation: 3. It is one policy constant and keeps the auth bound that the 12-per-hour comment protects. This issue stays open for that decision.
fix(link): show a Child's tunnel state in ocx connect status
fix(link): show a Child's tunnel state in ocx connect status (#8496)
lidge-jun commentedon Nov 10, 2026
The Child status half landed in #8496 (
15cf4c9018).ocx connect statuson a link Child now printsLink tunnel: up | down (<reason>) | unknown (<reason>), and--jsoncarries it aslinkTunnel. The issue stays open for the wake-recovery cadence decision in the comment above.lidge-jun commentedon Nov 10, 2026
Decision (coordinator, 11-11): cap only the Home tunnel's
timeout/forwardretries at 60 s, so a Child that wakes reconnects within about a minute. Theauthretry and the hourly bound on login attempts stay as they are. Implementation follows in a PR for this issue.fix(link): retry a timed-out or refused-forward Child every minute fr…