Skip to content

feat: NVIDIA thinking mode as opt-in toggle — full tool access by default for Kimi K2.5 / DeepSeek R1#6

Merged
codomium merged 6 commits intomainfrom
copilot/grep-feedback-system-qa-testing
Apr 17, 2026
Merged

feat: NVIDIA thinking mode as opt-in toggle — full tool access by default for Kimi K2.5 / DeepSeek R1#6
codomium merged 6 commits intomainfrom
copilot/grep-feedback-system-qa-testing

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 17, 2026

Kimi K2.5 and DeepSeek R1 were hardcoded to always use chat_template_kwargs: {thinking: true}, which causes NVIDIA NIM to reject any tools array (HTTP 400) — permanently disabling grep, bash, read, write, and all other agent tools for these models. Other IDEs (opencode, etc.) use the same API with full tool calling because they don't force thinking mode. This PR makes thinking mode opt-in and adds a live toggle in the chat UI.

Core behavior change (v2/src/core/agent-loop.mjs)

supportsThinking is now gated on an env var instead of model name alone:

// Before: thinking always on → tools always off
const supportsThinking = NVIDIA_THINKING_MODELS.has(model);

// After: opt-in via env var; default is full tool-calling
const thinkingEnabled = process.env.NVIDIA_THINKING_MODE === 'true';
const supportsThinking = thinkingEnabled && NVIDIA_THINKING_CAPABLE_MODELS.has(model);

In-panel toggle (media/chat.html / chat.js / chat.css)

  • 💭 Thinking label + pill toggle appended to the controls bar, only visible when Kimi K2.5 or DeepSeek R1 is selected
  • Toggle turns accent-colored when active for clear visual feedback
  • On change, sends { type: 'thinkingMode', enabled } to the extension; bridge restarts automatically so the new env var is picked up
  • State restored from saved config on panel open/reload via initialized message

Extension wiring (extension.js)

  • New thinkingMode message handler: persists nvidiaThinkingMode to workspace config and disposes the bridge
  • initialized payload now includes thinkingMode boolean
  • NVIDIA_THINKING_MODE env var passed to bridge subprocess from config value

Mode comparison

Mode Tools Thinking trace
Default (toggle off) ✅ All 25+ tools
Thinking mode (toggle on) ❌ workspace snapshot injected

Copilot AI and others added 6 commits April 17, 2026 20:46
…eepSeek R1)

- Add buildWorkspaceContent() to system-prompt.mjs: reads key project files
  (README, package.json, entry points, etc.) up to 64KB total and formats
  them as readable blocks for injection into thinking-model prompts
- Add buildThinkingModelSystemPrompt() to system-prompt.mjs: creates a
  thinking-model-specific system prompt that tells the model it has a
  workspace snapshot available and NOT to say it cannot see project files
- Update callNvidia() in agent-loop.mjs to use both new functions instead
  of the old file-tree-only injection
- Update vscode-extension/README.md and root README.md to document the
  enhanced workspace snapshot behavior

Agent-Logs-Url: https://github.com/codomium/CODE/sessions/75639e0f-6630-492c-9cd8-7769a1ebcbe6

Co-authored-by: codomium <255525663+codomium@users.noreply.github.com>
…ull tool calling by default

By default Kimi K2.5 and DeepSeek R1 now work with all 25+ tools (Read,
Write, Bash, Grep, etc.) exactly like Cursor/opencode. Thinking/reasoning
mode is opt-in via NVIDIA_THINKING_MODE=true env var or the new
openClaudeCode.nvidiaThinkingMode VSCode setting (default: false).

- Rename NVIDIA_THINKING_MODELS → NVIDIA_THINKING_CAPABLE_MODELS; gate
  supportsThinking on process.env.NVIDIA_THINKING_MODE === 'true'
- Add openClaudeCode.nvidiaThinkingMode boolean setting in package.json
- Pass NVIDIA_THINKING_MODE env var from extension.js to agent bridge
- Update model descriptions in package.json to reflect tool-calling default
- Update both READMEs with mode comparison table and updated behavior docs

Agent-Logs-Url: https://github.com/codomium/CODE/sessions/67a25766-01db-4fcc-b0be-87988bdc6ac2

Co-authored-by: codomium <255525663+codomium@users.noreply.github.com>
Adds a pill toggle switch directly in the chat controls bar that:
- Only appears when moonshotai/kimi-k2.5 or deepseek-ai/deepseek-r1 is selected
- Turns accent-colored when active so the user always knows the mode
- On change: saves openClaudeCode.nvidiaThinkingMode to workspace config and
  restarts the agent bridge so NVIDIA_THINKING_MODE env var is re-read
- State is restored on panel open / reload via the initialized message
- Model change also syncs toggle visibility automatically

Agent-Logs-Url: https://github.com/codomium/CODE/sessions/a4c71128-d85e-4a7d-b72f-b661759b9b70

Co-authored-by: codomium <255525663+codomium@users.noreply.github.com>
@codomium codomium marked this pull request as ready for review April 17, 2026 21:11
@codomium codomium merged commit c2039ed into main Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants