Repository navigation
claude: resume a stopped VM that List returns instead of failing to ssh - #1231
Merged
Merged
Conversation
ensureClaudeVM took the first VM of the project's name from List, whatever its status. Providers whose List includes stopped VMs (ac, aws) therefore handed back a stopped box with no address, and onctl claude died with "claude-<project> has no address to ssh to" rather than resuming it; only providers filing paused VMs under ListPaused (Hetzner) got the resume. A List match in a paused status (isPausedStatus, what ls files under PAUSED) now goes through the same Resume path as a ListPaused match. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQo63nquy9oDWspMWnWfxD
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1231 +/- ##
==========================================
+ Coverage 47.07% 47.22% +0.14%
==========================================
Files 77 77
Lines 9036 9044 +8
==========================================
+ Hits 4254 4271 +17
+ Misses 4782 4773 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
With a paused (stopped) ac box,
onctl claudefailed instead of resuming it:ensureClaudeVMreturned the first VM of the project's name fromList()regardless of status. The ac provider (like aws) lists stopped containers inList()and returns nothing fromListPaused(), so the stopped box came back with an empty IP and the resume branch was never reached. Only providers that file paused VMs underListPaused()(Hetzner) got resumed.Fix
A
List()match whose statusisPausedStatusreports as paused (the same classifieronctl lsuses for its PAUSED section) now goes through the sameprovider.Resumepath as aListPaused()match. Running VMs are used as before.Tests
TestEnsureClaudeVMResumesStoppedVMFromList: a stopped VM inList()is resumed and the resumed record (with an address) is returned.TestEnsureClaudeVMReturnsRunningVMWithoutResuming: a running VM is handed back without touching the provider.go test ./cmd/ ./pkg/cloud/passes.Verified on the real box
With this build,
ONCTL_CLOUD=ac onctl claude -dnow printsResuming claude-onctl...and callscontainer start. On this host that start then fails inside Apple'scontainer0.1.0 withHostname claude-onctl. already exists on the network: the box's stop on 2026-10-23 00:13 timed out (XPC timeout, the case #1225 handled for delete) and the vmnet network helper never released the hostname. That is a runtime-state bug outside onctl; it needs the container system restarted. The onctl code path is correct and the error is now the provider's real one.🤖 Generated with Claude Code
https://claude.ai/code/session_01CQo63nquy9oDWspMWnWfxD