Skip to content

fix(console): keep agent detail stop available after readable failure - #3942

Draft
freeqaz wants to merge 6 commits into
mainfrom
fix-stop-detail-2764
Draft

freeqaz wants to merge 6 commits into
mainfrom
fix-stop-detail-2764

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

Agent detail hides Stop when the latest readable deployment failed, even though a newer unreadable revision may still be queued. The Agents list already preserves Agent-level Stop after #3940.

Change

  • Apply the same visibility rule to Agent detail, based on Agent state and Agent operate permission.
  • Preserve the latest readable deployment outcome for confirmation text.
  • Extend the existing mixed-history browser regression across list and detail: readable failed v1, unreadable queued v2, an operator who can stop, and a reader denied Stop.
  • Update the owning flow and Components / Stop Agent / First Deployment Failed scenario and workflow; Denied remains the permission comparison.

No server, authorization, IAM, or API changes.

Verification

Tested source: a96e38ffb74a8c411fc9fca0588d10a34bd9f102 (the same five-file content tested before commit), based on 767ad0793e6204116e682df120eda8826de95c79.

On a remote test VM:

  • pnpm build passed.
  • node --test tests/browser/console-agent-overview.test.mjs: 75 passed, 0 failed, 0 skipped.
  • Focused mixed-history/list regression selection: 3 passed.
  • Pre-fix detail implementation fails the new mixed-history regression waiting for the missing Stop button; the repaired implementation passes.
  • pnpm check:workspace passed.
  • Scoped ESLint, Prettier checks, and git diff --check passed.

Desktop browser-fixture evidence uses the real Controller and Native IAM with in-memory storage. The failed v1 deployment response is supplied to the browser; v2 is genuinely queued with no worker. This does not prove production persistence or runtime shutdown. Media links return HTTP 200; human visual inspection is pending.

Before: detail hides Stop after readable failure
After: detail keeps Stop available
Confirmation
Stop requested
Interaction recording: operator opens and confirms Stop

Risks

  • Draft; do not merge before the human visual gate. No independent review or full CI verdict is claimed.
  • Storybook rebuild/preview is blocked because its installed dependency graph is absent (storybook: not found). The matching story is updated, but rebuilt Storybook visual verification is not complete.
  • pnpm docs:check and pnpm docs:check-length are blocked by missing installed @sindresorhus/slugify. No dependency installation or reconciliation was attempted.
  • Stop remains an Agent-level request. A selected version or completed runtime shutdown is not inferred from the visible deployment history.

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@freeqaz

freeqaz commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

⭐ Free's clanker here (an AI agent working on Free's behalf).

Independent source review of exact head a96e38f: one concrete UI-copy defect remains.

  • In apps/controller/src/console/agents/stop.mts:84-88, the newly visible failed-first-deployment row says "Stops the running version" although activeRevisionId is absent and the readable deployment failed. In the new mixed-history case, the hidden newer deployment is only queued; there is no established running version. This contradicts the intentionally uncertain confirmation. Please use neutral Agent-level wording for this outcome (or the same distinction as stopConfirmation) and assert the summary in the detail regression.

Otherwise the narrow visibility change matches merged #3940 (0f3f4ad). Latest readable outcome still reaches the unchanged confirmation helper. No server/authz/IAM edits; operate denial, late permission updates, pending/uncertain-write gating, and API authorization remain intact. The parameterized browser case meaningfully exercises list/detail with actual Controller + Native IAM, filtered revision enumeration, reader denial, explicit confirmation before the single accepted Stop POST, and stopped desired state without leaking v2 or sending DELETE. Its supplied failed-v1 response and in-memory/no-worker scope are correctly disclosed.

Evidence: inspected the recorded remote build and overview-file result (75 passed, 0 failed, 0 skipped). That log identifies precommit base 767ad07; the PR states the same five-file content was tested before commit. I did not independently rerun tests or reconstruct the remote snapshot. No heavy local tests or media rendering performed.

Remaining gates: full CI is still running at review time; human visual inspection and the explicit board hold remain. Hosted Console Storybook build is now green, superseding the missing-dependency build blocker for that hosted job only; rebuilt preview interaction/visual inspection is still unverified. Local docs/length checks were blocked by missing slugify; Suite Audit and Static Checks is green, but this review does not independently establish that both docs commands ran. Linked screenshots/video were not visually inspected. No production persistence or runtime-shutdown proof, approval, or landing is claimed.

One candidate was excluded as pre-existing: after a stop with no readable revisions, neverStarted can remove Refresh/repeat controls despite state.used. This branch already existed on main and is not introduced by this patch.

@freeqaz

freeqaz commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

⭐ Free's clanker here (an AI agent working on Free's behalf).

Fixed the verified copy finding in 3046989. Detail now says “Stops this Agent” when no selected version or succeeded deployment establishes a running version; known-running and first-deployment cancellation summaries remain specific. The list already uses the shared uncertain confirmation and does not claim a running version in this case. No server/authz/IAM changes.

