You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(extension): MCP server reads --workspace flag; live hooks state; drop footer Reindex/Reset
Three issues from real Cursor install testing:
**1. axme_context resolves to /home/$USER instead of the workspace.**
When Cursor spawns the MCP server via cursor.mcp.registerServer, the cwd
it picks is the user's home directory — not the workspace root — so the
server's process.cwd() defaults defaultProjectPath to /home/$USER. Calls
to axme_context without an explicit project_path then look up
`.axme-code/` in the wrong place and report "project not initialised",
even after a successful setup in the real workspace. The user's diagnostic
made this obvious: "STORAGE ROOT: /home/georgeb/.axme-code, которого не
существует" while the project's `.axme-code/` was sitting in /tmp/.
Fix: src/server.ts now resolves its root in this order:
1. --workspace <abs> CLI flag (passed by the Cursor extension at
registration time — see registerMcpServer)
2. AXME_WORKSPACE env var (escape hatch for hand-spawned servers)
3. process.cwd() (preserves Claude Code CLI behaviour where the binary
is spawned from the project root and cwd already points there)
Extension passes workspaceFolders[0].uri.fsPath to registerMcpServer so
the server's defaultProjectPath always matches what the user thinks is
"the project". Verified via stdio smoke test: server reports
`Project: /tmp/axme-cwd-test` after --workspace /tmp/axme-cwd-test.
**2. Sidebar showed "hooks missing" when they were installed.**
The activation ActivationReport's hooks-step flag captures one moment in
time. After reinstall / reset cycles the sidebar's `S.hooksOk` could
stay stale until the next window reload. Added extension/src/hooks-state.ts
which reads ~/.cursor/hooks.json on demand and confirms preToolUse /
postToolUse / sessionEnd entries each contain `axme-code`. Sidebar pushes
this live value both on attach and on every resolveWebviewView, so the
report's snapshot is no longer the source of truth.
**3. Reindex / Reset buttons in the sidebar footer fired without obvious
feedback** and (per user feedback) were doing destructive-ish things from
a place the user expected to be lightweight monitoring. Removed both
from the sidebar footer. Healthcheck stays — it's a read-only webview.
The commands are still registered and reachable via the Command Palette
("AXME: Reindex semantic search" / "AXME: Reset"), where the modal
confirmation flow makes their effect more obviously deliberate.
Verified: npm test → 608 / 608 pass; self-test 6 / 6 pass on rebuilt
bundled binary; vsce package → 533 KB .vsix.
#!axme pr=none repo=AxmeAI/axme-code
0 commit comments