Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(agent): resolve TypeScript errors with exactOptionalPropertyTypes

Jiang Bohan4112d4511e85
diff --git a/src/agent/async-agent.ts b/src/agent/async-agent.ts
index 68e6f601e3..86ae5d90f5 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 b658c9d480..bdc9e2036c 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();