Skip to content

fix(voice-call): handle tunnel child stream errors and stop-after-exit hang#101394

Merged
steipete merged 3 commits into
openclaw:mainfrom
cxbAsDev:fix/voice-call-tunnel-stream-errors
Jul 7, 2026
Merged

fix(voice-call): handle tunnel child stream errors and stop-after-exit hang#101394
steipete merged 3 commits into
openclaw:mainfrom
cxbAsDev:fix/voice-call-tunnel-stream-errors

Conversation

@cxbAsDev

@cxbAsDev cxbAsDev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

startNgrokTunnel and startTailscaleTunnel attached data listeners to their child stdout/stderr pipes but no error listeners. A broken pipe (EPIPE) or I/O error (EIO) on either stream therefore became an unhandled error event that could crash the gateway process.

Additionally, the ngrok stop() closure always waited up to 2 seconds for a close event even if the process had already exited, causing unnecessary shutdown latency.

Why This Change Was Made

  • Added error handlers to ngrok and Tailscale startup stdout/stderr streams that reject the startup promise while the tunnel is still unresolved.
  • Tracked a closed flag for ngrok and short-circuit stop() when the process is already gone, avoiding the 2 s fallback wait.
  • Kept the existing bounded-output and timeout behavior unchanged.

User Impact

Transient stream errors during voice-call tunnel startup are now logged and rejected cleanly instead of crashing the gateway. Stopping an already-exited ngrok tunnel returns immediately.

Evidence

Local focused tests pass:

node scripts/run-vitest.mjs extensions/voice-call/src/tunnel.test.ts --run

Added regression tests for:

  • ngrok stdout and stderr errors before the tunnel is ready.
  • Tailscale stdout error before the tunnel is ready.
  • stop() resolving immediately when the ngrok process already closed.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: S labels Jul 7, 2026
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 7338accbba1cb03479d133b53b6a397ab40eeece, but the PR head is now fd46e4fef0fd57b8b9c97fd9db6d8e366e160515. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (1 earlier review cycle)
  • reviewed 2026-07-07T06:00:47.419Z sha c7e8ae8 :: needs real behavior proof before merge. :: [P2] Terminate ngrok when startup stream errors fire | [P2] Clean up Tailscale after stream-error rejection

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 7, 2026
@steipete steipete self-assigned this Jul 7, 2026
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 7, 2026
@steipete
steipete merged commit 735b7b2 into openclaw:main Jul 7, 2026
106 of 110 checks passed
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…t hang (openclaw#101394)

* fix(voice-call): handle tunnel child stream errors and stop-after-exit hang

* fix(voice-call): stop children after stream failures

* style(voice-call): satisfy timer lint

---------

Co-authored-by: Peter Steinberger <[email protected]>
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
…t hang (openclaw#101394)

* fix(voice-call): handle tunnel child stream errors and stop-after-exit hang

* fix(voice-call): stop children after stream failures

* style(voice-call): satisfy timer lint

---------

Co-authored-by: Peter Steinberger <[email protected]>
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
…t hang (openclaw#101394)

* fix(voice-call): handle tunnel child stream errors and stop-after-exit hang

* fix(voice-call): stop children after stream failures

* style(voice-call): satisfy timer lint

---------

Co-authored-by: Peter Steinberger <[email protected]>
@cxbAsDev
cxbAsDev deleted the fix/voice-call-tunnel-stream-errors branch July 15, 2026 03:33
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
…t hang (openclaw#101394)

* fix(voice-call): handle tunnel child stream errors and stop-after-exit hang

* fix(voice-call): stop children after stream failures

* style(voice-call): satisfy timer lint

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 735b7b2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: voice-call Channel integration: voice-call P2 Normal backlog priority with limited blast radius. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants