mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-10 22:41:14 +00:00
fix: pass tool protocol parameter to lineCountTruncationError (#9358)
This commit is contained in:
parent
9538d82333
commit
4bfd0709e4
1 changed files with 9 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ import { EXPERIMENT_IDS, experiments } from "../../shared/experiments"
|
|||
import { convertNewFileToUnifiedDiff, computeDiffStats, sanitizeUnifiedDiff } from "../diff/stats"
|
||||
import { BaseTool, ToolCallbacks } from "./BaseTool"
|
||||
import type { ToolUse } from "../../shared/tools"
|
||||
import { resolveToolProtocol } from "../../utils/resolveToolProtocol"
|
||||
|
||||
interface WriteToFileParams {
|
||||
path: string
|
||||
|
|
@ -109,6 +110,8 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
|
|||
const actualLineCount = newContent.split("\n").length
|
||||
const isNewFile = !fileExists
|
||||
const diffStrategyEnabled = !!task.diffStrategy
|
||||
const modelInfo = task.api.getModel().info
|
||||
const toolProtocol = resolveToolProtocol(task.apiConfiguration, modelInfo)
|
||||
|
||||
await task.say(
|
||||
"error",
|
||||
|
|
@ -119,7 +122,12 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
|
|||
|
||||
pushToolResult(
|
||||
formatResponse.toolError(
|
||||
formatResponse.lineCountTruncationError(actualLineCount, isNewFile, diffStrategyEnabled),
|
||||
formatResponse.lineCountTruncationError(
|
||||
actualLineCount,
|
||||
isNewFile,
|
||||
diffStrategyEnabled,
|
||||
toolProtocol,
|
||||
),
|
||||
),
|
||||
)
|
||||
await task.diffViewProvider.revertChanges()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue