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
+23 -2
View File
@@ -220,7 +220,18 @@ export const registerFridaCommands = (
(options.scriptFile === undefined)
)
return projectAnalysisError(
new AnalysisInputError(CLI_COMMANDS.instrumentWithFrida),
new AnalysisInputError(
CLI_COMMANDS.instrumentWithFrida,
undefined,
[
{
path: ["script"],
reason: "invalid_value",
message:
"Provide exactly one of --script or --script-file.",
},
],
),
);
const remote = remoteFrom(options);
const selected =
@@ -248,7 +259,17 @@ export const registerFridaCommands = (
};
if (targetInput === undefined)
return projectAnalysisError(
new AnalysisInputError(CLI_COMMANDS.instrumentWithFrida),
new AnalysisInputError(
CLI_COMMANDS.instrumentWithFrida,
undefined,
[
{
path: ["target"],
reason: "invalid_value",
message: "attach mode needs a positive integer process ID.",
},
],
),
);
const result = await withProviderCleanup(() =>
service.instrument(