Repository navigation
feat(mcp): add stop_detached_probe to stop a listed probe by id - #12
Merged
Merged
Conversation
Merged
13 of 16 tasks
Contributor
Author
|
The failing |
jbachorik
marked this pull request as ready for review
October 5, 2026 09:55
list_probes reports probes a client detached from, but the server had no way to act on them: exit_probe and detach_probe only reach probes the current server session deployed. stop_detached_probe takes a probe id (or a whole list_probes line), reconnects through the new BTrace Client.connectAndExitProbe and stops the probe. The call is bounded by a 30 s timeout that closes the client, so an unresponsive agent cannot hang the MCP request. Requires a BTrace build with Client.connectAndExitProbe and the agent fix that keeps detached probes reconnectable. Verified against a BTrace JAR built from that branch: ./gradlew check e2eTest -> unit 19 passed, e2e 11 passed (new stopDetachedProbeRemovesTheListedProbe: probe stops firing, drops off list_probes, a second stop errors). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MCP operations and probe lifecycle skills now hand a probe found by list_probes to stop_detached_probe (after the operator confirms it is no longer needed) instead of to the CLI, and document the CLI equivalent btrace -r <probe-id> exit <PID>. The mcp-leftover-probe eval now expects stop_detached_probe. Verified: scripts/validate-marketplace.sh passes (10 eval cases, 5 plugins, 31 skills). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jbachorik
force-pushed
the
feat/mcp_stop_detached_probe
branch
from
October 5, 2026 09:57
6539ffa to
3050be3
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.
What & why
list_probes(re-enabled in #11) reports probes a client detached from, but the server couldn't act on them:exit_probeanddetach_probeonly reach probes the current server session deployed. This addsstop_detached_probe(pid,probe_id, optionalport). It reconnects to the probe through BTrace's new publicClient.connectAndExitProbeand stops it.probe_idaccepts a bare id or a wholelist_probesline (1: <id> [<class>]).btrace-mcp-operationsandbtrace-probe-lifecyclenow hand a probe found bylist_probestostop_detached_probe, after the operator confirms it's no longer needed. Themcp-leftover-probeeval expects the new tool.Building this exposed that reconnecting to a detached probe never worked in the BTrace agent (the CLI's
-r <id> exithung the same way). That fix and the client API are in btraceio/btrace#967.How verified
Against a BTrace JAR built from the btraceio/btrace#967 branch:
./gradlew check e2eTest(BTRACE_JAR=…)scripts/validate-marketplace.shBefore the agent fix, the new e2e case hung for 90 s on the stop call; that's how the agent bug was found.
Coverage notes
stopDetachedProbeRemovesTheListedProbe: takes the detached probe's line fromlist_probes, stops it, requires its@Exportcounter to freeze, checks the probe drops offlist_probes, and checks a second stop is an error.probe_iderror; the reflective adapter call; parsing alist_probesline; and the timeout path (the client gets closed and an error is returned).Not verified / known limitations
mcp-e2eworkflow builds BTrace's default branch, which won't haveClient.connectAndExitProbebefore that; until then the e2e job is expected to fail withNoSuchMethodException.Breaking changes / migration
None. This adds a tool.
Links
main.🤖 Generated with Claude Code