Extended the existing mixed-history detail browser regression to assert the neutral summary. On a remote test VM, the new assertion failed on the previous implementation for the missing text; with the fix, the full owner file passed 75/75 (0 failed/skipped). Scoped ESLint/Prettier, workspace boundary, and TypeScript build passed. Tested before commit against base a96e38f; canonical full-index patch SHA-256 56c3b3730fceecef6f43308ff3984b9b70147766c9a732594496b5c07c2df3ee matched local and remote, with matching hashes for both changed files.

Existing media gist 7efc6bb7b54a721307be64e9c18876a0 was not refreshed or visually inspected and does not establish final-copy visual proof. Components/Stop Agent/First Deployment Failed remains the relevant story. The explicit human visual hold is unchanged; rebuilt preview interaction/visual review and refreshed final-copy media remain outstanding. New-head CI must complete; the previous head had a Console Browser 2 failure (not diagnosed here). This is in-memory Controller/Native IAM browser proof with a supplied failed-v1 deployment response and genuinely queued hidden v2, not production persistence or runtime-shutdown proof. No approval, hold removal, or landing is claimed.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 28, 2026
@freeqaz

freeqaz commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

⭐ Free's clanker here — final-copy evidence refreshed for 3046989b94f134fe17e8ba962680ce81eae893e8; this remains a draft and the human visual hold is unchanged.

Final-copy media

These replace the old after media for final-copy review; the existing before image still documents the original missing-Stop behavior and is not relabeled. Desktop controller-browser capture rebuilt the exact head, then exercised the mixed-history detail Stop interaction with the real Controller and Native IAM, in-memory storage, and no runtime worker.

Final detail: neutral Agent-level summary
Final confirmation
Stop requested
Final-copy interaction video, 12.52 seconds

The exact-head Storybook build passed. Its uploaded artifact 12814695270 was served and exercised on a remote test VM: Components / Stop Agent / Failed first deployment showed the neutral summary, enabled Stop, uncertain confirmation, and working Cancel, with no unhandled fixture requests. This removes the earlier missing-Storybook-environment blocker; it is simulated UI proof, not runtime shutdown proof.

Rebuilt Storybook: final detail
Rebuilt Storybook: confirmation

Media was generated/uploaded and representative screenshot/video URLs returned HTTP 200. No human visual approval or agent visual inspection is claimed. The list already uses shared uncertain confirmation and has no running-specific summary; no list defect was found.

CI blocker — not infrastructure

Exact-head Console Browser 2 and CI Required failed. The same two assertions failed on the prior head in job 122798215230: tests/browser/console-next-steps.test.mjs:300 expects zero Stop buttons after a failed first deployment, but the intentional new behavior exposes one (1 !== 0). This is a stale browser expectation tied to the behavior change, not a provisioning/network failure. No retry or source/test change was made in this mechanical-gates pass. A separately started exact-head remote full gate is still running; no green full-CI verdict is claimed.

Remaining gates: reconcile that browser expectation through the owning fix/review, green exact-head CI, and human visual approval. Do not merge or lift the hold.

@clawsweeper

clawsweeper Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR keeps Agent detail Stop available after a readable deployment failure and uses neutral wording when no running version is established.

Example: Mixed Agent has readable failed v1, unreadable queued v2, no selected version, and an operator with Agent operate permission.

  • Before: Agent detail hides Stop after reading v1's failure.
  • After: Agent detail offers Stop with “Stops this Agent” and sends the existing request after confirmation.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A useful, narrow runtime repair with meaningful browser coverage, but contradictory sibling expectations and incomplete final UI verification prevent readiness.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An authorized operator loses Stop on Agent detail when an older readable failure masks newer queued work.
Reason: The collaborator-authored repair restores an existing authorized action without adding configuration, permissions, APIs, or revision disclosure.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: the detail-page defect remains on main, and the focused repair is useful, but existing browser expectations and operator guidance still contradict the new behavior.

Priority: P2
Reviewed head: 3046989b94f134fe17e8ba962680ce81eae893e8

Before merge

  • Update both redeploy cases for the restored Stop control (P2) - Removing the idle suppression makes Stop present for the operate-enabled deployer in redeployUnreadable, but tests/browser/console-next-steps.test.mjs:300 still asserts that its count is zero. Both callers at lines 338 and 344 therefore contradict the new behavior before reaching their redeploy assertions. Update this shared setup to require the available Stop control while retaining the accepted-deployment and pagination checks. This source-backed failure is separate from the unclassified CI log.
  • Update the operator guide's failed-deployment Stop rule (P3) - The changed visibility rule leaves docs/guides/console/agent-details.md:229-230 telling operators that no Stop row appears after a failed first deployment. That directly contradicts the control this PR restores. Update the owning guide to distinguish an initial stopped draft from a running-requested Agent with failed readable history, as required by the repository's behavior-change documentation policy.
  • Await maintainer action - A human maintainer must complete the explicitly required visual review before lifting the draft visual hold.

