Repository navigation
fix(agent): preserve grants when permission requests are disabled - #6761
Open
Colafornia wants to merge 4 commits into
Open
Colafornia wants to merge 4 commits into
Colafornia wants to merge 4 commits into
Conversation
Only advance the permission boundary for access changes or explicit revocation. Keep the metadata regression with the boundary behavior. Generated-by: Codex
Keep four Host metadata steps covering request toggles, access changes, and explicit revocation. Compare persisted settings and permission basis without redundant revision assertions or string-based access selection. Generated-by: Codex
Colafornia
marked this pull request as draft
November 10, 2026 16:43
Remove implicit grant revocation from ordinary permission setting updates. Let the Host metadata owner advance the boundary for access changes and explicit revocation, and cover the UI controller request through its existing control seam. Generated-by: Codex
Colafornia
marked this pull request as ready for review
November 10, 2026 16:56
Keep one real-controller request regression for disabling permission requests. Remove the second settings input, simulated session updates, and repeated empty-error assertions; Host coverage retains access-change and explicit-revocation behavior. Generated-by: Codex
This branch has not been deployed
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.
English
Summary
Turning off new permission requests should preserve previously approved grants. The Host previously advanced the permission boundary for any settings change, and the UI also requested grant revocation on ordinary settings updates.
Advance the boundary only when base access changes or a caller explicitly sends
revokeGrants: true. Remove implicit revocation from the conversation permission control and pending conversation/goal submissions. The Host metadata owner makes the boundary decision for all callers.Workbench currently has no dedicated revoke-grants action. This PR removes the accidental implicit revocation caused by ordinary settings updates; it does not add a new user-facing revocation control. Callers can still revoke grants through the metadata API; a dedicated Workbench control can be a follow-up if required.
Split from #6727. OpenAI Codex prepared this PR under the contributor's direction.
Verification
83fd321171dbffaad0d77cf1e9a616196da36687(rust-preview). Verified head:a2119a1f5.node --test products/maka/workbench/tests/*.test.mjs: 118 passed, including the new permission-controller regression. Before the UI correction, that regression failed because the actual controller sentrevokeGrants: truewhen only disabling requests. It checks that disabling requests sends one metadata update without grant revocation, through the real controller and its existing control callback. The simplified test still fails when the old revocation parameter is restored at module load time.git diff --check, passed. The test is included by the existing tooling-tests glob.951778340:cargo test -p maka-agent-native --lib -- owner::driver::tests::permission_boundary::passed (1 test); Rust formatting and diff checks passed. No Rust source changed in the follow-up, and this test was not rerun. It checks real Host mutation receipts, cleanup, persisted settings, and boundary preservation for request toggles versus invalidation for access changes and metadatarevokeGrants: true.just check, real-window acceptance, or an end-to-end operation that obtains and reuses a grant after the toggle. The controller test observes its outgoing request; it does not execute a Host mutation.Manual acceptance: approve a session grant, disable new requests in the conversation UI, verify that the approved operation remains executable and a new target cannot request access, then revoke grants through the metadata API and verify that the old grant cannot be reused.
AI use
Tool(s) and scope: OpenAI Codex implemented the corrections, tests, ablation experiments, documentation, review follow-up, and this PR description. Preserve the
Generated-by: Codexcommit trailers when squashing.Checklist
The focused checks are listed above; the complete checks and manual acceptance have not run.
Does this PR entail a change in behavior?
中文
概述
关闭新增权限申请应保留此前批准的授权。原先 Host 会在任意权限设置变更时推进权限边界,UI 也会在普通设置更新时主动请求撤销授权。
改为仅在基础访问权限变化,或调用方明确发送
revokeGrants: true时推进边界。移除会话权限控件、待创建会话及目标提交中的隐式撤销,由 Host 元数据处理处统一决定所有调用方的权限边界变化。Workbench 当前没有独立的撤销授权入口。本 PR 移除的是普通设置更新带来的隐式撤销,不新增用户可见的撤销操作。调用方仍可通过 metadata API 显式撤销授权;如产品需要 Workbench 内的撤销按钮,可作为后续工作。
从 #6727 拆出。此 PR 由 OpenAI Codex 在贡献者指导下准备。
验证
83fd321171dbffaad0d77cf1e9a616196da36687(rust-preview)。当前验证提交为a2119a1f5。node --test products/maka/workbench/tests/*.test.mjs:118 项通过,包含新增的权限控制器回归。修正 UI 前,该回归因真实控制器在仅关闭申请时发送revokeGrants: true而失败;现在通过真实控制器及既有控制回调,检查关闭申请时只发送一次元数据更新,且不请求撤销授权。精简后的测试在模块加载时临时恢复旧撤销参数后仍会失败。git diff --check通过。既有工具测试入口会自动纳入该测试。951778340的验证:cargo test -p maka-agent-native --lib -- owner::driver::tests::permission_boundary::通过(1 项),Rust 格式及差异检查通过。后续修复没有修改 Rust 源码,本轮未重跑该测试。它检查真实 Host 变更回执、清理、持久设置,以及申请开关保留边界、基础访问权限变化和 metadatarevokeGrants: true使边界失效的行为。just check、真实窗口验收,以及取得授权后切换开关再复用授权的端到端操作。控制器测试检查发出的请求,没有执行 Host 变更。人工验收:批准会话级授权,在会话界面关闭新增申请,确认已批准的操作仍可执行且新目标不能申请权限;再通过元数据 API 撤销授权,确认旧授权无法复用。
AI 使用情况
工具及范围:OpenAI Codex 完成修复、测试、消融实验、文档、审查后续处理及本 PR 说明。合并压缩提交时请保留
Generated-by: Codex标记。检查清单
上方列出了聚焦检查;完整检查和人工验收尚未运行。
本 PR 是否改变行为?