Skip to content

Say when zerograph is missing or older than the machine's, and stand down beside a repo hook - #267

Merged
devmaxxx merged 5 commits into
mainfrom
feat/missing-binary-notice
Oct 19, 2026
Merged

devmaxxx merged 5 commits into
mainfrom
feat/missing-binary-notice

Conversation

@devmaxxx

Copy link
Copy Markdown
Owner

Summary

  • Missing binary. In a repository that asked for zerograph (a zerograph.toml, a built index, or an older repo hook) and on a machine with no zerograph the hook can run, SessionStart now shows ▲ zerograph is not installed — this repository uses it / npm i -g zerograph · pnpm add -g zerograph, and tells the agent the graph tools are unavailable. Before, a teammate who got the plugin from a repository's project settings saw nothing. A repository that asked for nothing stays silent. Codex gets the context line only.
  • Stand-down. The plugin already skipped each event and matcher a repository's own 0.6.x hook handles; it now also looks at the main worktree's hook and settings, requires the two to be in the same checkout, and at SessionStart still shows the missing-binary and update notices while leaving the brief, serve and update to the repo hook.
  • Stale session. The MCP launcher passes the server's output through line by line, and while the binary on disk reports another release than the one serving, every tool result starts with zerograph was updated to X (this session runs Y) — restart the session or run /reload-plugins. It re-runs --version only when the binary file changed, and never stops or restarts anything.

Test plan

  • node tests from ci.yml: 95 pass (new: missing binary opted-in / not opted-in / found, stand-down from a linked worktree, stale-server line)
  • claude plugin test agent/claude-code: 28 pass
  • SessionStart against beauty-crm with no zerograph on PATH renders the notice
  • /reload-plugins restarts a plugin's MCP server (not verified; the line also says "restart the session")

…talled

A teammate who gets the plugin from a repository's project settings but has
no zerograph binary got a silent SessionStart and never learned why. In a
checkout that asked for an index, built or not, with no binary to run, the
hook now shows the person the update notice's style of message, naming the
npm and pnpm install commands, and tells the agent in one context line that
the graph tools are unavailable until it is installed. A repository that
never asked stays silent. Codex gets the context line only.
…ph hook

The plugin's hook looked for a 0.6.x repository hook only under
CLAUDE_PROJECT_DIR, or the cwd without it, so a linked worktree whose
session runs the main worktree's settings answered every event a second
time. It now looks in the project directory, the checkout and the main
worktree, and counts one only where the script and the settings entries
that run it sit together. Standing down is still per event and matcher.

At SessionStart a stand-down keeps the not-installed and newer-release
notices, which the old hook never shows, and drops the brief, serve and
update.
…machine has

A session keeps the MCP server it started with, so after a global upgrade
the old binary goes on serving and writing a store the new one owns, and a
plugin cannot restart it. mcp.mjs now asks the binary its version at start
and reads the server's stdout line by line; on each tool result it stats
the file the binary resolves to, asks the version again only when that
file moved, and while the installed release differs from the serving one
puts one line first in every tool result: zerograph was updated to X (this
session runs Y), restart the session or run /reload-plugins. Nothing is
stopped or restarted, and every other line passes through unchanged. The
launcher now exits once the server's stdout has closed, so the last result
is never cut.

The hook cannot see the serving release, and the plugin version in the
marketplace cache is no reliable marker of what a session loaded, so
neither is compared.
…unt a checkout's own index

The 0.6.x entries run the script under $CLAUDE_PROJECT_DIR, so a main
worktree's copy, or a nested clone's the session cd'd into, answers nothing
in this session. Standing down on either left a worktree whose branch
retired the hook with no zerograph at all. The plugin now stands down only
when the session's project holds both the script and the entry, as before
this branch.

A main checkout opted in by nothing but its own built index heard nothing
about a missing binary, since optedIn counted an index only in a linked
worktree's main. It counts the checkout's own now; its other callers run
only where the checkout has no index, so they are unchanged.
Cargo.toml, Cargo.lock, both plugin manifests, the marketplace ref, the
npm package, the status line in docs/commands.md and the Codex install
command move to 0.7.2. docs/releases/0.7.2.md names the not-installed
notice, the stale-session line in MCP results, the stand-down that now
counts only the session project's own 0.6.x hook, and the checkout's own
index opting it in.
@devmaxxx
devmaxxx merged commit 01581ca into main Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant