fix(deploy): fail closed on workers.dev setup failure - #1691
Closed
simple-agent-manager[bot] wants to merge 2 commits into
Closed
simple-agent-manager[bot] wants to merge 2 commits into
simple-agent-manager[bot] wants to merge 2 commits into
Conversation
Contributor
|
30 tasks
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
curlresponse for 2xx success, 409 already enabled, and 403 hard failure.Validation
pnpm lintpnpm typecheckpnpm test— global run hit unrelated/flaky failures; targeted and isolated reruns below passedAdditional validation:
pnpm vitest run scripts/quality/deploy-reusable-workflow.test.ts— 13 tests passedpnpm --filter @simple-agent-manager/terminal test— 5 files / 99 tests passed in isolation after the global run reported Vitest worker startup timeouts(cd packages/shared && pnpm vitest run tests/unit/alternative-inference-providers-vertical-slice.test.ts)— 17 tests passed in isolation after the global run showed one failurepnpm build— passedGlobal
pnpm testnote: the full monorepo test run exited non-zero because@simple-agent-manager/terminal#testreported Vitest fork worker startup timeouts, and the visible shared failure passed when rerun in isolation. These failures are outside the changed files.Staging Verification (REQUIRED for all code changes — merge-blocking)
Staging Verification Evidence
Not run before PR creation. This PR is marked do-not-merge per task instruction; staging can be run before any later merge decision if desired.
UI Compliance Checklist (Required for UI changes)
End-to-End Verification (Required for multi-component changes)
Data Flow Trace
.github/workflows/deploy-reusable.ymlstepEnsure workers.dev Subdomaincalls CloudflarePUT /accounts/${CF_ACCOUNT_ID}/workers/subdomain.::error::and exits1, blocking subsequent deploy steps.scripts/quality/deploy-reusable-workflow.test.tsextracts and executes that shell block with fake Cloudflare responses for 200, 409, and 403.Untested Gaps
No live Cloudflare API mutation was performed locally. The behavior changed is the workflow shell branch after receiving Cloudflare response codes; that is covered by the executable static test.
Post-Mortem (Required for bug fix PRs)
What broke
Deployments could continue after workers.dev subdomain setup failed, leaving cron trigger prerequisites potentially unconfigured.
Root cause
The deploy workflow logged a warning for non-2xx/non-409 Cloudflare responses instead of failing closed.
Class of bug
Fail-open deployment prerequisite handling.
Why it wasn't caught
Existing workflow quality tests did not exercise the workers.dev subdomain setup shell branches.
Process fix included in this PR
Added executable workflow-shell regression tests in
scripts/quality/deploy-reusable-workflow.test.ts.Post-mortem file
tasks/active/2026-07-29-workersdev-cron-fail-closed.mdSpecialist Review Evidence (Required for agent-authored PRs)
needs-human-reviewlabel added and merge deferred to human — N/A; all completedExceptions (If any)
Agent Preflight (Required)
Classification
External References
N/A: no external API contract or SDK usage changed; this PR changes local shell handling of response codes from an existing workflow call.
Codebase Impact Analysis
Affected paths:
.github/workflows/deploy-reusable.yml— workers.dev subdomain setup now fails closed on hard failure.scripts/quality/deploy-reusable-workflow.test.ts— executable regression tests for shell branches.tasks/active/2026-07-29-workersdev-cron-fail-closed.md— task record.Documentation & Specs
N/A: no public operator docs changed because no degraded-mode override or new configuration was added. Default successful deploy behavior is preserved; failed prerequisite behavior now blocks deployment.
Constitution & Risk Check
Checked fail-closed security policy and no-hardcoded-values principle. The main deploy risk is intentional: a real Cloudflare prerequisite failure now blocks deploy instead of silently shipping cron-risky infrastructure. Successful 2xx and 409 behavior remains unchanged.