feat(agents): add agent permission-policy control (OpenCode pilot) - #4030
Open
whyihaveyou wants to merge 1 commit into
Open
feat(agents): add agent permission-policy control (OpenCode pilot)#4030whyihaveyou wants to merge 1 commit into
whyihaveyou wants to merge 1 commit into
Conversation
…onUi iOfficeAI#4018) Add a permission-level selector to the Agent settings page for external agents (OpenCode pilot). It reads the backend's /api/agents/permission-policy read-model and write-throughs the selected level (ask / auto_edit / full_auto) to the agent's own config, then re-polls so the echoed level stays in sync. - agentPermissionPolicy model: normalized levels, read-model types, and an actionable check (supported + installed). - AgentPermissionControl: renders only when the backend reports the agent is supported and installed; clear option resets to agent default. - LocalAgents wiring: fetch policy read-models, pass per-agent to the control, re-poll on change. - ipcBridge.permissionPolicy: list / setLevel / clear routes. - i18n: 13 locales + generated key types. - Vitest: unit + DOM tests for model, control, and LocalAgents wiring.
whyihaveyou
requested review from
IceyLiu,
jiahe0510 and
kaizhou-lab
as code owners
August 13, 2026 10:17
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Description
Add an agent-side permission-policy control to the Agent settings page (OpenCode pilot for #4018). The backend (AionCore PR #845) exposes
/api/agents/permission-policy*read/write routes; this PR adds the UI that reads the read-model and write-throughs the chosen level to the agent's own config file.The control only renders when the backend reports the agent is supported and installed (OpenCode today, future agents plug in later). It offers three normalized levels (
ask/auto_edit/full_auto) plus an unmanaged option, and re-polls the read-model after a write-through so the echoed value stays in sync with the agent's config.Related Issues
Type of Change
feat— New feature (non-breaking change which adds functionality)Atomic PR Checklist (Rule 1)
<type>(<scope>): <subject>(English)Local Checks (Rule 3)
bun run format— formatting passesbun run lint— no lint errors (0 errors; only pre-existing warnings)bunx tsc --noEmit— no type errorsbunx vitest run— new tests pass (18 LocalAgents + 10 permission tests); full suite green except pre-existing failures that requireresources/windows/*.nshabsent from a sparse checkoutbun run i18n:types+node scripts/check-i18n.js)Runtime Verification
Additional Context
Dependency: this UI consumes the
/api/agents/permission-policy*routes added in AionCore PR #845. Merge order: AionCore first, then this PR.中文说明
AionUi 统一管理外部 Agent 配置(issue #4018)的试点收尾:AionCore PR #845 新增了
/api/agents/permission-policy系列接口(list / get / put / clear),本 PR 实现对应的前端权限控件。supported && installed时才显示(当前只有 OpenCode)。ask(询问)/auto_edit(自动编辑)/full_auto(全自动),另加「未设置」选项用于清除策略、回退到 agent 默认行为。
以及 i18n(13 locale)与 Vitest 测试(模型 + 控件 DOM + LocalAgents 装配)。