Skip to content

Commit 47554c1

Browse files
committed
release: v0.1.1
- mcp: thread the binary version into Serve so MCP serverInfo.version matches the release tag automatically (no more hard-coded constant) - changelog: 0.1.1 entry
1 parent a50b817 commit 47554c1

5 files changed

Lines changed: 29 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ All notable changes to this project are documented here. The format is based on
44
[Keep a Changelog](https://keepachangelog.com/), and the project aims to follow
55
[Semantic Versioning](https://semver.org/).
66

7+
## [0.1.1] - 2026-06-16
8+
9+
### Changed
10+
- `mcp.Serve` now takes the agentenv binary's resolved release tag and
11+
reports it in the MCP `initialize` handshake's `serverInfo.version`
12+
(previously hard-coded to `"0.1.0"`). Single source of truth — bumping
13+
the next tag no longer needs a code edit.
14+
15+
### Fixed
16+
- `gofmt` formatting on three files (`internal/cli/ctl.go`,
17+
`internal/mcp/server.go`, `internal/mcp/server_test.go`); CI was red
18+
on the first push.
19+
- `staticcheck` ST1005: dropped trailing `...` from two `tournament`
20+
usage error strings (illustrative, not literal).
21+
722
## [0.1.0] - 2026-06-16
823

924
First public release. The whole rewindable-environment story end-to-end —
@@ -103,4 +118,5 @@ drive rollback natively.
103118
incremental checkout (copy only the diff); `AGENTENV_IGNORE` excludes ephemeral
104119
paths; auto-snapshot labels list the changed files.
105120

121+
[0.1.1]: https://github.com/css521/agentenv/releases/tag/v0.1.1
106122
[0.1.0]: https://github.com/css521/agentenv/releases/tag/v0.1.0

internal/cli/commands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ import (
2727
//
2828
// Sockets are resolved via --socket / AGENTENV_SOCKET / AGENTENV_ROOT in that
2929
// order. Cancelled by SIGINT/SIGTERM (typical: Claude Code closes stdin).
30-
func cmdMCP(args []string) error {
30+
func cmdMCP(args []string, version string) error {
3131
sock := daemonclient.SocketPath(flagValue(args, "--socket"))
3232
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
3333
defer cancel()
34-
return mcp.Serve(ctx, sock)
34+
return mcp.Serve(ctx, sock, version)
3535
}
3636

3737
// cmdInit creates the root node from one of two sources, exactly one of which

internal/cli/run.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ func Run(version string) int {
4444
// MCP server (stdio JSON-RPC) — bridges Claude Code / other MCP hosts
4545
// to a running daemon. No repo/lock here either: it forwards every
4646
// call as a fresh socket round-trip, so the daemon owns concurrency.
47-
if err := cmdMCP(rest); err != nil {
47+
// `version` flows from main.resolveVersion → the MCP initialize
48+
// handshake's serverInfo.version, so hosts log which build they're
49+
// talking to.
50+
if err := cmdMCP(rest, version); err != nil {
4851
fmt.Fprintln(os.Stderr, "error:", err)
4952
return 1
5053
}

internal/mcp/server.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ import (
3535
"github.com/css521/agentenv/internal/protocol"
3636
)
3737

38-
// version reported to clients in the initialize handshake. Bumped alongside
39-
// the agentenv release tag.
40-
const serverVersion = "0.1.0"
41-
4238
// emptyArgs is the input type for the zero-arg tools (head, log, branches).
4339
// The SDK still infers a JSON Schema object for it; empty struct → "no
4440
// properties, no required" — exactly what we want.
@@ -55,11 +51,14 @@ type diffArgs struct {
5551

5652
// Serve runs the MCP server on stdin/stdout (the transport Claude Code uses
5753
// when it spawns this binary), bridging tool calls to the agentenv daemon's
58-
// unix socket. Returns when stdin EOFs or ctx is cancelled.
59-
func Serve(ctx context.Context, sock string) error {
54+
// unix socket. The `version` is reported to clients in the initialize
55+
// handshake — pass the agentenv binary's resolved release tag (main.go's
56+
// resolveVersion) so MCP hosts can log which build they connected to.
57+
// Returns when stdin EOFs or ctx is cancelled.
58+
func Serve(ctx context.Context, sock, version string) error {
6059
server := mcp.NewServer(&mcp.Implementation{
6160
Name: "agentenv",
62-
Version: serverVersion,
61+
Version: version,
6362
}, nil)
6463
register(server, sock)
6564
err := server.Run(ctx, &mcp.StdioTransport{})

internal/mcp/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (d *fakeDaemon) requests() []protocol.Request {
100100
// Claude Code would drive us, minus the stdio framing.
101101
func startMCP(t *testing.T, sock string) *mcpsdk.ClientSession {
102102
t.Helper()
103-
server := mcpsdk.NewServer(&mcpsdk.Implementation{Name: "agentenv", Version: serverVersion}, nil)
103+
server := mcpsdk.NewServer(&mcpsdk.Implementation{Name: "agentenv", Version: "test"}, nil)
104104
register(server, sock)
105105

106106
t1, t2 := mcpsdk.NewInMemoryTransports()

0 commit comments

Comments
 (0)