Skip to content

GH-164: plugin mcp remove envelope - #167

Closed
jasonbrazeal wants to merge 3 commits into
cppalliance:masterfrom
jasonbrazeal:GH-164-plugin-mcp-remove-envelope
Closed

jasonbrazeal wants to merge 3 commits into
cppalliance:masterfrom
jasonbrazeal:GH-164-plugin-mcp-remove-envelope

Conversation

@jasonbrazeal

@jasonbrazeal jasonbrazeal commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Plugin tests can now build a direct tool call that appears to come from a
model round instead of the section's script. A call still comes from the
script by default, so existing tests keep their behavior. This lets a Pack
test output that depends on who made the call.

- `TestCall::with_caller` rebuilds the origin with `ToolCallOrigin::new`, keeping execution `plugin-test` and section `Test`. It is public within the `test-support` module and returns the call by value like `with_services`.
- `a_test_call_with_a_caller_lends_that_caller` asserts that a call built with `ToolCaller::Model` lends that caller, section `Test`, and the given tool.

Design: new surface-growth @ crates/runvil-plugin/src/testing.rs::TestCall::with_caller
  boundary: pub
Plan: vibe/2026-10-21-1-mcp-script-raw-text.md
Both MCP tools now decide output trust from who made the call. A call from
the section's own script gets the server's text marked trusted, so the
script receives it without the untrusted envelope, while a model round or
any other caller still gets untrusted text. The rendering path below the
dispatch now returns plain text, so trust is decided in one place.

- `marked` maps `ToolCaller::Script` to `ToolOutput::trusted` and every other caller, through a `_` arm, to `ToolOutput::untrusted`; `Mcp::call` reads `cx.origin().caller` once and applies it to both tools.
- `render`, `output`, `send`, `call`, `call_tool`, and the `AbortOnDrop` join handle now carry `Result<String, ToolError>` instead of `ToolOutput`, so the result module no longer sets trust.
- `invoke` now calls as `ToolCaller::Model` and still asserts untrusted output, so the existing tests keep pinning the model path; `invoke_as_script` returns the whole output for the new script-path tests.
- `a_script_calls_is_error_result_is_the_same_backend_error_as_a_models` pins that a script call's `isError` result stays the same `Backend` error with the message `it failed`.
- `lib.rs` replaces the invariant that every output is untrusted with the per-caller rule and states the same rule beside the two tool descriptions.

Design: new pure-function @ crates/plugin-mcp/src/dynamic.rs::marked deps: String,ToolCaller
Design: new surface-growth @ crates/plugin-mcp/src/dynamic.rs::Mcp::call
Design: new pure-function @ crates/plugin-mcp/tests/it/support.rs::tool_call deps: str
Plan: vibe/2026-10-21-1-mcp-script-raw-text.md
Plan: vibe/2026-10-21-1-mcp-script-raw-text.md
vinniefalco pushed a commit to vinniefalco/runvil that referenced this pull request Oct 24, 2026
close cppalliance#167

Plan: vibe/2026-10-21-1-mcp-script-raw-text.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant