Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9c531c7
feat(mistral): add FIM support for codestral models
markijbema Nov 18, 2025
a9cbb2c
fix(cli): prevent paste truncation in VSCode terminal (#4831)
Drilmo Jan 7, 2026
e193d5b
feat(ghost): use duck typing for FIM support in GhostModel
markijbema Jan 7, 2026
b64c6ed
fix: add optional taskId and onUsage params to MistralHandler.streamFim
markijbema Jan 7, 2026
22a4ebf
feat(cli): support Cmd+V for image paste in VSCode terminal (#4832)
Drilmo Jan 7, 2026
ea3a127
chore: reorganize .kilocode with skills and workflows directories (#4…
marius-kilocode Jan 7, 2026
de193a2
refactor: use shared postprocessGhostSuggestion filter in ChatTextAre…
markijbema Jan 7, 2026
f049397
feat(ghost): filter repetitive phrase suggestions in autocomplete
markijbema Jan 7, 2026
1fab9af
chore: add changeset
markijbema Jan 7, 2026
0c8a4b2
feat(ghost): strip trailing non-word chars when detecting repetitive …
markijbema Jan 7, 2026
ff9595f
add missing markers
markijbema Jan 7, 2026
88a7095
fix: add removePrefixOverlap before postprocessGhostSuggestion
markijbema Jan 7, 2026
348fc2f
cleanup
markijbema Jan 7, 2026
40859e5
simplify
markijbema Jan 7, 2026
abd39df
more logical ordering
markijbema Jan 7, 2026
edebe31
remove unused import
markijbema Jan 7, 2026
21cefc0
Merge pull request #4842 from Kilo-Org/mark/filter-repetitive-phrase-…
markijbema Jan 7, 2026
de56253
remove useless comment
markijbema Jan 7, 2026
e763027
fix test
markijbema Jan 7, 2026
ba1d2bf
remove dead code
markijbema Jan 7, 2026
582a541
Remove unused completeFim method from IFimProvider interface
markijbema Jan 7, 2026
25e1cc0
remove markers
markijbema Jan 7, 2026
3bab033
fix types and added comment
markijbema Jan 7, 2026
b3d3322
check cleaned
markijbema Jan 7, 2026
91e0a17
add changeset
markijbema Jan 7, 2026
bdf2be3
Merge pull request #3856 from Kilo-Org/mark/fim-for-mistral-provider
markijbema Jan 7, 2026
0e3520a
add changeset
markijbema Jan 7, 2026
63b1510
Merge pull request #4843 from Kilo-Org/mark/chat-autocomplete-use-sha…
markijbema Jan 7, 2026
8ee812a
Disable structured outputs for Anthropic models, because the tool sch…
chrarnoldus Jan 7, 2026
3c0cf0d
Revert tests to Roo version
chrarnoldus Jan 7, 2026
4c30330
Merge pull request #4847 from Kilo-Org/christiaan/structured-outputs
chrarnoldus Jan 7, 2026
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
9 changes: 9 additions & 0 deletions .changeset/cmdv-image-paste-macos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"kilo-code": patch
---

Support Cmd+V for pasting images on macOS in VSCode terminal

- Detect empty bracketed paste (when clipboard contains image instead of text)
- Trigger clipboard image check on empty paste or paste timeout
- Add Cmd+V (meta key) support alongside Ctrl+V for image paste
5 changes: 5 additions & 0 deletions .changeset/crisp-rabbits-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Faster autocomplete when using the Mistral provider
9 changes: 9 additions & 0 deletions .changeset/fix-vscode-paste-truncation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"kilo-code": patch
---

Fix paste truncation in VSCode terminal

- Prevent React StrictMode cleanup from interrupting paste operations
- Remove `completePaste()` and `clearBuffers()` from useEffect cleanup
- Paste buffer refs now persist across React re-mounts and flush properly when paste end marker is received
5 changes: 5 additions & 0 deletions .changeset/new-taxes-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Disable structured outputs for Anthropic models, because the tool schema doesn't yet support it
5 changes: 5 additions & 0 deletions .changeset/smooth-wombats-stand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Filter unhelpful suggestions in chat autocomplete
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# AGENTS.md

This file provides guidance to agents when working with code in this repository in Translate mode.

## Workflow

This workflow requires Orchestrator mode.
---
name: translation
description: Guidelines for translating and localizing the Kilo Code extension, including language-specific rules for German, Simplified Chinese, and Traditional Chinese.
---

Execute `node scripts/find-missing-translations.js` in Code mode to find all missing translations.
# Translation Guidelines

For each language that is missing translations:
This file provides guidance to agents when working with translations in this repository.

- For each JSON file that is missing translations:
- Start a separate subtask in Translate mode for this language and JSON file to add the missing translations. Do not try to process mutliple languages or JSON files in one subtask.
For the translation workflow, use the `/add-missing-translations` command or see `.kilocode/workflows/add-missing-translations.md`.

---

Expand Down Expand Up @@ -311,42 +307,13 @@ For each language that is missing translations:

### Common Patterns

```markdown
<<<<<<< BEFORE
"dragFiles": "按住shift拖动文件"
=======
"dragFiles": "Shift+拖拽文件"

> > > > > > > AFTER

<<<<<<< BEFORE
"description": "启用后,Kilo Code 将能够与 MCP 服务器交互以获取高级功能。"
=======
"description": "启用后 Kilo Code 可与 MCP 服务交互获取高级功能。"

> > > > > > > AFTER

<<<<<<< BEFORE
"cannotUndo": "此操作无法撤消。"
=======
"cannotUndo": "此操作不可逆。"

> > > > > > > AFTER

<<<<<<< BEFORE
"hold shift to drag in files" → "按住shift拖动文件"
=======
"hold shift to drag in files" → "Shift+拖拽文件"

> > > > > > > AFTER

<<<<<<< BEFORE
"Double click to edit" → "双击进行编辑"
=======
"Double click to edit" → "双击编辑"

> > > > > > > AFTER
```
| Original | Avoid | Preferred |
| ------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------- |
| `"dragFiles"` | `"按住shift拖动文件"` | `"Shift+拖拽文件"` |
| `"description"` | `"启用后,Kilo Code 将能够与 MCP 服务器交互以获取高级功能。"` | `"启用后 Kilo Code 可与 MCP 服务交互获取高级功能。"` |
| `"cannotUndo"` | `"此操作无法撤消。"` | `"此操作不可逆。"` |
| `"hold shift to drag in files"` | `"按住shift拖动文件"` | `"Shift+拖拽文件"` |
| `"Double click to edit"` | `"双击进行编辑"` | `"双击编辑"` |

### Common Pitfalls

Expand Down
22 changes: 22 additions & 0 deletions .kilocode/workflows/add-missing-translations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Add missing translations

This workflow requires Orchestrator mode.

Execute `node scripts/find-missing-translations.js` in Code mode to find all missing translations.

For each language that is missing translations:

- For each JSON file that is missing translations:
- Start a separate subtask in Translate mode for this language and JSON file to add the missing translations. Do not try to process multiple languages or JSON files in one subtask.

## Translation Guidelines

When translating, follow these key rules:

1. **Supported Languages**: ar, ca, cs, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, th, tr, uk, vi, zh-CN, zh-TW
2. **Voice**: Always use informal speech (e.g., "du" not "Sie" in German)
3. **Technical Terms**: Don't translate "token", "API", "prompt" and domain-specific technical terms
4. **Placeholders**: Keep `{{variable}}` placeholders exactly as in the English source
5. **Validation**: Run `node scripts/find-missing-translations.js` to validate changes

For comprehensive translation guidelines including language-specific rules, see `.kilocode/skills/translation/SKILL.md`.
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

Kilo Code is an open source AI coding agent for VS Code that generates code from natural language, automates tasks, and supports 500+ AI models.

## Mode-Specific Rules
## Skills

For mode-specific guidance, see the following files:
- **Translation**: `.kilocode/skills/translation/SKILL.md` - Translation and localization guidelines

- **Translate mode**: `.roo/rules-translate/AGENTS.md` - Translation and localization guidelines
## Workflows

- **Add Missing Translations**: `.kilocode/workflows/add-missing-translations.md` - Run `/add-missing-translations` to find and fix missing translations

## Changesets

Expand Down
38 changes: 29 additions & 9 deletions cli/src/state/atoms/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,10 @@ function handleTextInputKeys(get: Getter, set: Setter, key: Key) {
}

function handleGlobalHotkeys(get: Getter, set: Setter, key: Key): boolean {
// Debug logging for key detection
if (key.ctrl || key.sequence === "\x16") {
// Debug logging for key detection (Ctrl or Meta/Cmd keys)
if (key.ctrl || key.meta || key.sequence === "\x16") {
logs.debug(
`Key detected: name=${key.name}, ctrl=${key.ctrl}, meta=${key.meta}, sequence=${JSON.stringify(key.sequence)}`,
`Key detected: name=${key.name}, ctrl=${key.ctrl}, meta=${key.meta}, shift=${key.shift}, paste=${key.paste}, sequence=${JSON.stringify(key.sequence)}`,
"clipboard",
)
}
Expand All @@ -916,9 +916,9 @@ function handleGlobalHotkeys(get: Getter, set: Setter, key: Key): boolean {
}
break
case "v":
// Ctrl+V - check for clipboard image
if (key.ctrl) {
logs.debug("Detected Ctrl+V via key.name", "clipboard")
// Ctrl+V or Cmd+V (macOS) - check for clipboard image
if (key.ctrl || key.meta) {
logs.debug(`Detected ${key.meta ? "Cmd" : "Ctrl"}+V via key.name`, "clipboard")
// Handle clipboard image paste asynchronously
handleClipboardImagePaste(get, set).catch((err) =>
logs.error("Unhandled clipboard paste error", "clipboard", { error: err }),
Expand Down Expand Up @@ -977,19 +977,39 @@ function handleGlobalHotkeys(get: Getter, set: Setter, key: Key): boolean {
}

/**
* Handle clipboard image paste (Ctrl+V)
* Atom to trigger clipboard image paste from external components (e.g., KeyboardProvider)
* This is used when a paste timeout occurs (e.g., Cmd+V with image in clipboard)
*/
export const triggerClipboardImagePasteAtom = atom(null, async (get, set, fallbackText?: string) => {
await handleClipboardImagePaste(get, set, fallbackText)
})

/**
* Handle clipboard image paste (Ctrl+V or Cmd+V on macOS)
* Saves clipboard image to a temp file and inserts @path reference into text buffer
* If fallbackText is provided and no image is found, broadcasts the fallback text as a paste event
*/
async function handleClipboardImagePaste(get: Getter, set: Setter): Promise<void> {
async function handleClipboardImagePaste(get: Getter, set: Setter, fallbackText?: string): Promise<void> {
logs.debug("handleClipboardImagePaste called", "clipboard")
try {
// Check if clipboard has an image
logs.debug("Checking clipboard for image...", "clipboard")
const hasImage = await clipboardHasImage()
logs.debug(`clipboardHasImage returned: ${hasImage}`, "clipboard")
if (!hasImage) {
setClipboardStatusWithTimeout(set, "No image in clipboard", 2000)
logs.debug("No image in clipboard", "clipboard")
// If fallback text provided, broadcast it as paste event
if (fallbackText) {
logs.debug("Using fallback text for paste", "clipboard")
set(broadcastKeyEventAtom, {
name: "",
ctrl: false,
meta: false,
shift: false,
paste: true,
sequence: fallbackText,
})
}
return
}

Expand Down
33 changes: 21 additions & 12 deletions cli/src/ui/providers/KeyboardProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import {
setDebugLoggingAtom,
clearBuffersAtom,
setupKeyboardAtom,
triggerClipboardImagePasteAtom,
} from "../../state/atoms/keyboard.js"
import {
parseKittySequence,
isPasteModeBoundary,
isFocusEvent,
mapAltKeyCharacter,
parseReadlineKey,
createPasteKey,
createSpecialKey,
} from "../utils/keyParsing.js"
import { autoEnableKittyProtocol } from "../utils/terminalCapabilities.js"
Expand Down Expand Up @@ -68,6 +68,7 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
const setDebugLogging = useSetAtom(setDebugLoggingAtom)
const clearBuffers = useSetAtom(clearBuffersAtom)
const setupKeyboard = useSetAtom(setupKeyboardAtom)
const triggerClipboardImagePaste = useSetAtom(triggerClipboardImagePasteAtom)

// Jotai getters (for reading current state)
const pasteBuffer = useAtomValue(pasteBufferAtom)
Expand Down Expand Up @@ -97,17 +98,23 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
// Handle paste completion
const completePaste = useCallback(() => {
const currentBuffer = pasteBufferRef.current
if (isPasteRef.current && currentBuffer) {
const wasPasting = isPasteRef.current

// Reset paste state
setPasteMode(false)
isPasteRef.current = false
pasteBufferRef.current = ""

if (wasPasting) {
// Normalize line endings: convert \r\n and \r to \n
// This handles different line ending formats from various terminals/platforms
const normalizedBuffer = currentBuffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n")

broadcastKey(createPasteKey(normalizedBuffer))
setPasteMode(false)
isPasteRef.current = false
pasteBufferRef.current = ""
const normalizedBuffer = currentBuffer ? currentBuffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n") : ""
// Always check clipboard for image first (prioritize image over text)
// If no image found, the fallback text will be used
// This handles: Cmd+V with image file copied from Finder (terminal sends filename as text)
triggerClipboardImagePaste(normalizedBuffer || undefined)
}
}, [broadcastKey, setPasteMode])
}, [setPasteMode, triggerClipboardImagePaste])

useEffect(() => {
// Save original raw mode state
Expand Down Expand Up @@ -414,9 +421,10 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
// Clear timers
clearBackslashTimer()

// Flush any pending buffers
completePaste()
clearBuffers()
// DON'T flush paste buffers here - React StrictMode causes re-mounts
// that would interrupt an in-progress paste operation.
// The paste buffer refs persist across re-mounts and will be
// properly flushed when the paste end marker is received.
}
}, [
stdin,
Expand All @@ -431,6 +439,7 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
setKittyProtocol,
pasteBuffer,
kittyBuffer,
triggerClipboardImagePaste,
isKittyEnabled,
isDebugEnabled,
completePaste,
Expand Down
20 changes: 0 additions & 20 deletions src/api/providers/__tests__/kilocode-openrouter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,26 +259,6 @@ describe("KilocodeOpenrouterHandler", () => {
expect(handler.supportsFim()).toBe(false)
})

it("completeFim handles errors correctly", async () => {
const handler = new KilocodeOpenrouterHandler({
...mockOptions,
kilocodeModel: "mistral/codestral-latest",
})

const mockResponse = {
ok: false,
status: 500,
statusText: "Internal Server Error",
text: vitest.fn().mockResolvedValue("Error details"),
}

global.fetch = vitest.fn().mockResolvedValue(mockResponse)

await expect(handler.completeFim("prefix", "suffix")).rejects.toThrow(
"FIM streaming failed: 500 Internal Server Error - Error details",
)
})

it("streamFim yields chunks correctly", async () => {
const handler = new KilocodeOpenrouterHandler({
...mockOptions,
Expand Down
Loading