mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-01 01:16:17 +02:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user