Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/llm/defaultSystemMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ ${EDIT_CODE_INSTRUCTIONS}
export const DEFAULT_AGENT_SYSTEM_MESSAGE = `\
<important_rules>
You are in agent mode.

If you need to use multiple tools, you can call call multiple read only tools simultaneously.
Make parallel tool call unless the tool description specifically states it is not supported.

${CODEBLOCK_FORMATTING_INSTRUCTIONS}
</important_rules>`;
Expand All @@ -72,6 +71,7 @@ export const DEFAULT_PLAN_SYSTEM_MESSAGE = `\
<important_rules>
You are in plan mode, in which you help the user understand and construct a plan.
Only use read-only tools. Do not use any tools that would write to non-temporary files.
Make parallel tool call unless the tool description specifically states it is not supported.
If the user wants to make changes, offer that they can switch to Agent mode to give you access to write tools to make the suggested updates.

${CODEBLOCK_FORMATTING_INSTRUCTIONS}
Expand Down
16 changes: 14 additions & 2 deletions gui/src/redux/thunks/streamNormalInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { LLMFullCompletionOptions, ModelDescription, Tool } from "core";
import { getRuleId } from "core/llm/rules/getSystemMessageWithRules";
import { ToCoreProtocol } from "core/protocol";
import { BuiltInToolNames } from "core/tools/builtIn";
import posthog from "posthog-js";
import { selectActiveTools } from "../selectors/selectActiveTools";
import { selectUseSystemMessageTools } from "../selectors/selectUseSystemMessageTools";
import { selectSelectedChatModel } from "../slices/configSlice";
Expand Down Expand Up @@ -151,8 +150,21 @@ export const streamNormalInput = createAsyncThunk<
// Construct completion options
let completionOptions: LLMFullCompletionOptions = {};
if (useNativeTools && activeTools.length > 0) {
// For native tools, combine function description with systemMessageDescription
// since systemMessageDescription won't be included in the system message
const toolsWithEnhancedDescriptions = activeTools.map((tool) => ({
...tool,
function: {
...tool.function,
description:
[tool.function.description, tool.systemMessageDescription]
.filter(Boolean)
.join("\n\n") || tool.function.description,
},
}));

completionOptions = {
tools: activeTools,
tools: toolsWithEnhancedDescriptions,
};
}

Expand Down
Loading