Repository navigation
[PR] fix(opencode-v2): remove permission:allow so ACP tools can be allowlisted by name - #6825
MorningStar0709 wants to merge 16 commits into
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — searched open+closed issues/PRs for the opencode-v2 permission topic; this PR is the only thread on this mechanism. Upstream report lives in the other repo (anomalyco/opencode#64051), which is the bug report this PR fixes. No parallel [PR] thread in the mirror. ReviewWhat I verified
Regression analysis (existing behavior on the touched paths)
Test validity: the two updated assertions pin exactly this regression — re-adding Quality (external contribution): clean — 4 lines, minimal, no dead code, no style drift. No rework needed. 八问
行为变更披露(旧 → 新):OpenCode V2 中 ACP 工具的权限 action 名从 判定:可合——等剩余 4 个 CI test shard 转绿(目前 0 红;本地定向验证在 PR head 与当前 master 上均 38/38)。合并动作归 owner。 |
526bcb7 to
214d908
Compare
|
The latest CI run failed on
This test exercises the proxy/fold cache path ( Thanks! |
|
Update: I ran the failing test locally on Linux to verify it is unrelated to this change, and it also fails here — but with a different precondition error: Command used: This confirms the test is sensitive to nudge/filler token boundaries and is failing independently of
I do not want to modify unrelated tests in this permission fix PR. Could a maintainer please either re-run the job (in case it is timing-flaky) or temporarily skip this test so the PR can land?,timeout:60000} |
…-fixes merge The ci-fixes merge added the canonical module-map line (ref ranxianglei#6922, correct alphabetical position) while the PR branch already carried a botched duplicate (ref ranxianglei#6944, non-alphabetical position). Keep the canonical ci-fixes entry, drop the duplicate.
(ai: vllm-qwen/qwen3.8-27b) What I did this run (CI engineer, PR #6825): The 3 red test lanes all fail on the same inherited test — Per the CI-coordination policy for inherited master failures, I did not fix #2929 in this branch (it is master-level; the master control is re-calibrating the probe anchor
The test lane will turn green once the #2929 re-calibration lands in 结构化八问(中文):
判定:PR 自身变更正确,CI 红为继承性 #2929,已按政策 merge ci-fixes 并报告总控;待 #2929 重标定进 ci-fixes 后 test lane 转绿,无需本侧决策。 |
(ai: vllm-qwen/qwen3.8-27b) Re-verified live state on head No new action taken this run: the #2929 re-calibration is still not in 结构化八问(中文):
判定:CI 红为继承性 #2929(已两轮验证,签名逐字一致),分支已收敛 ci-fixes,待总控重标定落地后转绿;无需本侧新动作或决策。 |
(ai: vllm-qwen/qwen3.8-27b) Thanks for the update. A few clarifications on the CI status (verified live just now): Current state: head Why re-running won't help: this is not a flaky/timing test — it's a deterministic failure. The probe anchor Root cause & fix path: this is a pre-existing master red (confirmed by the CI master control in #4599), not caused by this PR's diff (which only touches What I've already done: merged So: no re-run needed (it would just fail again), and the fix is already in motion via the master control. The test lanes will turn green once the #2929 re-calibration lands in ci-fixes. Your PR's own changes are correct and verified — the CI red is purely the inherited #2929. |
(ai: vllm-qwen/qwen3.8-27b) Thanks for confirming the local repro — the error you're seeing ( On the two options you raised: Re-run: won't help — the test is deterministic (stale probe anchor Skip the test in this PR: I'm deliberately not doing this, for the reason you yourself stated — "I do not want to modify unrelated tests in this permission fix PR." The #2929 test is a master-level test (not part of this PR's diff). Skipping it here would (a) modify an unrelated test in a permission-fix PR, and (b) mask a real master regression that affects every PR, not just this one. The right fix is to re-calibrate the probe anchor, which is exactly what the CI master control is doing in #4599. What's actually happening: the #2929 re-calibration is being coordinated by the master control and will land in the Bottom line: your PR's changes are correct and verified (opencode-v2 tests pass, the diff is clean). The CI red is purely the inherited #2929, which is being fixed at the master level. The lanes will turn green once that fix lands in ci-fixes — no action needed from your side, and no skip needed in this PR. |
Problem
In OpenCode V2, agent permissions cannot allow billion-context ACP tools by their tool name when the tools are registered with
options.permission: "allow".For example, this intuitive config does not expose
compress:The only working pattern is the non-obvious wildcard form:
See upstream discussion: anomalyco/opencode#64051
Root cause
src/agent/opencode-v2.tsregisters bundled ACP tools and conditional manifest tools with:This
permission: "allow"option tells OpenCode that the tool does not need permission checks, but it also prevents the tool name from being used as the permissionactionin agent configs. OpenCode's permission matcher then requiresaction: "*"with the tool name asresource.Change
Remove
permission: "allow"from both registration sites so the tools use their own names as the permission action, matching built-in OpenCode tools:src/agent/opencode-v2.tsline 515 (conditional tools from manifest)src/agent/opencode-v2.tsline 558 (bundled V2_BILI_TOOLS)Tests
Updated two assertions in
tests/opencode-v2.test.tsto expectpermissionto beundefinedinstead of"allow":Local verification:
Backward compatibility
Users who currently use the
action: "*" resource: "compress"workaround will continue to work becauseaction: "*"still matches any tool name placed inresource.Users who relied on
permission: "allow"to bypass all permission checks will now need to explicitly allow the tools in their agent config, which is the intended OpenCode V2 security model.Fixes #6826