Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an “auto approval” mode to prevent OpenClaw command execution from stalling on manual approvals by introducing an approval_policy on boards/agents and a backend gateway event listener that can auto-resolve approval requests.
Changes:
- Add
approval_policy(JSON) toagentsandboards(DB + backend models/schemas), plus UI controls for selecting the default/agent policy. - Introduce persistent gateway WebSocket listeners to receive
exec.approval.*events and auto-resolve approvals when policy isimmediate. - Regenerate the frontend API client/models (orval) and update API reference docs to describe
approval_policy.
Reviewed changes
Copilot reviewed 18 out of 271 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/boards/new/page.tsx | Adds board creation UI for selecting default approval_policy.mode and submits it to the API. |
| frontend/src/app/agents/new/page.tsx | Adds agent creation UI for selecting approval_policy.mode and submits it to the API. |
| frontend/src/app/agents/[agentId]/page.tsx | Displays agent authorization mode in agent detail view. |
| frontend/src/app/agents/[agentId]/edit/page.tsx | Adds agent edit UI to update approval_policy.mode. |
| docs/reference/api.md | Documents the new approval_policy behavior and examples. |
| backend/migrations/versions/47bc9d8e1234_add_approval_policy_to_agents_and_boards.py | Adds nullable JSON approval_policy columns to agents and boards. |
| backend/app/models/agents.py | Adds approval_policy field, default policy constants, and get_approval_policy() helper. |
| backend/app/models/boards.py | Adds approval_policy field to the Board model. |
| backend/app/schemas/agents.py | Exposes approval_policy in agent create/update schemas. |
| backend/app/schemas/boards.py | Exposes board approval_policy on read/create schemas. |
| backend/app/services/openclaw/provisioning_db.py | Ensures lead agents get a default approval_policy when missing and on creation. |
| backend/app/services/openclaw/admin_service.py | Ensures gateway main agent gets a default approval_policy when missing and on creation. |
| backend/app/services/openclaw/gateway_rpc.py | Adds resolve_approval() RPC wrapper for exec.approval.resolve. |
| backend/app/services/openclaw/gateway_listener_manager.py | Adds a singleton manager to start/stop per-gateway persistent listeners. |
| backend/app/services/openclaw/gateway_events.py | Implements the per-gateway WebSocket connection and dispatches approval events to policy logic. |
| backend/app/services/openclaw/approval_policy.py | Implements policy evaluation + auto-resolve behavior for approval requests. |
| backend/app/main.py | Starts/stops the gateway listener manager during app lifespan. |
| backend/app/api/gateways.py | Stops a gateway listener when the gateway is deleted. |
| frontend/src/api/generated/** | Regenerated API client + models (orval v8.5.3) including new approval policy types and updated imports/ordering. |
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.
Task / context
execcommand permission #304openclaw approvalsignal and processes it automatically, preventing the process from stalling during the OpenClaw command execution step.Scope
Out of scope
Evidence / validation
make check(or explain what you ran instead)Screenshots (UI changes)
Docs impact
Risk / rollout notes
Checklist
origin/master(no unrelated commits)docs/reference/api.md)