Skip to content

v0.4.1 — Proxy survives a daemon restart

Choose a tag to compare

@kolkov kolkov released this 19 Oct 12:08
· 3 commits to main since this release

v0.4.1 — Proxy survives a daemon restart

Fixed

  • Proxy follows a replaced daemon. Before this release, Proxy read the daemon's port once. After a restart, a crash or an idle shutdown, the next request failed and Proxy returned, so every MCP client had to reconnect by hand. The lease was not re-attached either, so the new daemon saw zero agents while clients were still open. Now:
    • when its lease drops, the proxy looks for a daemon in the PID file for up to Config.Timeout and re-attaches. It never starts one there: Stop, Hold and the idle timer are not undone by an idle client;
    • a request whose dial failed, or that a daemon answered with 401 (another daemon on the old port), is sent once more after reconnecting (EnsureRunning when Config.Binary is set, otherwise the PID file);
    • a request that failed after it was sent is answered with a JSON-RPC error for its id (-32603, "daemon unavailable: …") and is never sent again, because it may have run. Notifications get no answer;
    • Proxy returns only when its context ends, stdin ends or fails, or stdout fails.

No API changes.

go get github.com/grpmsoft/daemon@v0.4.1

Full Changelog: v0.4.0...v0.4.1