fix(cli): bound deploy watch with timeout and heartbeat (RND-569)#162
Open
mpjunior92 wants to merge 1 commit into
Open
fix(cli): bound deploy watch with timeout and heartbeat (RND-569)#162mpjunior92 wants to merge 1 commit into
mpjunior92 wants to merge 1 commit into
Conversation
watchUntilRunning previously only logged on status transitions, so when the orchestrator silently kept the app in Unknown the user saw a single "Status: Unknown (1s)" line forever (visible especially over non-TTY stdout where carriage-return overwrites are invisible). The loop also had no timeout, so the CLI would hang indefinitely. Add a 30s heartbeat that re-emits the current status with elapsed time, plus a configurable timeout (default 10 minutes, override via ECLOUD_WATCH_TIMEOUT_SECONDS) that throws a typed WatchTimeoutError. The CLI deploy command catches it and prints a hint pointing at 'ecloud compute app info <id>' before exiting non-zero. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
watchUntilRunningpreviously only logged on status transitions, so when the orchestrator silently kept the app inUnknownthe user saw a singleStatus: Unknown (1s)line forever (visible especially over non-TTY stdout, where carriage-return overwrites are invisible). The loop also had no timeout, so the CLI would hang indefinitely.--watch-timeoutflag orECLOUD_WATCH_TIMEOUT_SECONDSenv var; precedence: explicit option > env var > default).WatchTimeoutError(carryingappId,elapsedSeconds,lastStatus,timeoutSeconds) on deadline.ecloud compute app info <id>along with appId and txHash, then exits non-zero.WatchTimeoutErrorandWATCH_DEFAULT_TIMEOUT_SECONDSare intentionally generic — RND-568 reuses the same helpers for the upgrade watcher (the two PRs share symbol shape so whichever lands first defines the helper and the other reuses it).Resolves RND-569.
Test plan
pnpm --filter @layr-labs/ecloud-sdk run build:devcleanpnpm --filter @layr-labs/ecloud-cli run build:devcleantypecheckclean for the touched files (only pre-existing unrelated errors)eslintclean on touched filesecloud compute app deploy --helplists--watch-timeoutwith[env: ECLOUD_WATCH_TIMEOUT_SECONDS]0xB198C8b046d66f98aE70d5D57d53dcBb1f4B8D53(left inUnknownfrom a prior failed quota attempt) provided a fixture. WithECLOUD_WATCH_TIMEOUT_SECONDS=70:Status: Unknown (0s)→ heartbeatStatus: Unknown (35s)→ heartbeatStatus: Unknown (68s)→WatchTimeoutError elapsed=74s lastStatus=Unknown. Heartbeat and timeout both confirmed.