Skip to content

fix(console): show an owner's stop as stopped, not failed - #2473

Merged
freeqaz merged 6 commits into
mainfrom
fix-1375-1377
Oct 14, 2026
Merged

freeqaz merged 6 commits into
mainfrom
fix-1375-1377

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Dogfood round r22b found three gaps around stopping a new Agent and one doc gap:

  • Stopped first deployment shows as failed. After fix(console): clarify a stopped initial deployment #2459 the create page says a first deployment stopped by its owner needs no repair. The linked Agent page still showed v1 · Failed, a "recorded as failed" banner, a red "check the recorded error" stage, and v1 · failed in the Agents list. That holds for any deployment the owner stops (REVISION_STOPPED), not only the first.
  • Stop before the first revision says "create a new Agent". A Stop that lands before the first revision is admitted cancels provisioning (PROVISIONING_CANCELLED). The create page said "Provisioning failed. Provisioning was cancelled. Create a new Agent to provision again." with no link. The stopped Agent keeps its name, so creating it again is refused as a duplicate.
  • The 10-14 token_url notice has no way to find affected sources. It explains the refusals but not how to find affected sources before an upgrade.

Change

  • Console, Agent details and Agents list: REVISION_STOPPED now renders like fix(console): show a superseded deployment as superseded, not failed #2446's superseded outcome. It shows as v1 · Stopped / v1 · stopped with neutral stages and no failure banner. It drops the "probably down" serving claim and the diagnostics "resolve that first" hint, and adds a "deploy a new version when you want it running" next step. REPOSITORY_REVISION_STOPPED stays a failure, because it can also mean the Namespace is not ready (see fix(console): clarify a stopped initial deployment #2459's review). Real failures still render red. The two neutral endings share one map, NEUTRAL_DEPLOYMENT_OUTCOMES in list.mjs.
  • API: when Stop or Delete cancels provisioning, they now store "Provisioning was cancelled because the Agent was stopped." or "...because the Agent was deleted.". The provisioning status returns that stored sentence under the unchanged PROVISIONING_CANCELLED code, in place of the fixed "Create a new Agent to provision again." Jobs cancelled before this change keep their stored "cancelled by Stop/deletion." text. The code PROVISIONING_CANCELLED does not change.
  • Console, create page: after PROVISIONING_CANCELLED the page reads the job's Agent. Stop and Delete are the only operations that cancel provisioning, so an Agent that still exists and is not deleting was stopped. In that case the page says "Provisioning stopped.", adds "Open this Agent and deploy a version when you want it running.", and links Open Agent. If the Agent is gone (404) or deleting, the page keeps the generic text and offers Create Agent. Any other read error means the page can't tell a Stop from a deletion, so it names both next steps and still links the Agent. The stopped guidance for both stop cases no longer uses the error colour (r22b nit).
  • Docs: Agent details guide, create-and-deploy reference, and provisioning flow. The 10-14 token_url breaking-change notice gains a find-before-upgrade loop that uses existing commands only: occ namespace list -o json and occ credential-source list --namespace NS -o json, piped through jq to print each source's token_url and host.
  • Storybook: Pages/Agent detail/Deployment stopped by the owner (deploymentStopped) and Pages/Create Agent/Stopped before the first deployment (createProvisioningStopped).

Verification

  • New browser tests, each of which fails on main's console source and passes here:
    • console-agent-state: "Agent detail and list show a deployment stopped by its owner as neutral, not failed". Also checks that REPOSITORY_REVISION_STOPPED still renders failed.
    • console-agents-2: "Dedicated Agent creation reports a stop before the first deployment and links the kept Agent". It stops a real fixture Agent through the API, and also covers a deleting Agent and an unreadable Agent.
    • console-agents-2: the fix(console): clarify a stopped initial deployment #2459 stopped test now also checks that the stopped guidance is not in the error colour.
  • The existing cancelled-job case in "offers Retry only for a transient provisioning failure" now models a deletion. The Agent is gone, so the page still offers Create Agent.
  • tests/browser/console-agent-state.test.mjs, console-agents-2.test.mjs, console-agents.test.mjs: 64/64 pass locally. The new and changed tests passed 20/20 runs pinned to 2 CPUs.
  • postgres-agent-provisioning "Stop and Delete cancel failed pre-handoff provisioning Agents..." now asserts both cancel messages. It runs in CI only; there was no local PostgreSQL.
  • tsc --build, eslint and prettier pass on the touched files.
  • token_url find loop: I built occ from this branch and ran the loop, extracted verbatim from the doc, against a loopback stub serving the documented GET /namespaces and GET /namespaces/{id}/credential-sources shapes. It printed one TSV row per source that has a token_url or host. It has not been run against a live Installation with a Credential Gateway, and the doc says so.

Media (Storybook, simulated UI proof)

Captured from Storybook fixtures on this branch (prepare-assets.mjs + headless Chromium). "Before" uses main's console source with this branch's story fixtures. These show UI states only. They don't verify a live deployment, a real Stop, or the PostgreSQL-backed cancel messages.

Stories: Pages/Agent detail/Deployment stopped by the owner (deploymentStopped) and Pages/Create Agent/Stopped before the first deployment (createProvisioningStopped).

Agent details, before (main) and after:

before: v7 Failed, banner, red stage
after: v7 Stopped, neutral stages, no banner

Agents list, after:

after: v7 stopped, Stopped before it finished

Create page after a Stop before the first revision, before (main) and after:

before: Provisioning failed, error colour, no link
after: Provisioning stopped, Open Agent link

Walkthrough video: Agent details, refresh, Agents list, create page, Open Agent

The media commit d0d51c109 is removed again in 077bc2847, so the squash adds no files.

Risks

  • The create page makes one extra Agent read, only after a PROVISIONING_CANCELLED job. A cleaner follow-up would be for the API to return a structured cancel reason, so the console needs no inference.
  • API consumers matching the old fixed cancel message text will see the new sentences. The code is unchanged.
  • REVISION_STOPPED on a deployment that was already selected now reads as neutral. The Agent is stopped, so it isn't serving; the Stop panel already says that a new deployment starts it again.

A deployment ended by REVISION_STOPPED renders as a neutral Stopped outcome in
Agent details and the Agents list. A Stop before the first revision
(PROVISIONING_CANCELLED) reads as stopped on the create page and links the
kept Agent; the API names whether Stop or deletion cancelled the job.
…urces

Agent details and create docs name the neutral stopped outcome and the kept
Agent after a Stop before the first revision. The 10-14 token_url notice gains
a find-before-upgrade loop over occ namespace and credential-source lists,
checked with the CLI against the list response shape.
Pages/Agent detail gains Deployment stopped by the owner; Pages/Create Agent
gains Stopped before the first deployment (PROVISIONING_CANCELLED with the kept
Agent).
@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@freeqaz
freeqaz requested a review from a team as a code owner October 14, 2026 23:14
… be read

Review follow-up: only a 404 or a deleting Agent counts as gone. Any other read
error names both next steps and links the Agent, since a Stop keeps its name.
The test now stops the kept Agent through the API and covers the deleting and
unreadable cases; doc wording nits.

This branch had an error being deployed

1 failed deployment
integration-qa-pr — 3d1dbd2f Deployed Oct 14, 2026 by freeqaz via QA advisory (compose) #977
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