From fe43b90e2165361e2d7565d3c272b042b49ee7c0 Mon Sep 17 00:00:00 2001 From: Hendrik Brombeer Date: Sat, 11 Jul 2026 18:15:07 +0200 Subject: [PATCH] fix(cluster): poll after `up --profile` instead of claiming Active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit forge no longer provisions on the request path: `POST /v1/cluster/up` enqueues and a background worker reconciles, so the response now carries state=creating. The legacy --profile path printed "Workspace Active" and exited the moment the request returned, which would have reported success while the vCluster was still being built — and said nothing at all when the provision later failed. Reuse waitForBundle (a generic GET /v1/cluster poller, already used by the default bundle path) and exit non-zero on a failed provision. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01AXYNq1wXz2hFg4yzPsHdDx --- cmd/grounds/commands/cluster/up.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cmd/grounds/commands/cluster/up.go b/cmd/grounds/commands/cluster/up.go index f181ca8..6c24fb4 100644 --- a/cmd/grounds/commands/cluster/up.go +++ b/cmd/grounds/commands/cluster/up.go @@ -84,12 +84,23 @@ changing profile, use ` + "`grounds cluster reset`" + `.`, if profile != "minigame" && profile != "platform" { return fmt.Errorf("invalid --profile %q: must be \"minigame\" or \"platform\" (omit --profile for the default platform-bundle)", profile) } - s, err := c.ClusterUp(ctx, profile) + w := cmd.OutOrStdout() + if _, err := c.ClusterUp(ctx, profile); err != nil { + return err + } + // forge enqueues the provision and a worker runs it, so the row + // comes back `creating`. Poll to a terminal state instead of + // claiming "Active" the moment the request returns. + render.StatusLine(w, render.StatusOK, "Workspace", + "provisioning — this takes a few minutes…") + final, err := waitForBundle(ctx, c, w) if err != nil { return err } - render.StatusLine(cmd.OutOrStdout(), render.StatusOK, "Workspace", "Active") - render.Status(cmd.OutOrStdout(), s) + render.Status(w, final) + if final.State == "failed" { + return fmt.Errorf("workspace provisioning failed") + } return nil }, }