Skip to content

feat(agent-settings): lift policy, identity, grants, runtime and own key - #3248

Merged
lilyshen0722 merged 5 commits into
mainfrom
launch/s6-settings-rest
Nov 1, 2026
Merged

lilyshen0722 merged 5 commits into
mainfrom
launch/s6-settings-rest

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Agent settings, the rest of the page. #3183 lifted the header, the Wake table and Identity & access. This lifts the five sections the frames in #3184 draw.

  • Identity: the display name is a field with an n / 80 count, and its refusals show under the field. Persona is one disclosure, with tone, specialties and boundaries. One "Save identity" covers both. The marketplace listing opens to the owner's rename, Save, Retire/Restore and View public profile; other members see only the profile link.
  • How it runs: harness, model and effort rows. Each has its select, a "last spawn … · confirmed …" line, and a pending dot when the next spawn changes it. A stored choice the harness no longer offers shows as an alert row. Save keeps the accessible name "Save runtime". Machine placement opens inside How it runs, as a "Run on" select plus Move agent. A read-only runtime shows values, not controls.
  • Own API key: at rest it shows the set date, "never shown again", and Replace key / Remove. On entry it shows the field, Save key (disabled while empty) and Cancel. After a failed save the field is empty, as before.
  • Connector grants: each row has the logo, the brand name ("GitHub", not the id), its reach, who granted it, the end date and Revoke. Revoke asks for confirmation inline. Ended grants are dimmed without opacity, so text stays at 4.5:1. The title shows "n active · n ended". A failed load is one row with Try again, and a failed revoke is its own line above the rows.
  • Policy: repository access is a segment that saves on a button. "Saved" or the error shows in the row's action slot. Quotas are read-only.

Deleted: V2AgentRuntimeGrants.css and V2RuntimeControls.css (both used only on this page), and the identity, listing and owned rules in v2-agent-settings.css. Also the old section, quota and select rules in v2-agent-policy.css, and the old focus-ring colour.

Exceptions to the lifted frame:

  • Every control is 44px tall at ≤760px.
  • Each select fills its whole box, so the box is the hit area.
  • Disclosure chevrons keep 3:1 contrast.

Kept as live, not drawn:

  • The memory editor stays under Policy, because the Memory tab can't edit yet.
  • The no-computer setup hint and the blocked-move text.
  • The free-text model input and the model and effort hints.
  • Grant loading text and the read-only key text.
  • Grant dates keep the live full-date format.

Browser check against staging data (claude-code/d215-wren, a read-only CLI seat) at 1440 and 390, light and dark, en and zh-CN:

  • No horizontal scroll, no page errors, no API 5xx.
  • One heading per section.
  • Selects fill their boxes (28 = 28 at 1440, 44 = 44 at 390).

Grants were mocked: GitHub resting, Linear mid-confirm with a revoke error, and Sentry ended. Revoke, "Yes, revoke it" and Cancel are 44px at 390, and the confirm row keeps its date under the name.

At 390, the remaining sub-44px controls are outside these sections:

Tests: 13 new behaviour tests and layout guards, each reverse-verified (fails with its fix removed, passes restored). Old-markup assertions were updated; no behavioural assertion was weakened. v2 and i18n suites 2097/2097, frontend tsc clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3

lilyshen0722 and others added 4 commits November 1, 2026 08:10
…key from the frame

Identity, How it runs (machine, adapter/model/effort, own API key),
Connector grants and Policy now render as the artboard's grouped lists:
lrow rows, details.disc disclosures, .field/.sel controls and alert rows,
styled from v2-agent-settings-surface.css. V2AgentRuntimeGrants.css and
V2RuntimeControls.css are deleted; the identity/listing/owned rules leave
v2-agent-settings.css and the trust/quota rules leave v2-agent-policy.css.

Behaviour kept: every handler, API call and error path. New behaviour from
the frame notes: trust mode is a segment with Saved/error in the action
slot (Saved clears after a moment), the name refusal sits under the field,
grant load failure is a row with Try again, and a failed revoke is its own
line above the rows. Focus rings use --v2-focus-ring; 44px targets on
phones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3
The grant row printed the raw connector id, and capitalising it in CSS
gave "Github". Name it from the logo table instead (GitHub, Linear,
Sentry...), falling back to the id for connectors without a logo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3
…-only runtime reads as values

