Skip to content

fix(console): say once that policy denials are unavailable and drop retry after a refusal - #2987

Merged
freeqaz merged 4 commits into
mainfrom
fix-2060
Oct 20, 2026
Merged

freeqaz merged 4 commits into
mainfrom
fix-2060

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Dogfood D655 (board finding 2060, low). On oce-dogfood-b (Kubernetes Compute, no Sandbox Driver), the new Policy denials tab (#2599):

  • read runtime/logs?source=sandbox (400, "no such runtime log source") and the policy recommendations (409), showed both refusals, and then a full editor (Enable editing, rules, Review, Apply) under "This Sandbox Driver does not support per-Agent network policy.";
  • for a member, the 403s rendered Retry policy read and an enabled Refresh suggestions, which can only ask again for the same refusal.

Change

Console only (agents/sandbox-policy.mjs); no API change.

  • The Sandbox log and suggestion reads now wait for the tab's first policy read. When it reports no per-Agent network policy capability (capability: null, the API's own answer), the tab shows one status sentence ("This Sandbox Driver does not support per-Agent network policy. Policy denials, suggestions and Agent network rules are not available for this Agent.") and makes neither read. The draft Policy tab, which reads neither anyway, shows the same sentence instead of the editor. A refused or failed policy read leaves the logs and suggestions to their own permissions, as before.
  • A 403 on the policy read offers no Retry policy read; a 403 on suggestions offers no Refresh suggestions and Follow does not re-request refused suggestions.
  • Storybook: the existing Policy denials → Sandbox policy capability unavailable story now shows the one-sentence state; its steps and policy-workflow.md say so.

The gate sits inside readLogs, loadSuggestions and loadPolicy, not in the tab's start-up block, so it adds no conflict with open #2980, which rewrites that block.

Verification

Screenshots (real controller; Policy denials tab of an active revision)

State Before 1440 After 1440 Before 390 After 390
No per-Agent network policy (no Sandbox Driver)
Member without SandboxPolicy read (suggestions and policy refused)

Storybook: Pages/Agent detail → Sandbox policy capability unavailable.

Risks

  • If the policy read hangs, the denials and suggestions wait with it (they were independent before).
  • On a supported driver the logs and suggestions reads start after the policy read answers instead of alongside it: one extra round trip before the denials load.
  • A member who is later granted access sees the refusal without a retry control until the tab is reopened or the page refreshed.

…after a refusal

On an Installation whose Sandbox Driver lacks per-Agent network policy,
the Policy denials tab read the Sandbox logs (400) and suggestions
(409), showed both refusals and then a full editor; a member also got
Retry policy read and Refresh suggestions after 403s (finding 2060,
dogfood D655). The tab now reads the policy first: with no capability it
shows one sentence and makes neither read. A 403 on the policy or
suggestions read offers no retry.
replaceChildren stringifies null, so the omitted Retry and Refresh
controls rendered the word null. Spread them in only when offered, and
assert no stray text in the member test.
… not the tab's start

Same behavior as the previous commits (one unsupported sentence, no
logs or suggestions read without per-Agent network policy, no retry
after a 403), restructured so the change stays inside readLogs,
loadSuggestions and loadPolicy and leaves the tab's start-up block
untouched: open #2980 rewrites that block.
@freeqaz
freeqaz requested a review from a team as a code owner October 20, 2026 01:31
@clawsweeper

clawsweeper Bot commented Oct 20, 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.

…p following refused suggestions

The draft Policy tab reads no logs or suggestions, so it never reached the
unsupported check and still offered the editor. loadPolicy now shows it.
Follow no longer re-requests suggestions after a 403.
@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. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The console hides unavailable policy controls and suppresses policy retry controls after permission refusals.

Example: Open Policy denials for an Agent whose Installation has no Sandbox Driver.

  • Before: The tab requests unavailable logs and suggestions and displays an unusable policy editor.
  • After: The tab displays one availability notice without requesting logs or suggestions or displaying the editor.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful repair with credible browser regressions and partial visual proof; the repository's UI evidence gate remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users see repeated availability errors and unusable policy controls, while denied readers are offered requests that repeat the refusal.
Reason: The maintainer-authored direction improves concrete unsupported and permission-denied states without changing the platform contract.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it addresses a source-verifiable console bug that remains on main, and no discrete correctness defect was found in the introduced changes.

Priority: P2
Reviewed head: 4773bc411ce9a356956706a8e76f5c436be655a9

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide the required final-revision UI interaction recording and native GitHub screenshot attachments; the added browser cases and inspected static screenshots do not complete that visual gate.
Agent review details

How this fits together

The Agent policy console consumes separately authorized policy, recommendation, and runtime-log endpoints and renders denial records and policy controls.

flowchart TB
  A[Agent policy tab] --> B[Policy API and IAM]
  B --> C[Capability response]
  C -->|Unsupported| D[Availability notice]
  C -->|Supported or read failed| E[Independent log and suggestion reads]
  E --> F[Denials and policy controls]
Loading

Technical review

Best possible solution:

Keep capability handling in the existing policy view while preserving separate server-side permissions for logs, suggestions, and mutations.

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

Current-main source exposes the reported unsupported editor and refusal retry controls, supported by before screenshots and targeted regression cases; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The focused console repair uses the API's existing capability response, preserves independent permissions after failed policy reads, and adds no competing API or persistence owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 698112e67e0a.

Provenance checked

  • Policy capability presentation and independent contextual reads changes intended behavior with a stated reason (1415152: The original feature supplied independently authorized denial logs, recommendations, and governed editing through optional Sandbox Driver capabilities.)
  • Policy and recommendation refusal controls changes intended behavior with a stated reason (1415152: The original console supplied explicit refresh and retry controls; this PR explains why permission refusals should suppress those controls.)
  • Unsupported Storybook workflow keeps the original intent (1415152: The original scenarios separated unavailable capabilities from independently unavailable contextual reads; the revised unsupported instructions match the repaired view.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Derek Carr: Raw commit 1415152 adds apps/controller/src/console/agents/sandbox-policy.mjs:92 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 141515257737; files: apps/controller/src/console/agents/sandbox-policy.mjs)
  • Free Wortley: Raw commit 067655e adds tests/browser/console-agent-draft-guards.test.mjs:891 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 067655ee1fa4; files: tests/browser/console-agent-draft-guards.test.mjs)

Labels

Label changes:

  • add P2: Unavailable and refused policy controls confuse an otherwise usable Agent details workflow, with limited blast radius.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Unavailable and refused policy controls confuse an otherwise usable Agent details workflow, with limited blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 19, 2026, 9:48 PM ET / October 20, 2026, 01:48 UTC.

@freeqaz
freeqaz merged commit 14a04fb into main Oct 20, 2026
81 checks passed
@freeqaz
freeqaz deleted the fix-2060 branch October 20, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant