Skip to content

Commit 2abeb20

Browse files
authored
Merge pull request Kilo-Org#4137 from Kilo-Org/christiaan/claude-code
Attempt to make Opus work slightly better with Claude Code
2 parents 41dc6d3 + 119e31b commit 2abeb20

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.changeset/orange-coins-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"kilo-code": patch
3+
---
4+
5+
Slightly improved reliability of Opus with Claude Code

src/api/providers/claude-code.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export class ClaudeCodeHandler extends BaseProvider implements ApiHandler {
9595
}
9696
}
9797

98+
let toolReminder = false // kilocode_change
9899
for (const content of message.content) {
99100
switch (content.type) {
100101
case "text":
@@ -117,6 +118,15 @@ export class ClaudeCodeHandler extends BaseProvider implements ApiHandler {
117118
break
118119
case "tool_use":
119120
console.error(`tool_use is not supported yet. Received: ${JSON.stringify(content)}`)
121+
// kilocode_change start
122+
if (!toolReminder) {
123+
yield {
124+
type: "text",
125+
text: "Preparing to use tools in XML format... ",
126+
}
127+
toolReminder = true
128+
}
129+
// kilocode_change end
120130
break
121131
}
122132
}

src/integrations/claude-code/run.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ export async function* runClaudeCode(
157157
// We want the model to use our custom tool format instead of built-in tools.
158158
// Disabling built-in tools prevents tool-only responses and ensures text output.
159159
const claudeCodeTools = [
160+
// kilocode_change start
161+
"AskUserQuestion",
162+
"KillShell",
163+
"Skill",
164+
"SlashCommand",
165+
// kilocode_change end
160166
"Task",
161167
"Bash",
162168
"Glob",

0 commit comments

Comments
 (0)