Repository navigation
fix(console): mark an earlier failed version from the revision list after a reload - #3598
Conversation
…fter a reload The Versions list read only the latest version's deployment record, so after a reload an earlier failed version had no mark until it was opened. Revision list summaries now carry deploymentStatus, read from each listed revision's deployment work in the same read, and the console marks failed versions from it. Finding 2422 (D703).
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
…lt type Importing DeploymentStatus widened the State import past its module-boundary exception.
|
Codex review: needs changes before merge. What this changesThe PR adds deployment status to revision summaries so the Console can mark earlier failed versions immediately after a reload. Example: Version v1 failed its model check, and v2 subsequently deployed successfully.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: it addresses a real reload gap, but introduces incorrect Failed labels for stopped and superseded versions. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherOCC authorizes revision-list reads, joins each readable revision to its controller work, and returns summaries through the HTTP API to the Console's Versions list. flowchart TB
Browser[Console reload] --> API[Revision list API]
API --> OCC[OCC authorization and listing]
OCC --> Revisions[Revision summaries]
OCC --> Work[Deployment controller work]
Revisions --> Result[Summaries with deployment status]
Work --> Result
Result --> Marks[Console version marks]
Technical reviewBest possible solution: Return enough outcome information in revision summaries to reuse the existing neutral-outcome classification before adding failure marks. Do we have a high-confidence way to reproduce the issue? Current main marks earlier failures only after reading their records; the introduced list loop also demonstrably classifies stopped and superseded work as failed. This review used source inspection and ran no target tests. Is this the best way to solve the issue? Adding outcome information to the existing paged summary is a focused solution, but raw deployment status loses the reason codes required by the Console's existing classification. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 392cad5ad840. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 25, 2026, 4:14 AM ET / 08:14 UTC. |
…reload The revision list carried only the raw deployment status, so a version that a newer one or a Stop ended (status failed, codes REVISION_SUPERSEDED, REPOSITORY_REVISION_SUPERSEDED, REVISION_STOPPED) got the Failed mark on a new page load. List items now carry deploymentErrorCode, the error.code the deployment record reports, and the console applies neutralDeploymentOutcome before marking, so list.mts stays the one place that classifies neutral endings for both the record and the list. PostgreSQL tests now list real stopped and superseded work with its code; a browser test proves both codes stay unmarked after a load (fails on the previous head). The Storybook list fixture carries the code too, so the superseded scenario reads Historical again.
Problem
After a reload, the Versions list showed an earlier failed version (v1) without its Failed mark until someone opened it. #3577 marks failed versions from deployment records, but the page reads a record only for the selected version and for versions opened since the page loaded. The revision list carried no outcome.
Change
GET /v1/namespaces/{id}/agents/{agentId}/revisionsnow carriesdeploymentStatus(queued,running,succeeded,failed, ornullwhen the version has no deployment work) anddeploymentErrorCode(theerror.codethe deployment record reports, ornull). OCC reads both from the version's reconcile work, mapped exactly as the deployment record maps them.deploymentStatusisfailed, unlessneutralDeploymentOutcome(list.mts) says a newer version or a Stop ended it (REVISION_SUPERSEDED,REPOSITORY_REVISION_SUPERSEDED,REVISION_STOPPED). So the mark survives a reload with no extra requests, and superseded or stopped versions stay unmarked. The record-based marks from fix(console): mark an earlier failed version after a reload and label the draft read-only for readers #3577 still apply as versions are opened or deployed.failedwith a code, and the console classifies them in one place. Listing the same status and code keepslist.mtsthe only source of truth for neutral endings, for both the record and the list.Pages → Agent detail → EarlierFailedVersionstory. The Storybook list fixture carries the code too, so "Deployment superseded by a newer version" reads as a historical version again.Trade-off: the list read now does one primary-key work lookup per listed version (at most a page of 100) on the server. The alternative was a deployment-record request per version from the browser on every load, which costs more round trips and more authorization checks.
Verification
tests/browser/console-agent-overview.test.mjs: the fix(console): mark an earlier failed version after a reload and label the draft read-only for readers #3577 reload test expects "View version v1, deployment failed" in the Versions list before v1 is opened, with no read of v1's record. A new test lists a version asfailedwithREVISION_SUPERSEDEDand withREVISION_STOPPEDand expects it unmarked after a load, reading Superseded or Stopped and "Historical version" when opened. On the previous head the new test fails ("View version v1, deployment failed"). Pinned 20/20 at 2 CPUs on a remote test VM.tests/integration/postgres-agent-provisioning.test.mjs: a first deployment interrupted by a real Stop lists asfailedwithREVISION_STOPPED.tests/integration/postgres-worker-agent-revision.test.mjs: an older revision the worker really superseded lists asfailedwithREVISION_SUPERSEDED, the newer one assucceededwith no code.list-summaries,occ-api,configuration-occand the PostgreSQL platform-state tests expect both fields.Risks
occ agent revisions(CLI) still fillsdeploymentStatusfrom each record;deploymentErrorCodepasses through from the list.