mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 08:01:17 +00:00
fix: skip cloud-init wait in Hetzner Docker mode (#2924)
Hetzner's waitForReady() was missing the useDocker check that GCP already has. Non-minimal agents (openclaw, codex) with --beta docker waited 5 minutes for a cloud-init marker that never appears on Docker CE app images. Adds useDocker to the condition and a source-level regression test verifying both Hetzner and GCP include the check. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
659fd1c6da
commit
3b150eabd8
2 changed files with 31 additions and 1 deletions
30
packages/cli/src/__tests__/docker-cloudinit-skip.test.ts
Normal file
30
packages/cli/src/__tests__/docker-cloudinit-skip.test.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* docker-cloudinit-skip.test.ts — Verify Docker mode skips cloud-init wait.
|
||||
*
|
||||
* When --beta docker is active, waitForReady() must skip cloud-init polling
|
||||
* and only wait for SSH. This test reads the orchestrator source files to
|
||||
* verify the useDocker check is present in the waitForReady condition.
|
||||
*
|
||||
* Without this, non-minimal agents (openclaw, codex) wait 5 minutes for a
|
||||
* cloud-init marker that never appears when using Docker app images.
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
const CLI_SRC = resolve(import.meta.dir, "..");
|
||||
|
||||
describe("Docker mode skips cloud-init wait", () => {
|
||||
it("Hetzner waitForReady includes useDocker in skip condition", () => {
|
||||
const source = readFileSync(resolve(CLI_SRC, "hetzner/main.ts"), "utf-8");
|
||||
// The waitForReady condition must include useDocker to skip cloud-init
|
||||
// when Docker mode is active (matching GCP's implementation)
|
||||
expect(source).toContain("useDocker || snapshotId || cloud.skipCloudInit");
|
||||
});
|
||||
|
||||
it("GCP waitForReady includes useDocker in skip condition", () => {
|
||||
const source = readFileSync(resolve(CLI_SRC, "gcp/main.ts"), "utf-8");
|
||||
expect(source).toContain("useDocker || cloud.skipCloudInit");
|
||||
});
|
||||
});
|
||||
|
|
@ -87,7 +87,7 @@ async function main() {
|
|||
},
|
||||
getServerName,
|
||||
async waitForReady() {
|
||||
if (snapshotId || cloud.skipCloudInit) {
|
||||
if (useDocker || snapshotId || cloud.skipCloudInit) {
|
||||
await waitForSshOnly();
|
||||
} else {
|
||||
await waitForCloudInit();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue