Skip to content

Fix env provisioning after breakdance plugin merge + warm-claim status flicker - #70

Open
louisreingold wants to merge 1 commit into
masterfrom
fix/create-env-provisioning-and-claim-flicker
Open

Fix env provisioning after breakdance plugin merge + warm-claim status flicker#70
louisreingold wants to merge 1 commit into
masterfrom
fix/create-env-provisioning-and-claim-flicker

Conversation

@louisreingold

Copy link
Copy Markdown
Member

What & why

Three independent bugs that surfaced when creating environments on the live devbox host. All three are fixed here; the running box was already patched at runtime, so this makes the fixes durable in the repo and for fresh deploys.

1. Presets pointed at plugins that no longer exist

breakdance PR #9585 merged the standalone breakdance-elements and breakdance-woocommerce plugins into breakdance-main (breakdance-main/plugin/elements/, …/woocommerce/) and deleted the old plugin dirs. The seed presets still listed the removed slugs, so wp plugin activate breakdance-elements errored. Under set -euo pipefail that aborted the whole npm run setup, which meant the next step — install-agent-connector.sh — never ran:

  • "successful" envs had only the first plugin active, no agent connector, and couldn't mint a wp-admin login link;
  • Oxygen / Breakdance / FutureLayer warm-pool builds all failed.

Fix: the three affected seed presets now activate breakdance-main (which carries elements + woocommerce), dropping the merged-away slugs.

Preset before after
Oxygen oxygen-elements, breakdance-elements, breakdance-main oxygen-elements, breakdance-main
Breakdance breakdance-elements, breakdance-main, breakdance-woocommerce breakdance-main
FutureLayer breakdance-elements, breakdance-main, breakdance-woocommerce, breakdance-ai, futurelayer-plugin breakdance-main, breakdance-ai, futurelayer-plugin

2. One bad slug shouldn't nuke the whole setup

install-plugins.sh made a single wp plugin activate failure fatal (it's in a set -e script), which is what let bug #1 take down the agent-connector step too. It now warns and continues on a missing/errored slug, so a future upstream plugin rename/merge can't wholesale-break provisioning.

3. Warm-claim status flicker

Creating an env from a warmed preset showed it in Active ("configuring…") → Stopped → back to Active on its own. A pooled member carries a stale "down" probe cache (it's stopped while it waits); _claimPipeline set status=running but — unlike start() — never invalidated that cache, so the read path (computeStatus) derived stopped from the stale ps until the next reconcile sweep. Both _claimPipeline and _pipeline now drop the probe cache in finally.

Verification (on the host)

  • node --check on manager.js/presets.js, bash -n on install-plugins.sh.
  • Corrected presets → Oxygen 2/2, Breakdance 2/2, FutureLayer 1/1 warm pools rebuilt green; a fresh Oxygen member has agent-connector-for-wp installed and ✓ Initial setup complete.
  • Claim + 0.5s status poll after the fix: configuring → running, held at running for 12s, never stopped.

🤖 Generated with Claude Code

…s flicker

Three independent bugs that surfaced when creating environments:

1. Seed presets referenced breakdance-elements and breakdance-woocommerce,
   which breakdance PR #9585 folded INTO breakdance-main (moved to
   breakdance-main/plugin/{elements,woocommerce}/). They no longer exist as
   separate plugins, so wp-cli errored on the missing slug during activation.
   Under set -euo pipefail that aborted the whole setup, so the NEXT step,
   install-agent-connector.sh, never ran: "successful" envs ended up with no
   agent connector and could not mint a wp-admin login link, and warm-pool
   builds for Oxygen/Breakdance/FutureLayer failed outright. Seed presets now
   activate breakdance-main (which carries elements + woocommerce); the three
   affected presets are updated and commented.

2. install-plugins.sh made a single failed activation fatal to the entire
   setup. It now warns and continues on a missing/errored slug, so one
   upstream plugin rename/merge can no longer take down provisioning (and the
   steps that run after it) wholesale.

3. Claiming a warm-pool member flickered the new env into the Stopped tab and
   back. A pooled member carries a stale "down" probe cache; _claimPipeline
   set status=running but never invalidated that cache the way start() does,
   so the read path (computeStatus) derived "stopped" from the stale ps until
   the next reconcile sweep. Both _claimPipeline and _pipeline now drop the
   probe cache in finally, so describe() reflects the fresh persisted status
   immediately.

Live box already fixed at runtime (data/presets.json patched via the API,
pools rebuilt, server restarted); this makes the fixes durable in the repo /
for fresh deploys.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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