- A select now fills its .sel/.field box (height and line-height from
  --box-h: 28/34px, 44px on phones), so the whole box takes the click and
  the value stays centred.
- Connector grants renders one h2.gtitle, named by its title alone.
- Disabled runtime selects (read-only seats) drop the box ring and chevron,
  as they did before the lift.
- A row with no confirmation reads "unconfirmed" instead of
  "confirmed unconfirmed".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3
… on phones

At 390 the confirm row's action slot spanned the whole row, so the end
date fell under the logo. The slot now dissolves while confirming: the
date stays in the name column and the Yes/Cancel pair takes the full row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d59c08b and 7cb9aad.

Files selected for processing: 19
  • frontend/src/i18n/locales/en.json
  • frontend/src/i18n/locales/zh-CN.json
  • frontend/src/v2/__tests__/V2AgentPolicy.test.tsx
  • frontend/src/v2/__tests__/V2AgentRuntimeGrants.test.tsx
  • frontend/src/v2/__tests__/V2AgentSettingsPage.test.tsx
  • frontend/src/v2/__tests__/V2RuntimeControls.test.tsx
  • frontend/src/v2/__tests__/v2-layout-invariants.test.ts
  • frontend/src/v2/agents/V2AgentIdentitySection.tsx
  • frontend/src/v2/agents/V2AgentPolicy.tsx
  • frontend/src/v2/agents/V2AgentSettingsIcon.tsx
  • frontend/src/v2/agents/v2-agent-policy.css
  • frontend/src/v2/agents/v2-agent-settings-surface.css
  • frontend/src/v2/agents/v2-agent-settings.css
  • frontend/src/v2/components/V2AgentProviderKey.tsx
  • frontend/src/v2/components/V2AgentRuntimeGrants.css
  • frontend/src/v2/components/V2AgentRuntimeGrants.tsx
  • frontend/src/v2/components/V2RuntimeControls.css
  • frontend/src/v2/components/V2RuntimeControls.tsx
  • frontend/src/v2/connectors/ConnectorLogo.tsx
Files with no reviewable changes: 3
  • frontend/src/v2/components/V2AgentRuntimeGrants.css
  • frontend/src/v2/agents/v2-agent-settings.css
  • frontend/src/v2/components/V2RuntimeControls.css

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Walkthrough

The agent settings interface now uses shared presentation styles across identity, policy, runtime, provider-key, and connector-grant sections. Localization and tests also cover revised layouts, status feedback, validation, and grant actions.

Changes: Agent Settings Surface

