From 801bf9e6a8f370f488b0247056b1ec255533d7c4 Mon Sep 17 00:00:00 2001 From: Ryan McMillan Date: Wed, 28 Jan 2026 13:54:04 -0600 Subject: [PATCH] fix: respect toolsEnabled config for CLI backends [AI-assisted] Add `toolsEnabled` option to `CliBackendConfig` that controls whether the "Tools are disabled" system prompt is injected for CLI backends. When `toolsEnabled: true`, the backend is assumed to have its own tool handling (e.g., Claude CLI with --allowedTools), so we skip the misleading "Tools are disabled" message. Default behavior is unchanged (toolsEnabled defaults to false). Co-Authored-By: Claude Opus 4.5 --- src/agents/cli-runner.ts | 3 ++- src/config/types.agent-defaults.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/agents/cli-runner.ts b/src/agents/cli-runner.ts index c998a9e6f..c3c091d50 100644 --- a/src/agents/cli-runner.ts +++ b/src/agents/cli-runner.ts @@ -65,7 +65,8 @@ export async function runCliAgent(params: { const extraSystemPrompt = [ params.extraSystemPrompt?.trim(), - "Tools are disabled in this session. Do not call tools.", + // Only add "tools disabled" message if tools aren't enabled for this backend + backend.toolsEnabled ? undefined : "Tools are disabled in this session. Do not call tools.", ] .filter(Boolean) .join("\n"); diff --git a/src/config/types.agent-defaults.ts b/src/config/types.agent-defaults.ts index 9c6ce0211..af557cb49 100644 --- a/src/config/types.agent-defaults.ts +++ b/src/config/types.agent-defaults.ts @@ -89,6 +89,8 @@ export type CliBackendConfig = { imageMode?: "repeat" | "list"; /** Serialize runs for this CLI. */ serialize?: boolean; + /** Whether tools are enabled for this CLI backend (default: false). */ + toolsEnabled?: boolean; }; export type AgentDefaultsConfig = {