Skip to content

fix(deploy): finish rollouts despite stale application list versions - #2732

Merged
simple-agent-manager[bot] merged 2 commits into
mainfrom
sam/fix-container-rollout-wait-avws85
Nov 14, 2026
Merged

simple-agent-manager[bot] merged 2 commits into
mainfrom
sam/fix-container-rollout-wait-avws85

Conversation

@simple-agent-manager

@simple-agent-manager simple-agent-manager Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Production run 43601089742 timed out for 20 minutes after its container rollout finished: Cloudflare's application list stayed at 1140 while application GET and the completed 100% rollout target were 1141. The gate now accepts the completed pinned rollout and logs the stale-list disagreement. Application behavior, deployed contents, rollout configuration, timing and API calls are unchanged.

Rule 74:

  • Condition: the exact pinned rollout has completed every step through 100% at its target.
  • Signal: application-list version equality with that target.
  • Divergence: the list can remain N-1 after completed target N; detail GET can also lag during rollout. Neither version field alone establishes completion. The pinned rollout's completion record is authoritative; positive regression/supersession and identity/history guards remain.

Validation

  • Deployment suite: 9 files / 120 tests passed. Each local reviewer independently passed all 36 rollout tests.
  • New HTTP-boundary regression accepts completed pinned rollout when list is stale and application GET is current proved RED before implementation: timeout at 100ms, completed target 5 / list 4 / detail 5. GREEN after the fix.
  • Controls cover pending/progressing with version already at target, failed/cancelled/canceled/replaced/unknown, supersession, malformed state, bounded timeout, unchanged-image retry and matching-version success.
  • Full lint 22/22, typecheck 36/36 and build 18/18 tasks passed; targeted script ESLint and TypeScript checks passed. Documentation build passed (288 pages); agent-context budget measured successfully.
  • Full repository tests: the bounded lower-concurrency retry reached the 540-second workspace ceiling with 38/39 tasks successful; the API suite had no completion summary. All 5,228 web tests and infrastructure suites passed. The initial concurrent run hit unchanged infrastructure DNS/KV 10-second setup timeouts, which passed in the lower-concurrency run. Full-suite green is not claimed; CI is the release check.

Staging Verification

Task-scoped human exception: Raphaël directed “ship straight to prod” in source chat 5a56608e-1467-4c1b-9269-75fc1cf44254, user message 01M7D8BWDE6Q416BFMWCZPQC6G, 2026-11-14 14:46:13Z (verified through SAM session search). Staging is no longer a release gate for this urgent fix; CI, local review, CodeRabbit request/wait and production verification remain required. The attempted policy save failed at the project policy cap, so this cites the actual human message.

Non-blocking exact-candidate run 43605665349, head a2f1f13510d55eca469efb53aa63c293a899277f: Wait for container rollout completion passed at 14:55:11Z, after waiting from 14:49:25Z. Full workflow and browser smoke passed. The decisive final VM-agent poll had status=completed, list version 1626, target 1627, and logged the stale-list diagnostic before passing; the sandbox matched 1912. This exercises the exact production failure mode live. Deployment was coordinated with the GCP and project-event write task owners before dispatch.

This read-only deployment gate changes no VM provisioning/runtime path. The workflow's rollout wait, subsequent CLI/health steps and browser smoke tests are the relevant end-to-end checks; no extra VM fixture is needed.

End-to-End Verification

deploy-reusable.yml snapshots container identities before deploying the API, then runs wait-container-rollout.ts → createRolloutApi → waitForContainerRollouts. The HTTP-boundary test feeds real adapter responses and asserts gate resolution with a stale list and current detail.

A live production read at 14:23Z independently confirmed list array version 1140, detail object version 1141 and completed rollout target 1141 with completed 34% then 100% steps; configuration/secret fields were omitted. A bounded read-only production unchanged-image snapshot/wait passed at 14:31:56Z with that stale list and the new diagnostic; the matching-version sandbox path also passed. Post-merge workflow verification remains required.

Post-Mortem

What broke

Healthy Worker deployments ended in false failure. CLI build/upload, health check and the successful-production record were skipped.

Root cause

PR #2722 (a7f8f665c) made application-list version equality a second veto after authoritative rollout completion. Cloudflare list data can stay stale after completion.

Class of bug

A gate keyed on a correlated stale signal rather than its condition (rule 74).

Why it wasn't caught

