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 <noreply@anthropic.com>
This commit is contained in:
parent
109ac1c549
commit
801bf9e6a8
@ -65,7 +65,8 @@ export async function runCliAgent(params: {
|
|||||||
|
|
||||||
const extraSystemPrompt = [
|
const extraSystemPrompt = [
|
||||||
params.extraSystemPrompt?.trim(),
|
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)
|
.filter(Boolean)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
|
|||||||
@ -89,6 +89,8 @@ export type CliBackendConfig = {
|
|||||||
imageMode?: "repeat" | "list";
|
imageMode?: "repeat" | "list";
|
||||||
/** Serialize runs for this CLI. */
|
/** Serialize runs for this CLI. */
|
||||||
serialize?: boolean;
|
serialize?: boolean;
|
||||||
|
/** Whether tools are enabled for this CLI backend (default: false). */
|
||||||
|
toolsEnabled?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AgentDefaultsConfig = {
|
export type AgentDefaultsConfig = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user