fix(pcap): name the host tool to configure in capability refusals (#2507)

* fix(pcap): name the host tool to configure in capability refusals

Missing or misconfigured tshark/capinfos, the unsupported macOS capture
boundary and an unusable Linux prlimit were projected with the generic
"unavailable for the current target; choose another target" advice, even
for inspect_pcap_client, which has no target. Route tool refusals through
one pcapToolUnavailable owner that names REA_TSHARK_COMMAND and
REA_CAPINFOS_COMMAND, give host-boundary refusals their own reason, and
keep the private workspace refusal's retryable flag like WABT and source
maps do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(pcap): cover the Linux prlimit refusal guidance

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-13 13:29:09 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 1991542e59
commit bb96afdbe3
8 changed files with 102 additions and 34 deletions
+3 -5
View File
@@ -2,7 +2,6 @@ import { randomUUID } from "node:crypto";
import { AnalysisError } from "../domain/analysisErrorBase.js";
import {
AnalysisCancelledError,
AnalysisCapabilityUnavailableError,
AnalysisProtocolError,
AnalysisResourceConstraintError,
AnalysisTimeoutError,
@@ -19,6 +18,7 @@ import {
windowsBatchCommand,
WindowsBatchCommandError,
} from "../process/WindowsBatchCommand.js";
import { pcapToolUnavailable } from "./PcapConfiguration.js";
export interface PcapCommandLimits {
readonly timeoutMs: number;
@@ -168,8 +168,7 @@ export const runPcapCommand = async (options: {
"code" in cause &&
(cause.code === "ENOENT" || cause.code === "EACCES"))
)
throw new AnalysisCapabilityUnavailableError(
"pcap",
throw pcapToolUnavailable(
operation,
`Cannot run selected tool ${command}: ${cause.message}`,
details,
@@ -181,8 +180,7 @@ export const runPcapCommand = async (options: {
? cause.message
: String(cause);
if (options.inputPath === undefined)
throw new AnalysisCapabilityUnavailableError(
"pcap",
throw pcapToolUnavailable(
operation,
`The selected tool ${command} cannot report its version: ${diagnostic}`,
details,