Skip to content

Commit 8d04f00

Browse files
authored
Merge pull request #86 from AxmeAI/feat/plugin-repo-sync-20260408
fix: SDK path resolution, debug prompt removal, improved error logging
2 parents 80c2f78 + c2b533c commit 8d04f00

3 files changed

Lines changed: 22 additions & 16 deletions

File tree

src/server.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -680,21 +680,7 @@ server.tool(
680680
"- `worklog_entry`: narrative summary (5-15 lines markdown)",
681681
"- `startup_text`: ready-to-paste text for next session",
682682
"",
683-
"## Step 3: Verify AXME Code Functionality (ALPHA - MANDATORY)",
684-
"",
685-
"AXME Code is in alpha. Before finalizing, verify that core functionality worked correctly in this session.",
686-
"Run these checks and report results to the user:",
687-
"",
688-
"1. **Context loading**: call `axme_status` - verify it returns data (not error)",
689-
"2. **Saves**: if you saved any memories/decisions in this session, verify files exist on disk:",
690-
" - `ls .axme-code/decisions/` and `ls .axme-code/memory/` in the target storage",
691-
"3. **Pending audits**: check `axme_context` output for 'Pending audits' section - report if any are stuck",
692-
"4. **Safety hooks**: verify `.claude/settings.json` has PreToolUse + PostToolUse + SessionEnd hooks configured",
693-
"5. **Session tracking**: verify current session meta exists: `ls .axme-code/sessions/` should have current session dir",
694-
"",
695-
"Report results as a table to the user. If anything is broken, flag it BEFORE calling finalize_close.",
696-
"",
697-
"## Step 4: Call `axme_finalize_close`",
683+
"## Step 3: Call `axme_finalize_close`",
698684
"",
699685
"Pass everything in one call. MCP writes all files atomically.",
700686
"After it returns:",

src/tools/init.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ export async function initProjectWithLLM(projectPath: string, opts?: {
174174
log(` [${projectName}] Scanners complete, processing results...`);
175175
for (const settled of scanners) {
176176
if (settled.status === "rejected") {
177-
errors.push(`LLM scan failed: ${settled.reason?.message ?? settled.reason}`);
177+
const err = settled.reason;
178+
const msg = err?.message ?? String(err);
179+
const stack = err?.stack ? `\n${err.stack.split("\n").slice(0, 3).join("\n")}` : "";
180+
errors.push(`LLM scan failed: ${msg}${stack}`);
178181
continue;
179182
}
180183
const val = settled.value;

src/utils/agent-options.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,22 @@
22
* Shared agent query options builder for LLM scanner agents.
33
*/
44

5+
import { execSync } from "node:child_process";
6+
57
type Options = import("@anthropic-ai/claude-agent-sdk").Options;
68

9+
/** Find claude binary path. Cached after first lookup. */
10+
let _claudePath: string | undefined;
11+
function findClaudePath(): string | undefined {
12+
if (_claudePath !== undefined) return _claudePath || undefined;
13+
try {
14+
_claudePath = execSync("which claude", { encoding: "utf-8" }).trim();
15+
} catch {
16+
_claudePath = "";
17+
}
18+
return _claudePath || undefined;
19+
}
20+
721
export type AgentRole = "scanner" | "tester" | "reviewer" | "engineer" | "architect" | "auditor";
822

923
const ROLE_TOOLS: Record<AgentRole, { allowed: string[]; disallowed: string[] }> = {
@@ -41,6 +55,8 @@ export function buildAgentQueryOptions(base: {
4155
}, role: AgentRole): Options {
4256
const tools = ROLE_TOOLS[role];
4357

58+
const claudePath = findClaudePath();
59+
4460
return {
4561
cwd: base.cwd,
4662
model: base.model,
@@ -49,6 +65,7 @@ export function buildAgentQueryOptions(base: {
4965
: { type: "preset" as const, preset: "claude_code" as const },
5066
settingSources: ["project"],
5167
...(base.maxTurns !== undefined ? { maxTurns: base.maxTurns } : {}),
68+
...(claudePath ? { pathToClaudeCodeExecutable: claudePath } : {}),
5269
permissionMode: "bypassPermissions",
5370
allowDangerouslySkipPermissions: true,
5471
allowedTools: tools.allowed,

0 commit comments

Comments
 (0)