Skip to content

fix(cli): show the deployment status the revision list returns - #4333

Merged
freeqaz merged 1 commit into
mainfrom
fix/cli-revisions-listed-status
Oct 31, 2026
Merged

freeqaz merged 1 commit into
mainfrom
fix/cli-revisions-listed-status

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Problem

occ agent revisions did not show the deployment status that the revision list returns. Since #3598, each item of GET /namespaces/:ns/agents/:id/revisions carries deploymentStatus and deploymentErrorCode. The list reads them without decoding saved settings. The CLI still set every row's deploymentStatus to null, then read /deployments/:id again for each revision. That strict read decodes saved settings, so:

  • an Agent with unreadable saved settings showed - (JSON/YAML null) for every revision, plus a notice that status is unavailable;
  • a revision with unreadable saved settings showed - and a notice for its 503;
  • the CLI sent one extra request for each listed revision (up to 100 for each page).

The API and the console showed the real status, for example queued, in these cases. The PostgreSQL browsing test pinned the CLI's null.

Change

  • describeAgentRevisions keeps each summary as OCC sent it and only adds the active marker. It makes no read for each revision and prints no "unavailable" notices.
  • Go command tests now use the real summary shape. A new test covers an unreadable Agent and a 503 on each deployment status read in table, JSON and YAML output. It checks that no /deployments/ request is sent.
  • tests/integration/postgres-platform-state.test.mjs now checks that CLI JSON statuses match the API list, and that no notice is printed.
  • docs/flows/cli-agent-browsing.md describes the new flow.

Verification

  • go test ./internal/occcli -run TestAgentRevisions: 3 tests fail on main (STATUS -, JSON null, unavailable notice). All pass with the change. The whole internal/occcli and cmd/occ packages pass.
  • On a remote test VM: postgres-platform CI lane, pnpm run typecheck, and a 20/20 pin of the Go package at 2 CPUs : all passed (postgres-platform-state.test.mjs included); pin 20/20.

Risks

Low. The change is CLI presentation only. Table columns and JSON keys stay the same. A revision without a deployment work record still shows null, as the API lists it.

occ agent revisions replaced each summary's deploymentStatus with a second
per-revision deployment status read. That read decodes saved settings, so an
Agent or revision with unreadable settings showed "-" (null in JSON) and a
notice, though the API list already carried its status. It also cost one
request per listed revision. Keep the listed status and error code.
@freeqaz
freeqaz requested a review from a team as a code owner October 31, 2026 21:44
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@freeqaz
freeqaz merged commit 3fbdfaf into main Oct 31, 2026
38 checks passed
@freeqaz
freeqaz deleted the fix/cli-revisions-listed-status branch October 31, 2026 21:53
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