Daily Edition Sources +4

Builder Work: When an MCP Session Dies, Rebuild the Whole Registry

Crush’s agent-attributed MCP recovery work teaches a hard-earned rule: a connection is not back until every capability it advertises is back too.

A rough marker diagram shows a failed MCP session, stale tools/prompts/resources being cleared, one locked renewal path, and a rebuilt registry with matching capability counts.
Diagram Punka reconnection is trustworthy only when the advertised capability surface is whole again.
repo charmbracelet/crush evidence
4 source signals 1 repo 2 linked commits
Evidence: 2 linked commits / July 18, 2026 / Daily Edition
Open Edition Evidence below

A public Crush commit ends with an unusually direct receipt: “Generated with Crush.” That proves a coding agent participated in the work, but the interesting evidence sits in the Go beneath it. The change repairs a dangerous kind of half-recovery in an MCP client: a session can reconnect while the agent’s registry still tells a different story about the tools, prompts, and resources it can use.

The repo evidence

In internal/agent/tools/mcp/init.go, Crush first makes initialization intentional. A coordinator created outside application startup no longer waits forever for a setup phase that will never begin. More importantly, a dead MCP session is no longer renewed by a crowd of callers. The code gives each server a renewal mutex, lets the first caller rebuild, then makes later callers re-check and reuse the healthy replacement.

The recovery path also clears every stale registry on failure—not only tools, but prompts and resources—and then re-lists all three on the new session before reporting fresh counts. The paired lifecycle tests exercise that symmetry. One test sets up eight callers against a dead session and requires exactly one replacement; another requires the renewed session’s tools, prompts, resources, and reported counts to agree.

The transferable building skill: recover the contract, not the socket

Builders can reuse a simple discipline here: name the state your system advertises, clear it together when the backing connection fails, and restore it together before declaring success. Treat the lock, registry, and status count as one recovery boundary. Then write the test that makes concurrent callers prove they received the same rebuilt state rather than merely a non-error return value.

The limit

The commit and tests establish an intended implementation, not a production incident or a measured reliability gain. Its “Generated with Crush” line is public coding-agent-use proof, not a complete record of who designed, reviewed, or authored each line. The next useful receipt would be a release note or a real server-recovery report showing whether this symmetry holds outside the in-memory test harness.

Evidence Trail

Receipts below the story

The article above is the public narrative. This section keeps the source trail and limits on the same page.

Edition
DateJuly 18, 2026
LaneDaily Edition
Confidence78%
Sources4
Reposcharmbracelet/crush

Primary Evidence

Evidence Limits

  • The commit’s coding-agent attribution does not establish sole authorship, a particular review process, or the complete human/agent division of labor.
  • The repository and tests prove the intended implementation and its simulated concurrency behavior, not a production incident, measured uptime improvement, or universal MCP-server compatibility.
Letters & Corrections

Send a note to the desk

Corrections, missing context, or a follow-up lead.