Skip to content

fix(console): let members with agent:create use the create form - #2998

Merged
freeqaz merged 7 commits into
mainfrom
ux-p10
Oct 20, 2026
Merged

freeqaz merged 7 commits into
mainfrom
ux-p10

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A Namespace member whose role grants Agent create could not create an Agent in the console (UX plan A2, spec 3.11; findings 1901, 493). GET /installation is 403 for members, so the Create Agent form opened, then showed a grey mid-form note ("Creating an Agent needs Installation access...") and kept Create Agent disabled for good, with no reason beside the button. The API accepts Agent create from such a member (the preflight answers 204, finding 1873).

Change

Client only. No server, IAM, policy or permission change; the API still authorizes every request.

  • agents/create.mjs: when GET /installation is 403 and the Namespace permission answer says agents.create === true, the form proceeds without the Installation's capabilities. It refuses no option client-side (the preflight POST /agents/validate and Agent create decide before and at save), creates a draft (no provisioning without the capability), and shows an info status above the form: "Your access: You can create Agents in . Installation-wide capabilities are not readable with your access, so the options below come from this Namespace's Presets. An Installation administrator then gives the new Agent access to its Secrets." An unknown permission answer (failed read) keeps today's refusal. A member without Agent create still never sees the form.
  • After create, the console grants the new Agent access to its Secret through the Namespace IAM routes, which need Installation administration. For the member, that 403 now says the Agent was created as a draft and that granting its Secret access needs Installation administration access, instead of a generic denial and a retry hint.
  • The form starts with a From Preset · <name> badge when it came from a Preset (flows.md C8); presets.mjs passes the Preset name.
  • agents/list.mjs: a disabled Create Agent is aria-describedby its reason ("Your access does not include creating Agents in this Namespace."), alongside the Namespace-not-ready note.
  • Docs: docs/flows/platform-console.md and docs/reference/console/create-and-deploy.md describe the member draft path and that granting the Agent's key access needs Installation administer (word-neutral edits).
  • Storybook: new "Member with Agent create" story; "Agent creation needs an administrator" now fails the permission read to keep showing the refusal.

Follow-up recorded as finding 2090 (owner/design decision, out of scope here): a member can create an Agent but cannot give it access to its model Secret, because the grant routes are Installation administration.

Verification

UI media (before on main, after on this head; Storybook frames via shots.mjs)

1440 390
Before: member form (mid-form note, Create disabled) before-member-form-1440 before-member-form-390
After: member form from the default Preset after-member-form-1440-v2 after-member-form-390-v2
Mockup mockup-create-member-1440

Unchanged for a member without Agent create (after): after-list-no-create-1440 after-create-no-create-1440

Real-server walkthrough (final sources, member-write persona, real Native IAM Driver; not Storybook)

  1. Form from the default Preset, Create Agent enabled: 2-form-1440 2-form-390
  2. Create Agent at the end of the form: 3-create-enabled-1440
  3. After Create: the Agent is saved as a draft and the handoff note names Installation administration access: 4-created-handoff-1440 4-created-handoff-390
  4. Open saved Agent: 5-saved-agent-1440
  5. Recording (1440, real server, member creates the draft, sees the handoff, opens the saved Agent): member-create-walkthrough-1440.webm

Risks

  • An administrator whose Installation read is refused (a Restriction) while the permission answer grants create now gets the member form; every write is still authorized by the API.
  • A member's draft may not deploy until an Installation administrator grants its Secret access (finding 2090); the copy says so before and after Create.

A member whose Namespace grants Agent create got a full Create Agent form,
then a mid-form note that Installation access was needed and a disabled
Create (GET /installation is 403 for members). The form now proceeds when
the Namespace permission answer grants create: an info status above the
form says why, no option is refused client-side (the preflight and create
still decide), and a member learns that an Installation administrator
grants the new Agent access to its Secrets. The form names its Preset, and
a disabled Create Agent on the list is described by its reason.
…ndly

Name the member's refused credential grant after the refusal chain instead
of inside it, and list the new browser file beside the Namespace create
test, so open PRs touching those lines (#2255, #2445) gain no conflict.
…ember story

Internal review: a member cannot read the Installation, so the form cannot
know whether a draft deploys as is (a Credential Gateway, for one, refuses
a raw Secret at deploy). The line under the fields now says only that the
Agent is saved as a draft, the copy names Installation administration
access rather than a role, and the no-Preset copy claims only the
Configuration check. Storybook gains Member with Agent create, and the
capability-denied story keeps its refusal by failing the permission read.
@freeqaz
freeqaz requested a review from a team as a code owner October 20, 2026 03:54
@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.

Visual review: the access status reads as one paragraph with a lighter
second sentence, the post-create note no longer repeats it, and a long
Preset name wraps inside the card at phone width.
@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. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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

This PR lets members explicitly granted Agent creation save drafts when Installation capabilities are unreadable.

Example: A member in Member team has agents.create permission but receives GET /installation 403.

  • Before: Create Agent stays disabled despite the member's creation permission.
  • After: The member can save an Agent draft and receives guidance that an Installation administrator must grant its Secret access.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and source-supported, with useful Native IAM browser coverage; required interactive UI evidence remains incomplete.
Proof confidence 🦪 silver shellfish (2/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: Members granted Agent creation can open the console form but cannot submit it because they cannot read Installation capabilities.
Reason: The collaborator-authored direction restores an existing API-supported operation and explicitly accepts administrator completion of credential access.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a source-confirmed member creation blocker, and the previous documentation finding is resolved; no actionable code defects remain.

Priority: P2
Reviewed head: 1c11ee3f8985edf49969c0fcd5a85df488274212

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Attach the required short UI recording showing member creation, the administrator handoff, and opening the saved draft; the body reports base-fail/head-pass browser coverage, which was not rerun during this read-only review.
Agent review details

How this fits together

The console reads Namespace permissions and Installation capabilities, submits Configuration and Agent requests to OCC, and uses existing IAM routes for credential grants.

flowchart TD
  Member[Namespace member] --> Console[Create Agent console]
  Console --> Permissions[Namespace permissions]
  Console --> Capabilities[Installation capabilities]
  Console --> OCC[Authorized OCC operations]
  OCC --> Draft[Saved Agent draft]
  Console --> IAM[Administrator credential grants]
Loading

Technical review

Best possible solution:

Retain the explicit-permission draft path, server authorization, and clear administrator handoff.

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

Current main requires successful Installation capability discovery before submission, although OCC permits Namespace-authorized members to create Agents; the supplied browser regression exercises that mismatch without faking IAM responses.

Is this the best way to solve the issue?

The change uses the existing form and server operations, limits the exception to an explicit creation grant, and preserves refusal when permission discovery is unknown.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7f44e5f4c91e.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Narrow exception for explicit creation permission: The introduced exception requires both Installation HTTP 403 and agents.create === true; failed permission discovery retains the existing refusal. (apps/controller/src/console/agents/create.mjs:2365, 1c11ee3f8985)
  • Server authorization remains authoritative: OCC authorizes Agent creation, Configuration access, and credential sources before persisting the Agent; IAM policy operations separately require Installation administer. (packages/occ/src/index.ts:7170, 1c11ee3f8985)
  • Target-native browser coverage: The new browser cases use the actual Fastify application, OCC, and Native IAM with fixture storage and runtime dependencies; the allowed member creates an Agent and the credential-grant read returns 403. (tests/browser/console-create-agent-member.test.mjs:98, 1c11ee3f8985)
  • Previous documentation finding resolved: The updated flow documents the explicit-grant draft path, and the creation reference documents the Installation-administrator credential handoff. (docs/reference/console/create-and-deploy.md:8, 1c11ee3f8985)
  • Accepted draft-only boundary: The collaborator-authored PR explicitly accepts administrator completion of credential access and explains it before and after creation; this does not authorize deployment or broaden IAM permissions. (apps/controller/src/console/agents/create.mjs:2857, 1c11ee3f8985)
  • UI evidence policy and inspected media: Four prepared before/after Storybook screenshots were inspected directly. The body contains screenshot links but no short recording or native GitHub media attachments required by AGENTS.md. Newly linked real-server image downloads were blocked by this review environment's gist.githubusercontent.com allowlist restriction; that limitation is not a contributor defect. (AGENTS.md:454, 1c11ee3f8985)

Likely related people:

  • Free Wortley: Raw commit 60c5497 adds apps/controller/src/console/agents/list.mjs:167 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 60c54972afa3; files: apps/controller/src/console/agents/list.mjs)
  • Kevin: Raw commit 8adfd86 adds apps/controller/src/console/agents/create.mjs:587 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8adfd86e96a1; files: apps/controller/src/console/agents/create.mjs)
  • stevenlee-oai: Raw commit 4a11696 adds apps/controller/src/console/agents/create.mjs:252 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4a116967368a; files: apps/controller/src/console/agents/create.mjs)

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A focused console fix restores draft creation for members already authorized by the API.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-20T04:17:12.216Z sha 52b8de1 :: needs changes before merge. :: [P3] Document the member draft and administrator handoff

Reviewed October 20, 2026, 12:32 AM ET / 04:32 UTC (Revision 2).

…andoff

Review: the flow and the creation reference now say a member with Agent
create but no Installation read saves drafts only, and that granting the
Agent's key access needs Installation administer. Word-neutral edits keep
both pages under the cap.
@freeqaz

freeqaz commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 20, 2026
@freeqaz
freeqaz merged commit 4fe00e9 into main Oct 20, 2026
72 of 73 checks passed
@freeqaz
freeqaz deleted the ux-p10 branch October 20, 2026 04:43
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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