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:
co-authored by
Claude Opus 5.5
parent
170d0bf9e2
commit
6489d58851
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user