Repository navigation
fix(workspace): preserve structured permission refusals - #6727
Draft
Colafornia wants to merge 1 commit into
Draft
Colafornia wants to merge 1 commit into
Colafornia wants to merge 1 commit into
Conversation
Colafornia
force-pushed
the
research/sandbox-boundary
branch
from
November 10, 2026 15:10
0c9e784 to
6dd43d7
Compare
Return typed pre-execution permission refusals from JSON file methods and the process service. Preserve requested permissions, optional command and refusal reason in the service result schemas and generated SDK. Reuse generic JSON and operation receipt consumers. Generated-by: Codex
6 of 12 tasks
Colafornia
force-pushed
the
research/sandbox-boundary
branch
from
November 10, 2026 16:33
6dd43d7 to
0e5358f
Compare
Colafornia
marked this pull request as ready for review
November 10, 2026 16:39
Colafornia
marked this pull request as draft
November 10, 2026 16:42
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
When the Host refuses requested file or process access before execution, service wrappers can reduce the error to a message. Callers then lose the refusal reason and requested target.
Return
permission_deniedbusiness results from the JSON file methods and process service. Preserve the reason, requested permissions, optional command and message, withexecutionState: not_started. Reasons distinguish disabled requests, user denial, protected boundaries, insufficient approval and expired grants. Regenerate the SDK contracts from these service schemas.Existing JSON results and operation receipts carry the response through the generic tool projection. The change adds no special permission-error decoding to Code Mode or the Agent journal. Process exit evidence and unknown-operation receipts keep their existing paths; stderr is not used to infer a permission refusal.
readImageretains its existing image error protocol and still returns a string error for a refusal. Its protocol is outside this change.Verification
83fd321171dbffaad0d77cf1e9a616196da36687(rust-preview). Reviewed head:0e5358f83.cargo test -p maka-agent-native -p maka-agent-facts --lib: 32 Native and 29 Facts tests passed on the rebased head.node packages/plugin-sdk/scripts/generate.mjs check: five runtime declaration files verified on the rebased head.cargo fmtchecks andgit diff --checkpassed.just check.Before rebasing, the temporary ablation experiment serialized an actual
ProcessResult::PermissionDeniedinto the existing operation-receipt snapshot test. The result survived generic JSON/operation value conversion, durable output, projection and snapshot transfer after removing the special consumer paths. The temporary fixture was then restored. This verifies consumers, not a real Files/Processes Handler invocation.Remaining validation
This PR remains a draft pending that behavior test. The earlier injected-
ToolErrortests were removed because no current service entry sends that typed error directly to the Agent consumers.AI use
Tool(s) and scope: OpenAI Codex implemented the change, ran the ablation experiments and checks, and wrote the documentation and PR description. Preserve the
Generated-by: Codextrailer when squashing.Checklist
Does this PR entail a change in behavior?
中文
概述
当 Host 在执行前拒绝文件或进程的权限申请时,服务封装可能只保留错误说明,调用方会丢失拒绝原因和申请目标。
让返回 JSON 的文件方法与进程服务返回
permission_denied业务结果,保留原因、申请权限、可选命令和错误说明,并标记executionState: not_started。原因区分禁止申请、用户拒绝、保护边界、批准不足和授权失效。SDK 契约由服务结果的模式定义重新生成。结果通过现有 JSON 及操作回执进入通用工具投影。本次不为 Code Mode 或 Agent 日志新增权限错误的特殊解码。进程退出证据及未知操作回执继续使用既有路径,不根据标准错误输出推断权限拒绝。
readImage保留现有图片错误协议,权限拒绝仍返回字符串错误;本次不修改该协议。验证
83fd321171dbffaad0d77cf1e9a616196da36687(rust-preview),检查的提交为0e5358f83。cargo test -p maka-agent-native -p maka-agent-facts --lib:变基后的提交通过 32 项 Native 测试和 29 项 Facts 测试。node packages/plugin-sdk/scripts/generate.mjs check:变基后的提交通过 5 个运行时声明文件校验。cargo fmt检查及git diff --check通过。just check。变基前的临时消融实验把真实的
ProcessResult::PermissionDenied序列化结果放入既有操作回执快照测试。在删除特殊消费路径后,结果仍完整通过通用 JSON/操作值转换、持久化输出、投影和快照迁移。实验结束后已恢复临时夹具。这验证了消费路径,没有执行真实 Files/Processes 服务处理器调用。待完成验证
此 PR 保持草稿状态,等待上述行为测试。原先注入
ToolError的测试已删除,因为当前服务入口不会把该类型的错误直接送入 Agent 消费路径。AI 使用情况
工具及范围:OpenAI Codex 完成实现、消融实验、检查、文档和 PR 说明。合并压缩提交时请保留
Generated-by: Codex标记。检查清单
本 PR 是否改变行为?