fix(frida): name the argument each Frida input error rejects (#2217)

Frida session lookups, script lookups, unreadable script files and the
instrument-with-frida PID and script checks returned invalid_request with
no issues, while the remediation told callers to correct the listed
arguments. Attach the session_id, script_id, path, target or script issue
with the reason so CLI and MCP callers can see what to fix.

Fixes #2213

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-12 23:00:59 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 109769319a
commit 86de439ba4
6 changed files with 146 additions and 9 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ import { jsonValueSchema } from "../domain/jsonValue.js";
import { logToolExecution } from "./toolLogging.js";
import { toolRegistrationOptions } from "./toolRegistrationOptions.js";
import type { ToolResultDelivery } from "./toolResult.js";
import { unknownFridaSession } from "../application/frida/fridaInputErrors.js";
/** Register Frida device discovery and persistent instrumentation operations. */
export const registerFridaTools = (
@@ -199,7 +200,7 @@ export const registerFridaTools = (
return delivery.toCallToolResult(
{
ok: false as const,
error: new AnalysisInputError(status.name),
error: unknownFridaSession(status.name, input.session_id),
},
status,
);