Skip to content

feat: Add workbench actions - #3910

Draft
maciaszczykm wants to merge 51 commits into
masterfrom
marcin/prod-5064-adding-workbench-k8s-action-designs
Draft

feat: Add workbench actions#3910
maciaszczykm wants to merge 51 commits into
masterfrom
marcin/prod-5064-adding-workbench-k8s-action-designs

Conversation

@maciaszczykm

@maciaszczykm maciaszczykm commented Jul 24, 2026

Copy link
Copy Markdown
Member

Fixes PROD-5073 too.

Test Plan

Test environment: https://console.plrl-dev-aws.onplural.sh/

Checklist

  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have deployed the agent to a test environment and verified that it works as expected (required only when changing agent code).

Plural Flow: console

@maciaszczykm maciaszczykm added the enhancement New feature or request label Jul 24, 2026
@linear

linear Bot commented Jul 24, 2026

Copy link
Copy Markdown

PROD-5064

PROD-5073

@soffi-ai

soffi-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Soffi AI Summary

This PR adds workbench actions — a new approval/supervision workflow for AI workbench tool invocations that require human review before execution. It addresses PROD-5073.

The core change introduces an "Actions" tab in the workbench UI that surfaces pending tool calls waiting for human approval or denial. Key motivations and changes include:

  1. Approval setting per tool: A new "Approvals" step is added to the workbench tool configuration form (alongside "Configuration" and "Access Policy") for tools that support it (cloud functions like Lambda, Cloud Run, Azure Functions, and others). This lets operators require human sign-off before the AI agent executes sensitive operations.

  2. Awaiting Review workflow: The existing AwaitingReviewPanel and context are enhanced to handle workbench activity items — users can now approve or deny pending AI agent actions, optionally providing a denial reason. A new AwaitingReviewWorkbenchActivityItem component drives this interaction with a deny modal and status chip.

  3. Cloud function tool form improvements: The tool form now correctly handles cloud function types (Lambda, Cloud Run, Azure Functions) including validation of required fields (ARN/identifier, description, input schema) and cloud connection provider selection. Previously, cloud connection fields were only shown for the generic Cloud tool type.

  4. New icons: Three new icons added to the design system — LambdaIcon, GoogleCloudRunIcon, and MicrosoftActionsIcon — supporting the new cloud function tool types.

  5. WorkbenchFormSteps: A new WorkbenchFormSteps component consolidates step navigation for workbench creation/editing flows.

  6. DiffViewer improvements: The DiffViewer design system component gets minor refinements (with a new Storybook story added).

  7. Client regeneration: GraphQL client is regenerated multiple times across commits to pick up schema changes supporting the new approval field on workbench tools and related query updates.

Commits

Commit Summary
35ddfc2 Initial GraphQL client update to pick up new schema fields needed for workbench actions.
c7c4bd9 Added new icons to the design system: LambdaIcon, GoogleCloudRunIcon, and MicrosoftActionsIcon for cloud function tool types.
37132d1 Scaffolded the new custom workbench actions tab and related UI components.
a415135 Added the 'approval' setting to the workbench tool form, introducing a new 'Approvals' step in the tool configuration wizard for supported tool types.
4c6f719 Added a missing GraphQL query needed to support fetching workbench action/activity data.
d6fd2b4 Updated the Awaiting Review panel to surface workbench activity items alongside existing agent run items.
67f9547 Regenerated GraphQL client after schema/query changes.
127ccff Another client regeneration pass to sync generated types with updated operations.
1bf2924 Fixed server-side code supporting the workbench actions feature.
6c31ece Updated a GraphQL query (likely for actions or activity feed) to include additional fields.
045f9b6 Improved workbench tooltip copy or display.
f7ec888 Updated the Lightning icon in the design system (visual refinement).
7dcfef0 Initialized the Actions tab in the workbench UI, providing the entry point for the approval workflow.
240d8df Fixed a bug in panel content presence check to correctly show/hide the actions panel.
8a6af64 Added filtering support for the workbench activity feed (e.g., filter by status or type).
cfc1e7c Added a pending actions icon/indicator to surface unreviewed actions to the user.
6f1acd6 Fixed a bug where activity rejection was not handled correctly.
2a54607 Implemented the initial list view for workbench actions, showing pending tool invocations awaiting approval.
8db02ce Fixed a bug in the tool configuration form affecting form state or validation.
1c86a2c Updated the approve/deny action buttons in the actions panel.
f78c536 Added a status chip to action items to display the current action state (pending, approved, denied, etc.).
a2724c6 Added a deny modal with an optional reason field, allowing users to provide context when rejecting an AI agent action.
032513f Conditionally shows the Actions tab only when there are actions present.
2220bed Styling refinements for the actions/approvals UI.
29260db Additional styling polish for the workbench actions panel.
e21a27f Updated an icon used in the actions or workbench UI.
7cf6469 Extended action status handling to cover all possible states in the UI.
53360c8 Added action cards rendered inline in the chat view for pending approvals.
add8584 General updates and fixes to the actions workflow.
c98c2b5 Refactored components for better structure and reuse across the workbench actions feature.

Deploy in Soffi


Updated: 2026-07-28 18:08 UTC

@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

Comment thread assets/src/graph/workbench.graphql
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds supervised workbench actions and their review workflow.

  • Adds approval and denial flows for function and Kubernetes workbench actions.
  • Adds server-side Kubernetes Secret redaction and safe diff retrieval.
  • Adds workbench action cards, status displays, denial controls, and Kubernetes diff rendering.
  • Extends GraphQL schemas, generated clients, tests, and design-system components supporting the workflow.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
lib/console/deployments/workbenches.ex Adds transactional approval and rejection execution with row locking to serialize concurrent decisions.
lib/console/graphql/resolvers/deployments/workbench.ex Adds action mutations and server-side redaction and retrieval logic for Kubernetes request diffs.
assets/src/graph/workbench.graphql Adds workbench action mutations and a focused query for Kubernetes request diff data.
assets/src/components/workbenches/workbench/job/WorkbenchJobActionDetail.tsx Implements the action-review UI and approval or denial interactions.
assets/src/components/workbenches/workbench/job/WorkbenchJobKubeUpdateDiff.tsx Renders Kubernetes action diffs while suppressing Secret details in the UI.
test/console/deployments/workbenches_test.exs Covers workbench action execution, including serialized concurrent approvals.
test/console/graphql/queries/deployments/workbench_queries_test.exs Covers GraphQL retrieval and server-side redaction of Kubernetes Secret request bodies.

Reviews (2): Last reviewed commit: "fix build" | Re-trigger Greptile

@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm

Copy link
Copy Markdown
Member Author

plural review this

@plural-copilot plural-copilot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice feature set overall, and the prior Secret-body exposure issue looks addressed. I found two remaining issues before this is ready:

  1. reject_job_activity/3 still allows an approve/reject race that can mark an already-executed action as rejected.
  2. Kubernetes update action titles drop the object name, which makes the new action UIs ambiguous when multiple resources of the same kind are present.

Requesting changes for those.


export function formatKubeKindLabel(
resource: string | undefined
): string | undefined {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

getKubeActionTitle() only includes the resource name for delete actions. For update actions this collapses every item in a collection to the same title (e.g. every Deployment shows as just Deployments), which makes the new inline/action-list UI much harder to scan once there are multiple pending updates in the same namespace. Please include parsed.name for update actions too, similar to the delete case.

get_workbench_job_activity!(activity_id)
|> allow(user, :approve)
|> when_ok(fn activity ->
start_transaction()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There’s still a race on rejection. reject_job_activity/3 now locks the row, but unlike approve_job_activity/2 it never verifies that the activity is still in :needs_approval before updating it. After one reviewer approves and releases the lock, a concurrent reject can acquire the lock and overwrite the now-successful activity to :rejected, leaving state inconsistent with the already-executed external action. Please guard reject the same way approval is effectively guarded, so only activities currently awaiting approval can transition to rejected.

|> paginate(args)
end

def function_call_tool(%{tool_id: id}, _, _) when is_binary(id),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the changes in this module are pretty clunky i'll try to make a few style improvements.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Okay, thank you.

@@ -0,0 +1,42 @@
import createIcon from './createIcon'

const icon =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

embedding a png seems like the wrong approach here. You can either generate an svg from it with a tool or ask the ai to do that for you.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've done a ton of these, I usually just prompt the ai to search for brand icons online, and generate the appropriate svg from them. It can normally figure it out, and often find one that's already availale online with web search.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants