Repository navigation
fix(mcp): Keep tools inside the partition - #584
Open
dragosgheorghioiu wants to merge 2 commits into
Open
dragosgheorghioiu wants to merge 2 commits into
dragosgheorghioiu wants to merge 2 commits into
Conversation
The CLI writes the test partition only when it exits, so the long lived MCP server hid what it created from the CLI commands a test runs beside it, and concurrent calls raced on the partition file. Reload the partition before each tool call and save it after, one call at a time, so the server and the CLI see each other's work. Signed-off-by: Dragos Gheorghioiu <dragosg@unikraft.com>
instance_control and instance_logs ignored the test partition, deletes ran on every key given, and creates or edits could point at resources outside it, which the partition then adopted for teardown. Resolve every key and reference inside the partition and reject the rest, let image_get skip the partition like the CLI, and add a hidden --no-partition flag to opt out. Signed-off-by: Dragos Gheorghioiu <dragosg@unikraft.com>
dragosgheorghioiu
force-pushed
the
dragosg/feat/mcp-partition
branch
from
November 2, 2026 08:20
10f13b1 to
0fc669f
Compare
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.
Integration tests and the MCP evals run the CLI with
UNIKRAFT_X_PARTITION, which records every resource a test creates so teardown can delete it. The MCP server mostly ignored it: it wrote the partition only on exit, so a long-livedunikraft mcphid what it created from the CLI commands a test runs beside it, andinstance_control,instance_logs, deletes and references could reach resources outside the partition.The server now reloads the partition before every tool call and saves it after, one call at a time. Every key and reference is resolved inside the partition and the rest is rejected,
image_getskips it like the CLI does, and a hidden--no-partitionopts out. The partition stays an env-only, undocumented test feature, and nothing changes when the variable is unset.Stacked on #554; the evals in #555 rely on it.