fix: validate message timeout before secret resolution (#98652)

Co-authored-by: Peter Steinberger <58493+steipete@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-07-01 15:35:58 +01:00
committed by GitHub
parent ce4a259485
commit 909be7bcbc
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -457,6 +457,7 @@ describe("message tool gateway timeout", () => {
timeoutMs,
}),
).rejects.toThrow("timeoutMs must be a positive integer");
expect(mocks.resolveCommandSecretRefsViaGateway).not.toHaveBeenCalled();
expect(mocks.runMessageAction).not.toHaveBeenCalled();
},
);
+2 -1
View File
@@ -1348,6 +1348,7 @@ export function createMessageTool(options?: MessageToolOptions): AnyAgentTool {
}
}
const gatewayOpts = readGatewayCallOptions(params);
const rawConfig = options?.config ?? loadConfigForTool();
const scope = resolveMessageSecretScope({
channel: params.channel,
@@ -1413,7 +1414,7 @@ export function createMessageTool(options?: MessageToolOptions): AnyAgentTool {
}
}
const gatewayResolved = resolveGatewayOptions(readGatewayCallOptions(params));
const gatewayResolved = resolveGatewayOptions(gatewayOpts);
const gateway = {
url: gatewayResolved.url,
token: gatewayResolved.token,