feat: Simplify user consent flow for computer-use#28266
Open
dlavrenuek wants to merge 1 commit intomasterfrom
Open
feat: Simplify user consent flow for computer-use#28266dlavrenuek wants to merge 1 commit intomasterfrom
dlavrenuek wants to merge 1 commit intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/@n8n/computer-use/src/confirm-resource-cli.ts">
<violation number="1" location="packages/@n8n/computer-use/src/confirm-resource-cli.ts:28">
P2: According to linked Linear issue NODE-4795, the CLI prompt must remove the permanent “Always allow” and “Always deny” options. These choices are still presented, so the UI doesn’t match the simplified consent flow.</violation>
</file>
Architecture diagram
sequenceDiagram
participant User as User (UI/CLI)
participant UI as n8n Frontend
participant GC as GatewayClient
participant GS as GatewaySession
participant Tool as Computer Use Tool
Note over User,Tool: Tool Execution Request
GC->>GS: check(toolGroup, resource)
GS-->>GC: PermissionMode: "ask"
alt NEW: Instance Mode (Web UI)
GC-->>UI: NEW: Error(GATEWAY_CONFIRMATION_REQUIRED)
Note right of UI: Includes ToolGroup & limited options:<br/>denyOnce, allowOnce, allowForSession
UI->>User: Display Simplified Prompt
User-->>UI: Selects "Allow {toolGroup} for session"
UI->>GC: NEW: dispatchToolCall(..., _confirmation: "allowForSession")
else CHANGED: Client Mode (CLI)
GC->>User: CHANGED: Prompt for confirmation
Note right of User: Choices include toolGroup in "Allow for session" label
User-->>GC: "allowForSession"
end
Note over GC,GS: Permission Elevation Flow
alt Decision is "allowForSession"
GC->>GS: CHANGED: setPermissions({ [toolGroup]: 'allow' })
Note over GS: Permission is now elevated for the ENTIRE tool group<br/>for this session (previously resource-specific)
else Decision is "allowOnce"
Note over GC: Proceed without updating session state
end
GC->>Tool: execute()
Tool-->>GC: Result
GC-->>UI: Tool Result
opt Session End
GC->>GC: disconnect()
Note over GC,GS: CHANGED: Session-specific rules are no longer<br/>manually cleared as they are part of session state
end
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Bundle ReportChanges will decrease total bundle size by 479 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
Files in
|
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.
Summary
Simplifies the decisions in HITL for Computer Use.
Always allowandAlways denyoptions which store the decision permanently between sessions for given resource.Allow for sessionchoice is changed toAllow {toolGroup} for sessionand sets the tool group toallowfor the current sessionAllow for sessiontoAllow(once),Allow for sessionwas moved to the dropdownRelated Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)