fix(cloud): gate provisioning health at enqueue#15544
Conversation
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
[qa-agent] post-merge adversarial review — CLEAN, one fast-follow race notedPOST-MERGE ADVERSARIAL REVIEW — #15542 / #15544 / #15548 Deployment-state facts (read first)
#15544 — gate at enqueue (the real health-gate PR)1. What the gate is: 2. No new stuck state — CONFIRMED PASS. Gate reject → hard org-scoped row delete (route.ts:612) → canonical 503/502 body with 3. Idempotency — CONFIRMED PASS. Idempotent reuse returns 200 at route.ts:441, before the gate and before 4/5. Composition + races:
6. Tests (run isolated at merged tip
#15548 — bridge-fallback scrubCI/deploy-workflow-only, confirmed — touches Verdicts
Datum for the promote lane: next develop→main promote carries the gate-placement flip (#15544) — behavior change is strictly looser (fewer 503s), rollback path test-proven. — [qa-agent] fast-follow ask: the reuse-of-doomed-pending-row race during a worker outage (concurrent same-org create can 200 with an id the gate's rollback then deletes — transient, retry self-heals, but the trigger is live for a whole outage). Conditional rollback-delete (status still pending + updated_at unchanged) closes it. Red-on-base verified (8/12 fail on base), 19/0 tests at tip. Also datum for the promote lane: next develop→main promote flips gate placement from #15541's reuse-peek shape to this enqueue-boundary shape — strictly looser (fewer 503s), rollback test-proven. |
Summary
This preserves #15541's source-side fix for #15516 while taking the stronger enqueue-boundary placement from the now-conflicting #15542 shape.
Verification
bun test packages/cloud/api/__tests__/eliza-agents-create-idempotency.test.ts-> 12 passbun test packages/cloud/api/__tests__/eliza-agents-warm-pool-empty-on-claim.test.ts-> 2 passnode packages/app-core/scripts/ensure-shared-i18n-data.mjsbun -c .tmp-bunfig-no-coverage.toml test ./packages/cloud/api/__tests__/eliza-agents-orphan-cleanup.test.ts-> exit 0; temp config removed after run; no repo diff leftbunx @biomejs/biome check packages/cloud/api/v1/eliza/agents/route.ts packages/cloud/api/__tests__/eliza-agents-create-idempotency.test.ts packages/cloud/api/__tests__/eliza-agents-warm-pool-empty-on-claim.test.ts packages/cloud/api/__tests__/eliza-agents-orphan-cleanup.test.ts packages/cloud/shared/src/lib/services/eliza-sandbox.ts packages/cloud/shared/src/db/repositories/agent-sandboxes.ts --no-errors-on-unmatchedgit diff --checkbun run audit:error-policy-ratchetPackage typecheck caveat:
bun run --cwd packages/cloud/api typecheckstill fails on pre-existing unrelated errors in__tests__/stripe-connect-webhook-route.test.ts(2026-06-24.dahliavs2026-05-27.dahlia) andfal/proxy/route.tsHono 4.12.18/4.12.27 type mismatches; no touched file appears in that failure.Evidence rows
Fixes #15516 server-side residual; supersedes the conflicting server-half shape in #15542.