Mocks synchronized application-list version with rollout completion, and the previous completion test required the same proxy behavior. No test kept the list stale while rollout/detail reached the target.

Process fix included in this PR

The HTTP-boundary divergence regression and pending/current-version controls directly exercise existing .claude/rules/74-proxy-signals-must-match-the-condition.md. The self-hosting guide and staging reference now describe rollout authority. No additional standing rule is needed.

Post-mortem file

tasks/active/2026-11-14-container-rollout-stale-list.md. The separate old-agent-after-completed-rollout investigation on idea 01M7BQJ14BKVMPMKRA2GCSP8MJ remains open.

Specialist Review Evidence

  • All local reviewers completed and findings addressed before merge.
Reviewer Status Outcome
rollout_review PASS Cloudflare + constitution: no findings; identity/history/supersession/failure/timeout preserved; no new API dependency, secret logging or tunables. Independently passed 36 tests.
completion_review PASS Completion validator A–F + test engineering: implementation and discriminating coverage complete. Exact a2f1f13510d55eca469efb53aa63c293a899277f doc-sync re-review passed. No findings; independently passed 36 tests. Operational staging/release gates tracked separately.

CodeRabbit Review Evidence

Requested once with the coderabbit-review label at 2026-11-14 15:06:13Z, after hosted CI and local review passed. Trusted request workflow 43608344658 fired. Waited through 15:21:13Z (over 15 minutes). Final review/comment/thread reconciliation found no review findings or unresolved threads. The trusted request workflow succeeded. At 15:07:30Z CodeRabbit reported its free OSS review limit was reached (next review in 49 minutes), with no review findings. This is recorded as unavailable under the best-effort policy; no retrigger or quota-reset wait. The initial automatic review had skipped because the author is a bot; the opt-in request is separate.

Agent Preflight

  • Preflight completed before code changes

Classification

  • business-logic-change
  • infra-change
  • docs-sync-change

External References

https://developers.cloudflare.com/containers/configuration/rollouts/ consulted before coding. Read-only live production API independently verified response shape and divergence at 14:23Z.

Codebase Impact Analysis

Only scripts/deploy/container-rollout.ts, its tests, two rollout descriptions and the task record change. Both shared and legacy deploy paths use the same adapter/gate. No API/Worker/UI/VM binary content changes.

Documentation & Specs

Updated the self-hosting guide and staging verification reference to describe authoritative completed 100% pinned rollouts and stale-list diagnostics. No public interface or configuration changes.

Constitution & Risk Check

Principles X/XI: smallest complete change; existing configurable timeout/poll defaults retained. The main risk is accepting an unfinished/older rollout; existing pin/history/status/every-step/100% checks and negative controls preserve those protections.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a7d0523 and a2f1f13.

Files selected for processing: 5

  • .agent-instructions/reference/rules/13-staging-verification-full.md
  • apps/www/src/content/docs/docs/guides/self-hosting.mdx
  • scripts/deploy/container-rollout.test.ts
  • scripts/deploy/container-rollout.ts
  • tasks/active/2026-11-14-container-rollout-stale-list.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@simple-agent-manager simple-agent-manager Bot added the coderabbit-review Trigger CodeRabbit review for opt-in PRs label Nov 14, 2026
@raphaeltm

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@simple-agent-manager
simple-agent-manager Bot merged commit 3c59218 into main Nov 14, 2026
33 checks passed
@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Production verification passed on merged main 3c5921849e470b8cd69cc99b343a3051c84fce5a.

Deploy Production 43610800149 completed successfully:

  • Wait for container rollout completion: passed at 15:52:27Z.
  • Health Check: passed at 15:53:22Z.
  • Record successful production deployment: ran and succeeded at 15:53:34Z.

The exact failure mode occurred again during this verification: the pinned VM-agent rollout completed target 1142 while the application list still reported 1141. The new diagnostic recorded the stale-list disagreement and the gate passed. The sandbox matched version/target 1622. No retry or deployment override was used.

Together with the proven pre-fix failing HTTP regression, 120 passing deployment tests, specialist reviews, green PR/main CI, and the staging target1627/list1626 proof, this completes the requested fix. The separate unexplained old-agent-after-completed-rollout investigation remains open.

This branch was previously deployed

1 inactive deployment
staging — a2f1f135 Deployed Nov 14, 2026 by simple-agent-manager[bot] via smoke-tests #2810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coderabbit-review Trigger CodeRabbit review for opt-in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant