Skip to content

fix(mcp): report running daemon version#1358

Open
corylanou wants to merge 1 commit into
issue-1335-make-litestream-version-on-a-dev-build-print-a-proper-versiofrom
issue-1353-mcp-litestream-version-reports-path-binary-version-not-the-r
Open

fix(mcp): report running daemon version#1358
corylanou wants to merge 1 commit into
issue-1335-make-litestream-version-on-a-dev-build-print-a-proper-versiofrom
issue-1353-mcp-litestream-version-reports-path-binary-version-not-the-r

Conversation

@corylanou

Copy link
Copy Markdown
Collaborator

Description

The MCP litestream_version tool now returns the daemon's in-process Version value instead of launching whichever litestream executable appears first on $PATH. The response preserves the existing newline formatting, and the tool description now identifies the running daemon as the version source.

A regression test removes litestream from $PATH, resolves a distinct in-process version through the machinery added by #1338, and verifies that the MCP response still reports it.

Scope: This changes only litestream_version; other MCP tools that intentionally invoke CLI operations remain unchanged.

This PR is stacked on #1338 and uses its version-resolution machinery.

Motivation and Context

The previous handler called exec.CommandContext(ctx, "litestream", "version"), so its answer described the PATH binary rather than the daemon serving the MCP request. If no PATH binary existed, the regression test failed with:

exec: "litestream": executable file not found in $PATH

Returning the already-resolved process value makes the MCP result match the running daemon regardless of how it was launched or what is installed on $PATH.

Fixes #1353

How Has This Been Tested?

  • Verified go test ./cmd/litestream -run '^TestVersionTool$' -count=1 -v failed before the production change and passed afterward.
  • go test ./... -count=1
  • go test -race ./... -count=1
  • go vet ./...
  • pre-commit run --all-files
  • go build -o bin/litestream ./cmd/litestream

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (would cause existing functionality not to work as expected)

Checklist

  • My code follows the code style of this project (go fmt, go vet)
  • I have tested my changes (go test ./...)
  • I have updated the documentation accordingly (if needed)

@github-actions

Copy link
Copy Markdown

PR Build Metrics

All clear — no issues detected

Check Status Summary
Binary size 36.95 MB (0.0 KB / 0.00%)
Dependencies No changes
Vulnerabilities None detected
Go toolchain 1.25.12 (latest)
Module graph 1240 edges (0)

Binary Size

Size Change
Base (606ac8b) 36.95 MB
PR (996b63d) 36.95 MB 0.0 KB (0.00%)

Dependency Changes

No dependency changes.

govulncheck Output

=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 1
vulnerability in modules you require, but your code doesn't appear to call these
vulnerabilities.
Use '-show verbose' for more details.

Build Info

Metric Value
Build time 33s
Go version go1.25.12
Commit 996b63d

🤖 Updated on each push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants