Skip to content

fix(orchestrator): path hashing + system_status version emit#7

Open
evannadeau wants to merge 2 commits into
SpawnBox-dev:mainfrom
evannadeau:fix/path-hashing-leading-dash
Open

fix(orchestrator): path hashing + system_status version emit#7
evannadeau wants to merge 2 commits into
SpawnBox-dev:mainfrom
evannadeau:fix/path-hashing-leading-dash

Conversation

@evannadeau
Copy link
Copy Markdown

Summary

Two independent latent bugs in plugins/orchestrator/mcp/server.ts. Bundled because both are one-line fixes to the same file with the same bun run build cost.

1. Path hashing — leading-dash strip broke the JSONL filewatcher on POSIX (cab2a57)

projectHash mirrors how Claude Code names per-project directories under ~/.claude/projects/. CC keeps the leading dash that comes from POSIX absolute paths (/home/foo-home-foo). The previous .replace(/^-+/, "") stripped that dash, producing home-foo instead of -home-foo and silently pointing the agent-channel JSONL filewatcher at a directory that doesn't exist.

The MCP server stayed up and tools answered normally, but no cross-session channel events were observed (and downstream features that depend on the watcher quietly broke). Diagnostic: absence of offsets-<id8>.json files in <project>/.orchestrator-state/agent-channel/ despite live JSONLs in ~/.claude/projects/-<...>.

Fix: drop the strip. The Windows case (C:\fooC--foo) just produces a cosmetic double-dash and remains harmless — that was the original reason for the strip, but the cost on POSIX (silent feature death) outweighs the cosmetic cleanup on Windows.

2. system_status emitted hardcoded version string (93c5da6)

system_status reported a literal 0.30.28 instead of ${PLUGIN_VERSION}. The 0.30.31 cleanup (see the comment at mcp/server.ts:32-37) consolidated the version source to read from package.json at module load specifically so it wouldn't be "hardcoded in multiple spots and forgotten on every other version bump" — but the system_status line at mcp/server.ts:655 was missed during that consolidation. Every bump since (0.30.32 → 0.30.38) shipped with the line still saying 0.30.28.

Concrete symptom: running an up-to-date install and calling system_status returns **Version**: orchestrator MCP server **0.30.28** regardless of the actual package version. The startup banner uses PLUGIN_VERSION directly and reports correctly — only this one line was wrong.

Fix: use the existing PLUGIN_VERSION constant.

Files changed

  • plugins/orchestrator/mcp/server.ts — 2 single-line edits (line 2183 path-hashing, line 655 version emit)
  • plugins/orchestrator/dist/server.js — rebuilt via bun run build

Tested

  • bun run typecheck — clean
  • bun test — 516 pass / 0 fail / 38 files / 1207 assertions
  • Confirmed dist/server.js no longer contains the 0.30.28 literal in the system_status output line; build output is byte-stable across repeated bun run build runs against the same source.

Test plan

  • POSIX install: confirm ~/.claude/projects/-<...> is scanned — offsets-*.json files appear in <project>/.orchestrator-state/agent-channel/ and @SA-<id8> channel addresses deliver to peer sessions.
  • Windows install: confirm path-hashing still produces a valid directory name for C:\foo inputs (cosmetic double-dash C--foo expected).
  • Any install: confirm system_status reports the package.json version, not the hardcoded 0.30.28.

🤖 Generated with Claude Code

evannadeau and others added 2 commits May 13, 2026 18:50
…ewatcher

projectHash mirrors how Claude Code names per-project dirs under
~/.claude/projects/. CC keeps the leading dash that comes from POSIX
absolute paths (/home/foo -> -home-foo). The previous .replace(/^-+/, "")
stripped that dash, producing 'home-foo' instead of '-home-foo' and
silently pointing the agent-channel JSONL filewatcher at a directory
that doesn't exist.

The MCP server stayed up and tools answered, but no cross-session
channel events were observed (and downstream features that depend on
the watcher quietly broke).

Reference: anti_pattern 6dfc7ae1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…d literal)

The system_status output line hardcoded "0.30.28" instead of using the
${PLUGIN_VERSION} constant that's already read from package.json at module
load. The 0.30.31 cleanup (see lines 32-37 of mcp/server.ts) consolidated
the version source specifically so it wouldn't be "hardcoded in multiple
spots and forgotten on every other version bump" — but this single line at
mcp/server.ts:655 was missed during that consolidation, and every bump
since (0.30.32 → 0.30.38) shipped with the line still saying 0.30.28.

Concrete symptom: running an up-to-date plugin and calling system_status
returns "**Version**: orchestrator MCP server **0.30.28**" regardless of
the actual package.json version. The startup banner (which uses
PLUGIN_VERSION directly) reports correctly — only this line was wrong.

Tested: bun run typecheck clean, bun test 516 pass / 0 fail, dist/server.js
rebuilt via bun run build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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