Layer / File(s) Summary
Shared settings presentation
frontend/src/v2/agents/V2AgentSettingsIcon.tsx, frontend/src/v2/agents/v2-agent-settings-surface.css, frontend/src/v2/agents/v2-agent-settings.css, frontend/src/v2/components/V2AgentRuntimeGrants.css, frontend/src/v2/components/V2RuntimeControls.css, frontend/src/v2/__tests__/v2-layout-invariants.test.ts
Adds a shared SVG icon and common settings styles, including responsive controls, focus states, forms, and feedback. Removes component-specific stylesheets and checks the revised layout invariants.
Identity and listing settings
frontend/src/v2/agents/V2AgentIdentitySection.tsx, frontend/src/v2/agents/v2-agent-settings.css, frontend/src/i18n/locales/en.json, frontend/src/i18n/locales/zh-CN.json, frontend/src/v2/__tests__/V2AgentSettingsPage.test.tsx
Reworks identity and listing controls into collapsible sections. Name errors appear by the field, persona sections show specialty and boundary counts, and owners retain listing edit and retire or restore controls. Adds validation and permission-error tests.
Policy and quota settings
frontend/src/v2/agents/V2AgentPolicy.tsx, frontend/src/v2/agents/v2-agent-policy.css, frontend/src/v2/__tests__/V2AgentPolicy.test.tsx
Presents trust options as radio controls and places saved or error feedback beside Save. Renders hosted and native quota values and errors in the shared settings list.
Runtime, provider-key, and grant settings
frontend/src/v2/components/V2RuntimeControls.tsx, frontend/src/v2/components/V2AgentProviderKey.tsx, frontend/src/v2/components/V2AgentRuntimeGrants.tsx, frontend/src/v2/connectors/ConnectorLogo.tsx, frontend/src/i18n/locales/en.json, frontend/src/i18n/locales/zh-CN.json, frontend/src/v2/__tests__/V2RuntimeControls.test.tsx, frontend/src/v2/__tests__/V2AgentRuntimeGrants.test.tsx
Moves runtime controls, provider-key forms, and connector grants to the shared layout. Grant loading and revocation have separate errors; load failures offer retry, and grant rows show counts, connector names, and revoke controls. Adds machine, retry, count, and API-key labels and tests for these states.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

  • Team-Commonly/commonly, Issue 709 — Adds Simplified Chinese labels for parts of the v2 settings surface, addressing part of the translation scope.
  • Team-Commonly/commonly, Issue 1400 — The provider-key section presents API-key status and key management in the v2 settings surface. The issue’s connect-flow requirements are not covered.
  • Team-Commonly/commonly, Issue 632 — Adds a test that memory-editor “Saved” status remains visible after five seconds. The issue’s broader memory-management requirements are not covered.
  • Team-Commonly/commonly, Issue 741 — Adds the agent Identity settings surface, but does not implement the described per-pod display-name deduplication fix.
  • Team-Commonly/commonly, Issue 570 — Updates the agent Identity settings surface, but does not add the requested avatar control.
Merge Risk: Low · up to 63da4

Key removal, machine placement, and mobile button sizing need stronger regression tests. The remaining risk is low.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: moving policy, identity, grants, runtime, and owned API key sections into the agent settings page.
Description check Passed The description directly explains the changes to the agent settings sections, UI behavior, styling, tests, and verification results.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…d and key states from main

- Each grant row shows its tool list as visible text again, so two grants
  for one connector are told apart.
- A revoke error clears on Cancel and when another confirm opens.
- A revoked machine and a requested one show together, as on main.
- Only the trust row's Saved auto-dismisses; the memory editor keeps its
  Saved until the next action.
- The own-key set date and Remove show whenever the key is set and the
  agent is editable, including when the harness cannot take a key and
  while replacing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AKgpMD6Qh13f7fj6mbGT3

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh-context review (Opus) at 7cb9aad, then a second pass at 63da4be checking the fixes.

First pass, one defect: grant rows showed only the brand name, with the tool list hidden in a title, so two grants for one connector couldn't be told apart before revoking. Fixed: the tool list is visible again on its own line, and it wraps cleanly at 390 (browser-checked).

Nits fixed in the same commit:

  • A revoke error now clears on Cancel and when another confirm opens.
  • A revoked machine and a requested machine show together again, as on main.
  • The 2.5 s auto-dismiss applies only to the trust save; the memory editor's "Saved" persists, as on main.
  • The own-key "set · date" line and Remove show in the unavailable-harness row and inside the Replace form, behind main's editable && set gate.

Each fix has a test that fails on the previous head.

Verified unchanged from main:

  • Revoke still needs the inline confirm, and the canRevoke and not-ended gates are unchanged.
  • The runtime Save and editable conditions are identical.
  • A failed key save clears the field and leaves Save disabled.
  • Owner and member listing controls are unchanged.
  • The radiogroup is named, and there is one heading per section.
  • New keys are in both locales, and the zh-CN follows the glossary.
  • Deleted CSS has no remaining users, and no rule uses --v2-accent-soft.

Token remap: --sf and --t resolve to identical values. Only dark-mode --ink moves, from #e8ebf1 to #f4f5f8.

Browser check: see the PR body. At 63da4be, mocked grants with a long tool list were checked at 1440 and 390, light and dark. Revoke, "Yes, revoke it" and Cancel are 44px at 390, with no scroll and no page errors.

Suites: v2 and i18n 2103/2103, frontend tsc clean.

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 832f48f Nov 1, 2026
35 of 36 checks passed
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