Skip to content

claude: resume a stopped VM that List returns instead of failing to ssh - #1231

Merged
cdalar merged 1 commit into
mainfrom
fix/claude-resume-stopped-ac
Oct 23, 2026
Merged

cdalar merged 1 commit into
mainfrom
fix/claude-resume-stopped-ac

Conversation

@cdalar

@cdalar cdalar commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Problem

With a paused (stopped) ac box, onctl claude failed instead of resuming it:

$ ONCTL_CLOUD=ac onctl claude
Error: claude-onctl has no address to ssh to

ensureClaudeVM returned the first VM of the project's name from List() regardless of status. The ac provider (like aws) lists stopped containers in List() and returns nothing from ListPaused(), so the stopped box came back with an empty IP and the resume branch was never reached. Only providers that file paused VMs under ListPaused() (Hetzner) got resumed.

Fix

A List() match whose status isPausedStatus reports as paused (the same classifier onctl ls uses for its PAUSED section) now goes through the same provider.Resume path as a ListPaused() match. Running VMs are used as before.

Tests

  • TestEnsureClaudeVMResumesStoppedVMFromList: a stopped VM in List() 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 -d now prints Resuming claude-onctl... and calls container start. On this host that start then fails inside Apple's container 0.1.0 with Hostname 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

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
@cdalar
cdalar merged commit d10dd14 into main Oct 23, 2026
11 checks passed
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.22%. Comparing base (d83398d) to head (c3e2c57).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/claudevm.go 80.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址