Skip to content

[muse] fix(server): bound relay environment unlink with a 5s timeout - #11

Open
kvnloo wants to merge 1 commit into
mainfrom
muse/cli-relay-unlink-timeout
Open

kvnloo wants to merge 1 commit into
mainfrom
muse/cli-relay-unlink-timeout

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 28, 2026

Copy link
Copy Markdown
Owner

What Changed

unlinkRelayEnvironment (the relay half of t3 connect disconnect) now has a 5s deadline (CLOUD_CLI_LIVE_SERVER_TIMEOUT), applied right after httpClient.execute in apps/server/src/cli/connect.ts.

Why

The relay DELETE ran with no deadline, while the sibling live-server unlink step was already bounded by the same 5s timeout. A wedged relay hung the entire t3 connect disconnect command forever -- and the local cleanup (clearPersistedCloudLink, credential clear) sits after the unbounded Effect.exit(unlinkRelayEnvironment()), so it never ran either. The caller already absorbs failure through reportCloudDisconnectResults, which logs the cause and tells the user to retry.

Validation

  • New test in connect.test.ts stalls the HttpClient under TestClock: the stalled unlink now fails with TimeoutError after 5s. 8/8 tests green.
  • Red on base: without the timeout the new test hangs until the 20s test timeout and fails -- the defect is literally a hang.
  • vp fmt --check clean; tsc --noEmit reports no errors in the touched files.

Checklist

  • This PR is small and focused
  • I have tested the change

AI-assisted: authored with AI assistance (Muse, Meta's Muse Spark) under the contributor's direction.

unlinkRelayEnvironment (the relay half of `t3 connect disconnect`) ran the
DELETE to the relay with no deadline, while the sibling live-server unlink
step was already bounded by CLOUD_CLI_LIVE_SERVER_TIMEOUT (5s). A wedged
relay hung the whole disconnect command forever -- and the local cleanup
(clearPersistedCloudLink, credential clear) never ran, since it sits after
the unbounded Effect.exit(unlinkRelayEnvironment()).

Mirrors the sibling exactly: Effect.timeout(CLOUD_CLI_LIVE_SERVER_TIMEOUT)
right after httpClient.execute. The caller already absorbs failure via
Effect.exit and reports it through reportCloudDisconnectResults.

New test stalls the HttpClient under TestClock: the stalled unlink now
fails with TimeoutError after 5s instead of hanging.

AI-assisted: authored with AI assistance (Muse, Meta's Muse Spark) under the contributor's direction.
@github-actions github-actions Bot added size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 28, 2026
@kvnloo kvnloo added the keep pr-janitor: never auto-close label Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep pr-janitor: never auto-close size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant