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
Three bugs from the v0.0.3 install-test session, plus the architectural
fix the user proposed (agent acts as per-project setup gatekeeper).
**Bug F — KbWatcher silent no-op when .axme-code/ created mid-session.**
attach() returned early if the directory didn't exist at activation time,
so counters never tickled live during the very first cooperative-setup
flow. Fix: split the watcher into two phases. If .axme-code/ exists, run
the steady-state content watcher as before. If not, install a root
watcher on the workspace folder that fires once when .axme-code/ appears
— at that point we tear it down, swap in the content watcher, and emit
both a fresh count and an optional onCreated callback so callers can
react to the transition.
**Bug G — walkthrough step 2 never auto-completes in the cooperative
path.** Step 2's completion event is `onContext:axme.workspaceInitialized`,
and that context flag was only set in `activate()` (snapshot) and in
`runSetup()` after a successful API-key spawn. The cooperative path
(agent inline) writes .axme-code/ from the chat, never touching
runSetup, so the context stayed `false` forever. Fix: the sidebar now
passes an onCreated callback to KbWatcher.attach() which executes
`setContext("axme.workspaceInitialized", true)` AND pushes `setupDone:
true` to the webview — so the moment the agent's first save lands, the
walkthrough page checks the step off and the sidebar pill flips to
"ready".
**Agent-as-setup-gatekeeper.** AXME is per-repo (one .axme-code/ per
project), but until now nothing told the user when they opened a fresh
repo that setup hadn't run there. The sidebar's "setup required" pill is
easy to miss. User suggested: have the agent itself say so on session
start. Implementation: buildInstructions() now checks
existsSync(<project>/.axme-code) at server startup and, when absent,
appends a HIGHEST-PRIORITY directive telling the agent to halt all other
work and ask the user (in their language) whether to perform setup
cooperatively right there in the chat — including the exact MCP tools to
call (axme_oracle, axme_save_decision, axme_save_memory,
axme_update_safety). Cursor passes our instructions to the agent on
every new chat, so this fires automatically per-project, no UI plumbing
needed.
**Setup-controller auth gate.** [Run setup (with API key)] used to spawn
`axme-code setup` blindly; the CLI's TTY-only auth prompt skipped
silently under spawn() and then the first LLM scanner failed with an
opaque exit code. Now runSetup() probes detectCurrentMode() first and,
if no credential is saved, runs ensureAuditorAuth() (the proper modal
paste-key flow) BEFORE spawning. Cancelling the auth modal aborts the
spawn cleanly with a warning toast.
**Cooperative prompt UX.** deliverChatPrompt previously surfaced a
corner toast that users could not see. Replaced with a modal info
message that requires a [Got it] click before continuing, so there is no
scenario where the user clicks [Ask agent to setup] and wonders if
anything happened. Walkthrough setup step + setup.md rewritten to lead
with the cooperative path (recommended) and demote the API-key path to a
clearly-labelled alternative.
Verified: npm test → 608 / 608 pass; self-test 6 / 6 pass; the new
setup-gate instruction fires only when .axme-code/ is absent (smoke-
tested against /tmp/axme-bare2 vs /tmp/axme-bare3).
#!axme pr=none repo=AxmeAI/axme-code
Copy file name to clipboardExpand all lines: extension/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@
105
105
{
106
106
"id": "axme.step.setup",
107
107
"title": "Set up the workspace",
108
-
"description": "Run setup once per project. The recommended path is cooperative — the agent reads your repo and saves architecture decisions / patterns / safety rules through MCP tools, on your Cursor subscription, no separate billing.\n[Ask agent to set up (cooperative)](command:axme.askAgentSetup)\n[Set up with API key (background)](command:axme.setup)",
108
+
"description": "Run setup once per project. Recommended: ask the agent in chat — no extra API key needed, everything runs on your Cursor subscription.\n\n**How**: click the button below, the prompt copies to your clipboard. Then open or focus a Cursor chat (Cmd/Ctrl+L), paste (Cmd/Ctrl+V), hit Enter. The agent scans the repo and saves architecture decisions / patterns / safety rules through MCP tools.\n\n[Copy setup prompt → paste in chat](command:axme.askAgentSetup)\n\nAlternative (uses your own API key, billed separately):\n[Run setup with API key](command:axme.setup)",
Copy file name to clipboardExpand all lines: src/server.ts
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,35 @@ function buildInstructions(): string {
235
235
}else{
236
236
parts.push("Call axme_context at session start. It returns compact meta and instructions to call axme_oracle, axme_decisions, axme_memories in parallel.");
237
237
}
238
+
239
+
// Per-project setup gate: AXME is configured ONCE per repo (writes
240
+
// .axme-code/ at the project root). When the agent lands in a fresh repo
241
+
// and the storage is absent, axme_context returns "project not
242
+
// initialised" — easy for the agent to ignore. Make it impossible to
243
+
// miss by stating the obligation up-front in the instructions block so
244
+
// the agent reads it BEFORE the first axme_context call.
"PROJECT SETUP REQUIRED (HIGHEST PRIORITY): this project has no "+
249
+
".axme-code/ directory — AXME setup has never run here. BEFORE "+
250
+
"doing anything else (before answering the user's actual question, "+
251
+
"before reading project files), tell the user verbatim in their "+
252
+
"language: \"AXME knowledge base is not initialized for this "+
253
+
"project. I can run setup now — it scans the repo and saves "+
254
+
"architecture decisions, patterns, and safety rules into "+
255
+
".axme-code/ so future sessions auto-load context. Want me to do "+
256
+
"it?\" If the user agrees (any affirmative in any language), "+
257
+
"perform setup yourself inline: call axme_oracle to scan the "+
258
+
"project, then axme_save_decision for each architecture finding "+
259
+
"(scope: workspace), axme_save_memory for each gotcha (type: "+
260
+
"pattern, scope: workspace), and axme_update_safety for each "+
261
+
"dangerous pattern. When done, summarize what you saved and only "+
262
+
"THEN proceed to the user's original request. Do not silently "+
263
+
"work without setup — the lack of .axme-code/ means your future "+
264
+
"selves will have no project memory at all.",
265
+
);
266
+
}
238
267
parts.push("TRUNCATED OUTPUT RULE: if ANY MCP tool output is truncated or saved to a file (you see 'Output too large' or 'saved to file'), you MUST use the Read tool to read the full file content into your context. Do not proceed with partial data.");
239
268
parts.push("Save memories, decisions, and safety rules immediately when discovered during work.");
240
269
parts.push("GIT COMMIT/PUSH GATE: every git commit and git push command MUST end with `#!axme pr=<NUMBER|none> repo=<OWNER/REPO>`. Example: `git commit -m \"fix bug\" #!axme pr=42 repo=AxmeAI/axme-code`. Use pr=none if no PR exists yet. Without this suffix the command will be blocked.");
0 commit comments