Commit e705953
committed
fix(core): stop instructing agent to run axme-code setup autonomously
Two changes that close a UX hole surfaced during PR #130 extension
E2E testing: when a chat agent calls axme_context on a workspace
where .axme-code/ is missing, the tool's previous output told the
agent to run \`axme-code setup --plugin\` via Bash unconditionally.
That works for the Claude Code plugin distribution (where setup is
not pre-run by anything else), but it backfires for the Cursor
extension path:
- The extension itself shows a "Run setup?" toast at activation,
and the user clicks it. Setup runs once.
- The agent then opens a chat, calls axme_context, sees "not
initialized" (race with setup finishing) OR sees a partial state
somewhere and decides to run setup AGAIN via Bash.
- Result: duplicate D-NNN decisions across preset bundles,
spurious 2-minute LLM-scanner re-runs on every fresh chat
(verified empirically with /tmp/cursor-fresh-smoke during
PR #130 testing — agent ran the second setup itself).
Setup is unambiguously a user-initiated operation. The agent must
never spawn it.
Changes
-------
src/tools/context.ts (2 messages reworded):
- "Project not initialized" branch (~line 81): drop the
"THEN run axme-code setup --plugin via Bash" instruction. The
message now tells the agent to relay to the user (Cursor:
Command Palette → AXME: Setup; Claude Code: terminal
axme-code setup) and stop. Explicitly forbids autonomous setup.
- "Deterministic scan only" warning (~line 141): same treatment
— tell the user to re-run, do not run yourself.
src/setup/cursor-writers.ts:
- RULE_BODY (the body of .cursor/rules/axme-code.mdc written by
setup) gains a new "NEVER run axme-code setup yourself"
paragraph between Session Start and During Work. Closes the
same hole at the rule level — even if axme_context's message
is ignored, the rule itself bars the action.
No behaviour change for users on the Claude Code plugin path —
they were running setup via the plugin's own SessionStart hook
already; the autonomous Bash spawn was a redundant safety belt
that mostly fired in narrow non-plugin contexts. The new text
still lets them run it manually if they want.
Tests: 604 / 604 pass locally. No test changes needed; this only
modifies user-facing output strings.
#!axme pr=129 repo=AxmeAI/axme-code1 parent e3fe6a5 commit e705953
2 files changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
0 commit comments