diff --git a/src/agent/async-agent.ts b/src/agent/async-agent.ts index 68e6f601..86ae5d90 100644 --- a/src/agent/async-agent.ts +++ b/src/agent/async-agent.ts @@ -4,7 +4,7 @@ import { Agent } from "./runner.js"; import { Channel } from "./channel.js"; import type { AgentOptions, Message } from "./types.js"; -const devNull = { write: () => true } as NodeJS.WritableStream; +const devNull = { write: () => true } as unknown as NodeJS.WritableStream; /** Discriminated union of legacy Message (error fallback) and raw AgentEvent */ export type ChannelItem = Message | AgentEvent; diff --git a/src/agent/runner.ts b/src/agent/runner.ts index b658c9d4..bdc9e203 100644 --- a/src/agent/runner.ts +++ b/src/agent/runner.ts @@ -268,7 +268,9 @@ export class Agent { this.agent.setModel(model); // Save original tools config from options (for later merging during reload) - this.originalToolsConfig = options.tools; + if (options.tools) { + this.originalToolsConfig = options.tools; + } // Merge Profile tools config with options.tools (options takes precedence) const profileToolsConfig = this.profile?.getToolsConfig();