fix(javascript): keep Wakaru version stderr out of the refusal message

The version-mismatch reason ends with the tool's complete stderr, which
is too long for a caller-facing message. The message now names the
expected and reported version and exit code; details.reason keeps the
stderr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-09 08:16:45 +00:00
co-authored by Claude Opus 5.5
parent 170d0bf9e2
commit 6489d58851
+8 -4
View File
@@ -70,10 +70,14 @@ const executeWakaruRecovery = async (context: RecoveryWorkspace) => {
version.exit_code !== 0 ||
version.stdout.trim() !== `wakaru ${WAKARU_RELEASE.version}`
) {
const reason = `This adapter requires Wakaru ${WAKARU_RELEASE.version}; reported version: ${version.stdout.trim()}; exit: ${String(version.exit_code)}; stderr: ${version.stderr}`;
throw new AnalysisCapabilityUnavailableError("wakaru", OPERATION, reason, {
userMessage: reason,
});
// The message names the mismatch; the reason also keeps the tool's stderr.
const mismatch = `This adapter requires Wakaru ${WAKARU_RELEASE.version}; reported version: ${version.stdout.trim()}; exit: ${String(version.exit_code)}`;
throw new AnalysisCapabilityUnavailableError(
"wakaru",
OPERATION,
`${mismatch}; stderr: ${version.stderr}`,
{ userMessage: `${mismatch}.` },
);
}
const run = await runWakaruCommand({
...commandContext,