Repository navigation
mcpx v2 plugin: permission gate for daemon_select (#1858 item (2)) - #3018
Conversation
…2), #2841) Item (2) of the #1858 SET-REMAINDER: replace v1 daemon_select's dead permission.ask with the v2 permission domain (verified against the pinned promise/permission.ts). - v2/permission.ts: DAEMON_SELECT_ACTION, the PermissionDomainLike / PermissionEvaluationLike slices, and evaluateMcpxPermission — the evaluate hook that keeps mcpx_daemon_select at effect "ask" so a blanket allow rule can never apply a daemon choice silently; a computed deny and all other actions pass through unchanged. - tools.ts: daemon_select asserts through the wired gate before applying, with v1's ask payload (resources/save = target key, metadata = daemon/socket/config/started/version/servers/sessions/ remember/stopOthers/others). A rejection throws, so nothing is applied. With no permission domain wired the tool refuses and says why — the silent-apply path is gone. Header + description updated. - index.ts: McpxV2Context gains the optional permission slice; setup registers the evaluate hook and wires assert into the tool runtime. - Tests (bun): hook unit tests; daemon_select assert payload + rejection-applies-nothing + no-gate refusal; setup registration. v2 suite: 31 pass. Items (1), (3), (4), (5) of #2841 remain, in the recorded order.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67c3d6c4dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The evaluate-hook registration was fire-and-forget while assertPermission was wired unconditionally: if registration rejected, a blanket allow rule could let permission.assert resolve without a prompt and daemon_select would apply an unconfirmed choice (including stopOthers shutdowns). wirePermissionGate now awaits registration and hands out the assert callback only on success; a failed registration leaves daemon_select refusing, as a host with no permission domain already did. Regression tests cover success, rejection, and no-domain.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Item (2) of the #1858 SET-REMAINDER, tracked by #2841 (queue task 3997). Items are worked one at a time, own PR each; this is the first in the recorded order (2) → (1) → (4) → (3) → (5).
What
Replaces v1 daemon_select's dead
permission.askwith the v2 permission domain, verified against the pinned source (packages/plugin/src/promise/permission.ts, core evaluation pipeline inpackages/core/src/permission.ts, host policy-plugin precedent inpackages/core/src/config/plugin/policy.ts):evaluateMcpxPermission— thepermission.hook("evaluate")handler. It keeps themcpx_daemon_selectaction at effect"ask", so a blanket allow rule can never apply a daemon choice silently; a computed deny and every other action pass through unchanged.daemon_selectnow asserts through the wired gate before applying, with v1's ask payload (resources/save= target key; metadata = daemon, socket, config, started, version, servers, sessions, remember, stopOthers, others). A rejection throws out ofassert, so nothing is applied. With no permission domain wired, the tool refuses and says why — the silent-apply path is gone. Header and tool description updated to match.ctx.permission.assertinto the tool runtime.Tests
bun test plugin/opencode/v2/— 31 pass (was 27): hook unit tests (ask-forced / deny untouched / other actions untouched), daemon_select assert payload + rejection-applies-nothing + no-gate refusal, setup hook registration.Remaining on #2841
(1) mcp.transform, (4) ctx.generate.text, (3) TUI select() picker, (5) v1 retirement — each its own PR, in that order.
Refs #1858, #2841
Need help on this PR? Tag
@codesmith-botwith what you need.