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:
co-authored by
Claude Opus 5.5
parent
1991542e59
commit
bb96afdbe3
@@ -1,6 +1,6 @@
|
||||
import { expect, it } from "vitest";
|
||||
|
||||
import { serveCli } from "./cliServeHarness.js";
|
||||
import { expectConfigurationRefusal, serveCli } from "./cliServeHarness.js";
|
||||
|
||||
it.each(["inspect-pcap-client", "inspect-pcap-capture"])(
|
||||
"%s advertises a schema through the public CLI",
|
||||
@@ -11,13 +11,27 @@ it.each(["inspect-pcap-client", "inspect-pcap-capture"])(
|
||||
},
|
||||
);
|
||||
|
||||
it("reports missing tools with a capability refusal", async () => {
|
||||
const result = await serveCli(
|
||||
["inspect-pcap-capture", "/nonexistent/capture.pcap", "--json"],
|
||||
{
|
||||
REA_TSHARK_COMMAND: "/nonexistent/tshark",
|
||||
REA_CAPINFOS_COMMAND: "/nonexistent/capinfos",
|
||||
},
|
||||
it.each([
|
||||
["inspect-pcap-client"],
|
||||
["inspect-pcap-capture", "/nonexistent/capture.pcap"],
|
||||
])("%s names the missing Wireshark tool to configure", async (...argv) => {
|
||||
const result = await serveCli([...argv, "--json"], {
|
||||
REA_TSHARK_COMMAND: "/nonexistent/tshark",
|
||||
REA_CAPINFOS_COMMAND: "/nonexistent/capinfos",
|
||||
});
|
||||
expectConfigurationRefusal(
|
||||
result,
|
||||
"Cannot run selected tool /nonexistent/tshark",
|
||||
);
|
||||
expectConfigurationRefusal(result, "through absolute REA_TSHARK_COMMAND");
|
||||
});
|
||||
|
||||
it("names a relative tool selection as configuration to fix", async () => {
|
||||
const result = await serveCli(["inspect-pcap-client", "--json"], {
|
||||
REA_TSHARK_COMMAND: "tshark",
|
||||
});
|
||||
expectConfigurationRefusal(
|
||||
result,
|
||||
"REA_TSHARK_COMMAND must be an absolute path to the tshark binary",
|
||||
);
|
||||
expect(result.stdout).toContain("capability_unavailable");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user