Repository navigation
fix(agents): review fixes for AI Agents - #1105
Draft
rohan-chaturvedi wants to merge 54 commits into
Draft
rohan-chaturvedi wants to merge 54 commits into
rohan-chaturvedi wants to merge 54 commits into
Conversation
…nd throttle activity writes
rohan-chaturvedi
marked this pull request as draft
October 29, 2026 15:49
…l the token is copied
…d Agents list - Overview cards list Workflows one per line, with one Generate token per Agent. - The Agent's oldest Workflow (its default) sorts first, the rest A-Z. - Pending requests sit at the top of the card with their deadline and a Review action, the soonest first; the card is outlined in amber. - Hover lights only direct neighbours, and the gutter between the columns takes spare width so connectors fan out. - The Agent page lists one line per granted Connection under each Workflow. - The Agents list names each Agent's Workflows; sessions and last seen share an Activity column.
… Connections - Pending requests on an Overview card are divided by a thin line. - Connection cards show the service mark on a labelled tile instead of a badge that repeated it. - The host override review sits in the override panel: the status on the left, the approve action on the right, and no duplicate in the card footer.
The action that resolves a request keeps the top-right corner, and Deny uses the danger style beside it.
- The AI Agents sidebar item shows an amber count, or a dot when collapsed and in the mobile tab bar. - The tab title gets a "(N)" prefix and the favicon an amber dot, so requests show from other pages and other browser tabs. The navbar polls once a minute, also in background tabs; the sidebar reads the same cache entry.
…ve action - Request cards end with an action bar: Deny at the far left, the action that resolves the request at the far right, after the proposal. - New success Button variant: green in light mode too, where primary is black. The request approve action uses it.
- A pending requests alert sits opposite the Overview search: grey, with an amber warning icon. Clicking it keeps only the Agents with pending requests and the Connections their Workflows use. While on, it takes the warning Alert colours and reads "Pending requests only" with the count; clicking again shows everything. - Column counts read "5/7" while a filter hides cards, and the Connections column is 320px wide so its header still fits on one line. - Alert exports its colour map, so alert-like controls can match it.
…pe and in the pending filter
…and pending requests
…kflow card actions
…, amber Review links
…tion and hide empty detail
…pe and pending requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 Overview
Fixes from the review of #1025 (AI Agents, console side). Targets
feat--agents. Covers the review's security, correctness and performance findings, regressions outside the Agents pages, UI nits, an audit of the Agent UI against the console's shared components, and rounds of UI feedback from a review on a seeded local stack.💡 Proposed Changes
Integration credentials and Connections
IntegrationCredentials:updateis the only permission needed.Host rules
Runtime API
Retry-After.cooldownflag.Lifecycle
GraphQL
agentEventspages history by event time, newest or oldest first (order), and filters by event time (start,end).orderreplacesnewestFirst. The history cursor is opaque (event time, then ingest sequence). The live tail still follows ingest order.Console
phase auth --mode token, but its Copy button copiesPHASE_HOST=<this console> phase auth --mode token, so the CLI skips asking for the instance. It uses the same host as the secrets one-liner (getHostname()).UI consistency with the rest of the console
{}box.InputandTextarea.select.Alert.Button.Buttoniconprop, as the console's convention asks. The prop keeps icons from shrinking, and swaps them for the spinner while loading (Refresh, Load more, confirmations).UI review feedback
Compact Workflow layouts
Pending requests and review actions
successButton variant makes that action green in light mode too, where primary is black.textWarningButton variant: the emeraldtextlink in amber.Overview filters
Buttons: secondary while off, primary while on (black in light mode, emerald in dark).Buttonwhile on) keeps only the Agents with pending requests and the Connections they use or ask for. It replaces the pending requests alert.Connections page
Agent page, aligned with the service account and member pages
?tab=links still open the other tabs.Regressions from #1025 outside the Agents pages
Cleanup
get_agent_from_token, the unreachable Agent branch intoken_is_expired_or_deleted, and unused imports.agent_permissions. The fail-closed RBAC route test matches token auth subclasses and lists the Agent views.JsonBlockmoved from the SCIM logs intocomponents/common, so both logs share it. No change to the SCIM logs.🖼️ Screenshots or Demo
Screenshots of every Agent page were taken from a local stack seeded with seven Agents (one with four Workflows), ten requests, three host overrides and 86 log events, in light and dark, before and after each feedback round.
📝 Release Notes
N/A. Fixes to the unreleased AI Agents feature on
feat--agents.❓ Open Questions
Left out on purpose:
vault_role_idsensitivity. Planned with the integration credential access work.Agents:updatecan disable and resume an Agent. Kept as designed.Found in review, not fixed here:
AgentEventrows.AgentMemberships:updatecan change their own Workflow assignments (custom roles only).agentEventsuses the orgLogs:readpermission, not an Agent permission.🧪 Testing
tests/utils/test_secret.py::test_file_read_permission_errorwas deselected: it fails when tests run as root, and also fails onfeat--agents.tscis clean.eslintis clean on changed files.feat--agents, so tests were run locally.🎯 Reviewer Focus
backend/backend/graphene/mutations/syncing.py: credential edits that move Connections.backend/api/utils/agent_credentials.py: STS cache and lock scope.backend/api/models.pyandbackend/backend/graphene/agents/mutations.py: delete paths and lock order.backend/api/views/agents/base.py: error envelope and session check order.backend/backend/graphene/agents/queries.py: the event-time keyset foragentEventshistory pages.frontend/components/agents/AgentEventLog.tsx: paging, sort order and the live tail. The tail only runs while sorted newest first, and skips late events older than the loaded window, which history pages bring in at their place. Page dividers are keyed to the first event of each loaded page, not to row positions, so live rows do not shift them. The row's action cell stops clicks, so the Allow host confirmation never toggles the row.frontend/components/agents/AgentFilterMenu.tsx: the logs filter look on a Popover, so the inputs inside keep their own keyboard handling.frontend/components/agents/AgentMeshUtils.ts:meshFocusKeys(hover lights direct neighbours and the requests in scope),pendingMeshModel,chipMeshModel(what each filter chip keeps), and the Workflow and request order.frontend/components/agents/AgentMesh.tsx: request lines are measured with the grant lines, and a request on an existing grant replaces its green line. Agent and Connection cards share one pending requests section; Connection cards gather their requests from every Agent.FilterGroupshows chips up to three options (CHIP_LIMIT) and a Popover dropdown beyond; a choice whose chip has gone stops filtering. The dropdown trigger stacks every label it can show invisibly in one grid cell, so its width never changes.frontend/app/[team]/agents/[agent]/page.tsx: the header, Workflow cards with their actions in the header (namedgroup/workflowandgroup/grantscopes), the session rows and their order, the Generate token placement, and the Overview tab, the only one with the Danger Zone.frontend/components/agents/AgentOverview.tsx: the Agent's Overview tab. It reads members with the Members tab's query, so that tab opens from the cache.frontend/app/[team]/agents/connections/page.tsx: the Connections table. Each Connection is its own<tbody>, so its review row highlights on hover together with it.frontend/components/agents/AgentDialogs.tsx:AgentNameFieldkeeps its draft apart from the polled name, andAgentHarnessDialogtakes its trigger as a render prop.frontend/components/agents/AgentMembers.tsx: the Assign members dialog sends one assignment at a time and keeps only the unassigned rows after a failure. Its member search and Workflow dropdowns are Popovers, so the search input keeps its own keyboard handling. The member list opens on the frame after the dialog sets its own focus.frontend/utils/agents/pendingRequests.ts: the once-a-minute check that keeps running in background tabs, and the favicon swap.frontend/components/common/Button.tsx: the new sharedsuccessandtextWarningvariants.➕ Additional Context
invalid_clientfor bad capability lists and for metadata over 8 KiB, andcooldownon repeated asks. TheagentEventschange is console-only GraphQL.0145_agent_runtime_lookups(depends on0144):ProviderCredentials.revisionDB default, session credential index, and the Workflow name constraint message (no SQL).0146_agent_event_time_index: an index on Agent events by Agent, event time and ingest sequence, for the history pages.agentEventsarguments. Console queries also fetch fields the schema already had: Workflow names andcreatedAt, requestexpiresAton the Overview, and on the Agent page the Agent'screatedAt, its pending requests, and each session'screatedAtandclientInfo. The requests are behind@include(if: $includeRequests), sinceagentRequestsfails the whole query withoutAgentRequests:read.public/assets/images/favicon-attention.svgis the favicon with an amber dot, shown while requests are pending.favicon-notification.svg, the same favicon with a Phase emerald dot (#10B981), sits beside it, unused, for other notifications. Both are under/assets, so they load without the session check, like/favicon.svg.ConfirmAgentActionandMintAgentTokenDialogno longer taketriggerContent. To change a confirmation's icon, passtriggerProps={{ icon }}. The trigger and the confirm button both use it.EditAgentDialogis replaced byAgentNameFieldandAgentHarnessDialog, andAgentMembersno longer takescreatedBy. The Overview's request deadline label moved toAgentUIasAgentRequestDeadline, and the request mapping and order are shared asmeshRequestChipandbyRequestDeadline. The Review link and the request kind icon are shared asAgentRequestReviewLinkandAgentRequestKindIcon.AgentConnectionCredentialCardandAgentCardGridSkeletonwent with the Connection cards.AgentBrandIconsnames the colour classes of marks without a brand colour (MONOCHROME_MARK,GENERIC_MARK), so a selected filter chip can tell them apart.feat--agentsafter #1102 landed. The one conflict was the token updates inAgent.deleteandAgentWorkflow.delete(backend/api/models.py). They now update only live tokens and also clearwrapped_key_share. Every other retire path already clears the share.✨ How to Test the Changes Locally
Manual check: change the host of a Postgres integration bound to an Agent Connection, and check the warning and the session restart. On an Agent, have the CLI hit a blocked host, then allow it from the activity log. Create an Agent and check that the dialog only closes from its close button until the token is copied. Paste the copied auth command into a terminal and check the CLI goes straight to the token prompt. In the activity log, sort by Time both ways and try a time range, load more to see the "Page 2" divider, and expand a row to see its Connection. Hover any time to see the full timestamp. On the Overview, hover an Agent, a Workflow, a Connection and a pending request, and check the lines that light up, then click the Pending requests chip to show only the Agents waiting on a decision, and pick harnesses from the Harness dropdown. A Connection that a pending request asks for lists that request with a Review link. Open an Agent: it opens on its Overview tab, with its pending requests, the Workflows, Tokens and Members cards, and the Danger Zone. Each View all opens its tab, which has no Danger Zone. On an Agent with a pending request, the request also sits in its Workflow, and the Workflows tab shows the count. Rename the Agent in place, change its harness from the tile, and hover a Workflow card, a grant, a token, a session and a member to see their actions. Open Assign members, type to search the open member list, and assign two members with different Workflows in one go. On Connections, hover a row for Edit and Delete, and approve an override from the row under it. Leave a request pending and switch to another browser tab: the console tab's title starts with the count, and its favicon shows an amber dot.
💚 Did You...
eslintandprettieron changed frontend lines,blackon changed backend files that were already formatted. Files that were not already formatted have only my lines formatted.tscpasses, and the dev server ran every Agent page.🤖 Generated with Claude Code
https://claude.ai/code/session_01UEDKwREdnbaZuFJzpo8gBz