fix(agent): resolve TypeScript errors with exactOptionalPropertyTypes
- Fix originalToolsConfig assignment to handle undefined properly - Fix devNull type cast for WritableStream compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
dafbf856ac
commit
4112d4511e
2 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue