fix: name host and tool requirements in optional adapter refusals
Host and tool-configuration refusals from the pwntools, EVMole, firmware, mitmproxy, Wakaru, LLDB and xcrun adapters carried no userMessage, so CLI and MCP callers saw the generic "This analysis is unavailable for the current target. Choose another analysis or target." as both message and remediation. Choosing another target cannot satisfy a Linux-only profile or an unset REA_*_COMMAND. The actual requirement appeared only in details.reason. Pass each refusal's reason as its userMessage, as the adapters' other configuration refusals (EVMole limits, JADX, pwndbg) already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e6905c18e0
commit
170d0bf9e2
@@ -1,9 +1,30 @@
|
||||
import { EventEmitter } from "node:events";
|
||||
import { PassThrough } from "node:stream";
|
||||
import { expect, it } from "vitest";
|
||||
import { runWakaruCommand, type WakaruLauncher } from "./WakaruCommand.js";
|
||||
import { AnalysisCapabilityUnavailableError } from "../../domain/analysisErrorCore.js";
|
||||
import { projectAnalysisError } from "../../domain/analysisErrorProjection.js";
|
||||
import {
|
||||
resolveWakaruCommand,
|
||||
runWakaruCommand,
|
||||
type WakaruLauncher,
|
||||
} from "./WakaruCommand.js";
|
||||
import { RECOVERY_LIMITS } from "./WakaruRelease.js";
|
||||
|
||||
it("names the Wakaru configuration requirement when it is not configured", async () => {
|
||||
const refusal: unknown = await resolveWakaruCommand({}).catch(
|
||||
(cause: unknown) => cause,
|
||||
);
|
||||
|
||||
if (!(refusal instanceof AnalysisCapabilityUnavailableError))
|
||||
throw new Error("Expected a capability refusal");
|
||||
expect(refusal.reason).toContain("REA_WAKARU_COMMAND");
|
||||
expect(projectAnalysisError(refusal)).toMatchObject({
|
||||
code: "capability_unavailable",
|
||||
message: refusal.reason,
|
||||
remediation: { action: refusal.reason },
|
||||
});
|
||||
});
|
||||
|
||||
it("rejects an exhausted shared execution budget before launching the next command", async () => {
|
||||
await expect(
|
||||
runWakaruCommand({
|
||||
|
||||
Reference in New Issue
Block a user