refactor: simplify gateway agent values

This commit is contained in:
Peter Steinberger
2026-04-11 00:35:28 +01:00
parent fa0b086a99
commit f4c9248a31

View File

@@ -58,7 +58,7 @@ export type AgentCliOpts = {
function parseTimeoutSeconds(opts: { cfg: ReturnType<typeof loadConfig>; timeout?: string }) {
const raw =
opts.timeout !== undefined
? Number.parseInt(String(opts.timeout), 10)
? Number.parseInt(opts.timeout, 10)
: (opts.cfg.agents?.defaults?.timeoutSeconds ?? 600);
if (Number.isNaN(raw) || raw < 0) {
throw new Error("--timeout must be a non-negative integer (seconds; 0 means no timeout)");
@@ -165,7 +165,7 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim
const payloads = result?.payloads ?? [];
if (payloads.length === 0) {
runtime.log(response?.summary ? String(response.summary) : "No reply from agent.");
runtime.log(response?.summary ? response.summary : "No reply from agent.");
return response;
}