Repository navigation
fix(mcp): re-enable list_probes now that the BTrace client no longer exits - #11
Merged
Merged
Conversation
…exits list_probes was steered away from and its e2e case disabled because Client.connectAndListProbes called System.exit after the reply, killing the MCP server and every open probe session. btraceio/btrace#963 removed the exit: the client now returns normally and closes its connection, and ListProbesHandler uses a fresh client per call, so registered sessions are unaffected. Re-enable the e2e case, drop the README caveat, and let the MCP operations skill recommend list_probes again, documenting that it only reports probes detached with detach_probe that are still running. Verified against a BTrace JAR built from develop (2fdc87c7): ./gradlew check e2eTest -> unit 17 passed, e2e 10 passed, 0 skipped, including listProbesReportsTheRunningProbe and targetSurvivesTheWholeSession; scripts/validate-marketplace.sh passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With list_probes usable again, the skills should actually use it rather than merely stop forbidding it: - btrace-mcp-operations: call list_probes before deploying and after detach_probe; explain that the MCP server cannot stop a listed probe and that the operator reconnects with btrace -r; prefer exit_probe over detach_probe. - btrace-probe-lifecycle: name the MCP equivalent of btrace -lp and correct its description (it lists detached probes, not all active). - perf-engineer: use list_probes / btrace -lp for the existing-BTrace- session check before attaching. - evals: require list_probes in mcp-local-probe and add an mcp-leftover-probe case. Verified: scripts/validate-marketplace.sh passes (eval corpus 10 cases, 5 plugins, 31 skills); its two warnings are pre-existing on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What & why
list_probeswas effectively withdrawn: thebtrace-mcp-operationsskill told agents not to call it and its e2e case was@Disabled, becauseClient.connectAndListProbescalledSystem.exit(0)after the reply, killing the MCP server and every open probe session.btraceio/btrace#963 removed that exit — the client now returns normally and closes its connection.
ListProbesHandlercreates a fresh client per call, so sessions registered inClientManagerare unaffected.This PR:
listProbesReportsTheRunningProbeinMcpServerE2ETest;mcp/README.md;list_probesagain in thebtrace-mcp-operationsskill and documents its real semantics: it reports only probes detached withdetach_probethat are still running (the agent filters onRemoteClient.isDisconnected()), so it finds probes left by earlier sessions, not ones still attached to the current session.list_probesagain:btrace-mcp-operationscalls it before deploying and afterdetach_probe, and says that the MCP server cannot stop a listed probe (the operator reconnects withbtrace -r <probe-id> <PID>);btrace-probe-lifecyclenames the MCP equivalent ofbtrace -lpand fixes its description;perf-engineeruses it for the existing-session check;mcp-local-probenow requireslist_probes, and the newmcp-leftover-probecase covers finding a probe left behind by an earlier session.How verified
Against a BTrace JAR built from
develop@2fdc87c7(contains #963):./gradlew :btrace-dist:btraceJar(btrace)BTRACE_JAR=… ./gradlew check e2eTestBTRACE_SOURCE_DIR=… scripts/validate-marketplace.shmain).Coverage notes
The e2e case deploys a probe, detaches it, then calls
list_probesand asserts the probe is reported and the MCP server is still alive; the followingtargetSurvivesTheWholeSessionconfirms the server survives the rest of the run.Not verified / known limitations
io.btrace:btrace:3.0.0-SNAPSHOTcontaining fix(client): stop Client from calling System.exit so it is safe as a library btrace#963; an older resolved snapshot would still exit onlist_probes. Themcp-e2eworkflow must build BTrace at a ref that includes #963.Breaking changes / migration
None.
🤖 Generated with Claude Code