Files
Kilo-Org_kilo/packages/opencode
Marius 452ab52d47 feat: enable reasoning for Claude models via Kilo Gateway (#101)
* feat: enable reasoning for Claude models via Kilo Gateway

Enable extended thinking/reasoning support for Claude models when using
Kilo Gateway (OpenRouter-based). This includes:

- Add Kilo Gateway to OpenRouter SDK key mapping
- Skip toolCallId normalization for OpenRouter/Kilo to preserve thinking blocks
- Strip thinking/reasoning blocks from messages before sending to avoid
  Anthropic API signature validation errors (blocks must be unchanged)
- Skip caching for OpenRouter/Kilo to avoid modifying thinking blocks
- Add Claude-specific reasoning effort variants for Kilo Gateway
- Enable default medium reasoning effort for Claude via Kilo Gateway
- Add proper smallOptions handling for Claude vs other models

The key insight is that Anthropic's API requires thinking blocks to be
EXACTLY unchanged with valid signatures. Since our storage reconstructs
messages, we strip thinking blocks (already shown to user) rather than
risk signature validation failures.

* fix: drop empty messages after stripping thinking blocks
2026-02-04 12:19:02 +01:00
..
2026-01-27 16:09:11 +01:00
2026-02-03 09:31:47 -03:00
2026-01-24 12:27:13 -05:00
2026-01-28 14:27:18 +01:00
2026-02-02 12:47:09 +01:00
2026-01-26 14:59:23 +01:00
2026-02-03 13:22:03 +00:00
2025-05-30 20:48:36 -04:00
2025-12-02 18:36:15 -05:00
2025-10-14 18:30:32 -04:00

js

To install dependencies:

bun install

To run:

bun run index.ts

This project was created using bun init in bun v1.2.12. Bun is a fast all-in-one JavaScript runtime.