Skip to content

Commit aa3296d

Browse files
committed
fix: Resolve merge conflict and fix compilation errors after rebase
- Resolved merge conflict in presentAssistantMessage.ts after rebasing onto main - Derive toolProtocol from isNative boolean (based on tool call ID presence) - Updated system.ts to call getModesSection with correct signature - Maintained protocol detection logic from main branch - All TypeScript compilation errors resolved
1 parent 0d6ed9f commit aa3296d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/core/assistant-message/presentAssistantMessage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { fetchInstructionsTool } from "../tools/FetchInstructionsTool"
1313
import { listFilesTool } from "../tools/ListFilesTool"
1414
import { readFileTool } from "../tools/ReadFileTool"
1515
import { getSimpleReadFileToolDescription, simpleReadFileTool } from "../tools/simpleReadFileTool"
16-
import { shouldUseSingleFileRead } from "@roo-code/types"
16+
import { shouldUseSingleFileRead, TOOL_PROTOCOL } from "@roo-code/types"
1717
import { writeToFileTool } from "../tools/WriteToFileTool"
1818
import { applyDiffTool } from "../tools/MultiApplyDiffTool"
1919
import { insertContentTool } from "../tools/InsertContentTool"
@@ -284,10 +284,10 @@ export async function presentAssistantMessage(cline: Task) {
284284
// Native protocol tool calls ALWAYS have an ID (set when parsed from tool_call chunks).
285285
// XML protocol tool calls NEVER have an ID (parsed from XML text).
286286
const toolCallId = (block as any).id
287-
const isNative = !!toolCallId
287+
const toolProtocol = toolCallId ? TOOL_PROTOCOL.NATIVE : TOOL_PROTOCOL.XML
288288

289289
const pushToolResult = (content: ToolResponse) => {
290-
if (isNative && toolCallId) {
290+
if (toolProtocol === TOOL_PROTOCOL.NATIVE) {
291291
// For native protocol, only allow ONE tool_result per tool call
292292
if (hasToolResult) {
293293
console.warn(
@@ -524,7 +524,7 @@ export async function presentAssistantMessage(cline: Task) {
524524

525525
// Check if this tool call came from native protocol by checking for ID
526526
// Native calls always have IDs, XML calls never do
527-
if (isNative) {
527+
if (toolProtocol === TOOL_PROTOCOL.NATIVE) {
528528
await applyDiffToolClass.handle(cline, block as ToolUse<"apply_diff">, {
529529
askApproval,
530530
handleError,

src/core/prompts/system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async function generatePrompt(
8686
const effectiveProtocol = getEffectiveProtocol(settings?.toolProtocol)
8787

8888
const [modesSection, mcpServersSection] = await Promise.all([
89-
getModesSection(context, isNativeProtocol(effectiveProtocol)),
89+
getModesSection(context),
9090
shouldIncludeMcp
9191
? getMcpServersSection(
9292
mcpHub,

0 commit comments

Comments
 (0)