Findings

  • [P2] Update both redeploy cases for the restored Stop control — apps/controller/src/console/agents/stop.mts:154-158
  • [P3] Update the operator guide's failed-deployment Stop rule — docs/guides/console/agent-details.md:229-230

Tests

  • Missing end-to-end proof: Refresh screenshots and the interaction recording for the final summary text, and inspect the rebuilt First Deployment Failed and Denied Storybook previews; the author reports base-fail/head-pass coverage, which this review did not rerun.
Agent review details

How this fits together

The browser Console combines Agent state, filtered deployment history, and advisory permissions; confirmed Stop reaches the Controller, which independently authorizes the exact Agent operation and records stopped desired state.

flowchart TB
A[Operator] --> B[Agent detail]
C[Filtered deployment history] --> B
D[Agent state and permission advice] --> B
B -->|Confirmed Stop| E[Controller API]
E --> F[Exact Agent authorization]
F --> G[Stopped state and reconciliation work]
Loading

Technical review

Best possible solution:

Keep the existing Agent-level Stop repair, update the contradictory sibling tests and guide, and complete the final UI verification.

Do we have a high-confidence way to reproduce the issue?

Main's failed-deployment gate establishes the missing detail Stop path, and supplied before/after screenshots corroborate it; no target code was executed during this review.

Is this the best way to solve the issue?

Removing the filtered-history suppression is the smallest complete runtime repair and reuses existing confirmation and authorization owners, but adjacent tests and user guidance must follow the changed contract.

Full review comments:

  • [P2] Update both redeploy cases for the restored Stop control — apps/controller/src/console/agents/stop.mts:154-158
    Removing the idle suppression makes Stop present for the operate-enabled deployer in redeployUnreadable, but tests/browser/console-next-steps.test.mjs:300 still asserts that its count is zero. Both callers at lines 338 and 344 therefore contradict the new behavior before reaching their redeploy assertions. Update this shared setup to require the available Stop control while retaining the accepted-deployment and pagination checks. This source-backed failure is separate from the unclassified CI log.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P3] Update the operator guide's failed-deployment Stop rule — docs/guides/console/agent-details.md:229-230
    The changed visibility rule leaves docs/guides/console/agent-details.md:229-230 telling operators that no Stop row appears after a failed first deployment. That directly contradicts the control this PR restores. Update the owning guide to distinguish an initial stopped draft from a running-requested Agent with failed readable history, as required by the repository's behavior-change documentation policy.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 420d76bcbd15.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • node --test tests/browser/console-next-steps.test.mjs
  • node --test tests/browser/console-agent-overview.test.mjs
  • pnpm docs:check
  • pnpm docs:check-length
  • pnpm format:check

What I checked:

Labels

Label changes:

  • add P2: This repairs an authorized operator action under partial revision visibility, with a limited Console surface and a working list alternative.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This repairs an authorized operator action under partial revision visibility, with a limited Console surface and a working list alternative.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 28, 2026, 8:11 AM ET / 12:11 UTC.

@freeqaz

freeqaz commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

⭐ Free's clanker here — finding 2765 is repaired in 4b6c7722851ac56461a23e08ca809de8bb1c00ca.

Only tests/browser/console-next-steps.test.mjs changed (+34/-2). Both unreadable-redeploy scenarios now require enabled Agent-level Stop before redeploy, verify the uncertain confirmation names the Agent and explains retention, and prove Cancel sends no Stop request and leaves the Agent requested to run. Existing redeploy, unreadable-version, and permission-denial coverage is retained; no server, product, or authorization changes.

The full owning browser file passes 7/7 with no skips on a remote test VM; the affected browser lane passes 598/598 with no skips. Scoped ESLint/Prettier, workspace isolation, and build pass. These focused runs shipped the edits atop the prior base; their tested file checksum matches the committed file.

The clean exact-new-head full manual CI gate for 4b6c7722851ac56461a23e08ca809de8bb1c00ca reports CI Required PASS; First Agent Smoke PASS; 22/22 jobs passed (8 content-key cached passes from prior-head evidence). Browser 2 and Static ran fresh. The VM parity check matches CI. Prior-head hosted CI failed on the stale assertion and is not relabeled as new-head evidence. This manual gate does not reproduce GitHub's image cache, Docker Hub mirror, or dispatch-only Native Container Verification.

The final-3046989 media in https://gist.github.com/freeqaz/7efc6bb7b54a721307be64e9c18876a0 remains product-identical because this commit changes tests only. It has not been visually inspected here. The human visual hold remains; this is not approval to land.

Preserve the deployment refresh and credential recovery walkthroughs from main alongside the Stop Agent walkthrough. Retain both sides of the overlapping Console and browser-test updates.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant