Skip to content

fix(mcp): re-enable list_probes now that the BTrace client no longer exits - #11

Merged
jbachorik merged 2 commits into
mainfrom
feat/mcp_list_probes
Oct 5, 2026
Merged

jbachorik merged 2 commits into
mainfrom
feat/mcp_list_probes

Conversation

@jbachorik

@jbachorik jbachorik commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What & why

list_probes was effectively withdrawn: the btrace-mcp-operations skill told agents not to call it and its e2e case was @Disabled, because Client.connectAndListProbes called System.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. ListProbesHandler creates a fresh client per call, so sessions registered in ClientManager are unaffected.

This PR:

  • re-enables listProbesReportsTheRunningProbe in McpServerE2ETest;
  • drops the "list_probes case is disabled" caveat from mcp/README.md;
  • lists list_probes again in the btrace-mcp-operations skill and documents its real semantics: it reports only probes detached with detach_probe that are still running (the agent filters on RemoteClient.isDisconnected()), so it finds probes left by earlier sessions, not ones still attached to the current session.
  • steers the other skills to use list_probes again: btrace-mcp-operations calls it before deploying and after detach_probe, and says that the MCP server cannot stop a listed probe (the operator reconnects with btrace -r <probe-id> <PID>); btrace-probe-lifecycle names the MCP equivalent of btrace -lp and fixes its description; perf-engineer uses it for the existing-session check;
  • adds eval coverage: mcp-local-probe now requires list_probes, and the new mcp-leftover-probe case covers finding a probe left behind by an earlier session.

How verified

Against a BTrace JAR built from develop @ 2fdc87c7 (contains #963):

Gate Result
./gradlew :btrace-dist:btraceJar (btrace) BUILD SUCCESSFUL
BTRACE_JAR=… ./gradlew check e2eTest unit 17 passed, 0 failed; e2e 10 passed, 0 skipped, 0 failed
BTRACE_SOURCE_DIR=… scripts/validate-marketplace.sh Marketplace validation passed (eval corpus 10 cases, 5 plugins, 31 skills; 2 warnings pre-existing on main).

Coverage notes

The e2e case deploys a probe, detaches it, then calls list_probes and asserts the probe is reported and the MCP server is still alive; the following targetSurvivesTheWholeSession confirms the server survives the rest of the run.

Not verified / known limitations

Breaking changes / migration

None.

🤖 Generated with Claude Code

jbachorik and others added 2 commits October 5, 2026 08:46
…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>
@jbachorik
jbachorik merged commit 39b7893 into main Oct 5, 2026
4 checks passed
@jbachorik
jbachorik deleted the feat/mcp_list_probes branch October 5, 2026 09:53
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