Commit graph

2943 commits

Author SHA1 Message Date
Hannes Rudolph
55e9c880d0
fix: gemini maxOutputTokens and reasoning config (#9375)
* fix: gemini maxOutputTokens and reasoning config

* test: tighten gemini reasoning typings
2025-11-18 19:52:50 -05:00
Daniel
0d72471956
fix: ensure no XML parsing when protocol is native (#9371)
* fix: ensure no XML parsing when protocol is native

* refactor: remove redundant non-null assertions
2025-11-18 18:30:57 -05:00
Matt Rubens
bc6fad1f9d
Add native tool calling support to OpenAI-compatible (#9369)
* Add native tool calling support to OpenAI-compatible

* Fix OpenAI strict mode schema validation by adding converter methods to BaseProvider

- Add convertToolsForOpenAI() and convertToolSchemaForOpenAI() methods to BaseProvider
- These methods ensure all properties are in required array and convert nullable types
- Remove line_ranges from required array in read_file tool (converter handles it)
- Update OpenAiHandler and BaseOpenAiCompatibleProvider to use helper methods
- Eliminates code duplication across multiple tool usage sites
- Fixes: OpenAI completion error: 400 Invalid schema for function 'read_file'

---------

Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
2025-11-18 18:20:51 -05:00
Daniel
b0c254cf5a
fix: exclude XML tool examples from MODES section when native protocol enabled (#9367) 2025-11-18 15:48:37 -05:00
Daniel
1fa12f6aa6
fix: resolve native tool protocol race condition causing 400 errors (#9363) 2025-11-18 13:43:10 -05:00
github-actions[bot]
67b6a8bb76
Changeset version bump (#9362)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-11-18 12:31:51 -05:00
Matt Rubens
bb31b04dba
chore: add changeset and announcement for v3.33.0 (#9360) 2025-11-18 12:26:41 -05:00
Matt Rubens
f455493af0
Remove the Roo model defaults (#9340) 2025-11-18 12:14:38 -05:00
Daniel
4bfd0709e4
fix: pass tool protocol parameter to lineCountTruncationError (#9358) 2025-11-18 11:29:19 -05:00
Hannes Rudolph
f8d6e12aa7
feat: enable native tool calling for openai-native provider (#9348)
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
2025-11-18 11:01:04 -05:00
Daniel
f5d3ac0e23
fix: sync parser state with profile/model changes (#9355) 2025-11-18 09:44:16 -05:00
Hannes Rudolph
f7c2e8d164
Improve Google Gemini defaults, temperature, and cost reporting (#9327) 2025-11-17 23:38:38 -07:00
Matt Rubens
c4f1ce5f91
Fix the type of the list files recursive parameter (#9337) 2025-11-18 01:00:37 -05:00
Matt Rubens
dbaaef756e
Remove experimental setting for native tool calls (#9333) 2025-11-17 23:37:36 -05:00
Daniel
e742511d90
fix: prevent infinite loop when attempt_completion succeeds (#9325) 2025-11-17 18:24:48 -05:00
Daniel
3631a02c8b
feat: add git status to environment details (#9310) 2025-11-17 14:10:32 -05:00
Daniel
fc19e7620b
fix: preserve tool blocks for native protocol in conversation history (#9319) 2025-11-17 14:07:17 -05:00
roomote[bot]
0e51a1ab9b
fix: Replace broken badgen.net badges with shields.io (#9318)
Co-authored-by: Roo Code <roomote@roocode.com>
2025-11-17 14:03:28 -05:00
Matt Rubens
3e0bd0ea55
Move the native tool call toggle to experimental settings (#9297)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
2025-11-17 09:41:30 -05:00
Daniel
744f4bd4c8
feat: implement dynamic tool protocol resolution with proper precedence hierarchy (#9286)
Co-authored-by: Roo Code <roomote@roocode.com>
2025-11-15 14:35:04 -05:00
Matt Rubens
4e316e0de8
Fix duplicate import (#9281) 2025-11-15 09:08:48 -05:00
Daniel
bc99f41a51
fix: prevent duplicate tool_result blocks in native tool protocol (#9248) 2025-11-14 23:04:02 -05:00
Daniel
375351616d
fix: format tool responses for native protocol (#9270)
* fix: format tool responses for native protocol

- Add toolResultFormatting utilities for protocol detection
- ReadFileTool now builds both XML and native formats
- Native format returns clean, readable text without XML tags
- Legacy conversation history conversion is protocol-aware
- All tests passing (55 total)

* refactor: use isNativeProtocol from @roo-code/types

Remove duplicate implementation and import from types package instead
2025-11-14 22:43:56 -05:00
Daniel
0a305310e5
refactor: centralize toolProtocol configuration checks (#9279)
* refactor: centralize toolProtocol configuration checks

- Created src/utils/toolProtocol.ts with getToolProtocolFromSettings() utility
- Replaced all direct vscode.workspace.getConfiguration() calls with centralized utility
- Updated 6 files to use the new utility function
- All tests pass and TypeScript compilation succeeds

* refactor: use isNativeProtocol function from types package
2025-11-14 20:24:40 -05:00
github-actions[bot]
64b1b62f5f
Changeset version bump (#9280)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-11-14 20:07:17 -05:00
Daniel
b2f204f123
Disable XML parser for native tool protocol (#9277) 2025-11-14 19:53:22 -05:00
Daniel
44b96f9d10
feat(openai-native): add abort controller for request cancellation (#9276) 2025-11-14 19:38:30 -05:00
Daniel
93c6d97017
Fix duplicate tool blocks causing 'tool has already been used' error (#9275) 2025-11-14 19:37:40 -05:00
Daniel
1b196461f3
fix: prevent duplicate tool_result blocks in native protocol mode for read_file (#9272)
When read_file encountered errors (e.g., file not found), it would call
handleError() which internally calls pushToolResult(), then continue to
call pushToolResult() again with the final XML. In native protocol mode,
this created two tool_result blocks with the same tool_call_id, causing
400 errors on subsequent API calls.

This fix replaces handleError() with task.say() for error notifications.
The agent still receives error details through the XML in the single
final pushToolResult() call.

This change works for both protocols:
- Native: Only one tool_result per tool_call_id (fixes duplicate issue)
- XML: Only one text block with complete XML (cleaner than before)

Agent visibility preserved: Errors are included in the XML response
sent to the agent via pushToolResult().

Tests: All 44 tests passing. Updated test to verify say() is called.
2025-11-14 17:47:39 -05:00
Hannes Rudolph
4a9ff8f4ef
[FIX] Fix OpenAI Native handling of encrypted reasoning blocks to prevent error when condensing (#9263) 2025-11-14 12:54:15 -05:00
github-actions[bot]
da461182ae
Changeset version bump (#9265)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-11-14 01:40:26 -05:00
Matt Rubens
ee64f44d2b
Revert "refactor(task): switch to <feedback> wrapper to prevent focus drift after context-management event (condense/truncate)" (#9261) 2025-11-14 00:43:45 -05:00
Hannes Rudolph
161345c6fa
revert out of scope changes from #9252 (#9258) 2025-11-14 00:19:09 -05:00
Hannes Rudolph
31f7372897
feat(openai): OpenAI Responses: model-driven prompt caching and generic reasoning options refactor (#9259) 2025-11-14 00:13:49 -05:00
Daniel
d139eff9fc
fix: prevent consecutive user messages on streaming retry (#9249) 2025-11-13 22:31:26 -05:00
Daniel
38e3529c1e
fix: make line_ranges optional in read_file tool schema (#9254)
The OpenAI tool schema required both 'path' and 'line_ranges' in FileEntry,
but the TypeScript type definition marks lineRanges as optional. This caused
the AI to fail when trying to read files without specifying line_ranges.

Changes:
- Updated read_file tool schema to only require 'path' parameter
- line_ranges remains available but optional, matching TypeScript types
- Aligns with implementation which treats lineRanges as optional throughout

Fixes issue where read_file tool kept failing with missing parameters.
2025-11-13 21:56:51 -05:00
Hannes Rudolph
01cb12f167
Add GPT-5.1 models and clean up reasoning effort logic (#9252)
* Reasoning effort: capability-driven; add disable/none/minimal; remove GPT-5 minimal special-casing; document UI semantics; remove temporary logs

* Remove Unused supportsReasoningNone

* Roo reasoning: omit field on 'disable'; UI: do not flip enableReasoningEffort when selecting 'disable'

* Update packages/types/src/model.ts

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>

* Update webview-ui/src/components/settings/SimpleThinkingBudget.tsx

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>

---------

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
2025-11-13 20:54:41 -05:00
Daniel
258830967a
fix: Filter native tools by mode restrictions (#9246)
* fix: filter native tools by mode restrictions

Native tools are now filtered based on mode restrictions before being sent to the API, matching the behavior of XML tools. Previously, all native tools were sent to the API regardless of mode, causing the model to attempt using disallowed tools.

Changes:
- Created filterNativeToolsForMode() and filterMcpToolsForMode() utility functions
- Extracted filtering logic from Task.ts into dedicated module
- Applied same filtering approach used for XML tools in system prompt
- Added comprehensive test coverage (10 tests)

Impact:
- Model only sees tools allowed by current mode
- No more failed tool attempts due to mode restrictions
- Consistent behavior between XML and Native protocols
- Better UX with appropriate tool suggestions per mode

* refactor: eliminate repetitive tool checking using group-based approach

- Add getAvailableToolsInGroup() helper to check tools by group instead of individually
- Refactor filterNativeToolsForMode() to reuse getToolsForMode() instead of duplicating logic
- Simplify capabilities.ts by using group-based checks (60% reduction)
- Refactor rules.ts to use group helper (56% reduction)
- Remove debug console.log statements
- Update tests and snapshots

Benefits:
- Eliminates code duplication
- Leverages existing TOOL_GROUPS structure
- More maintainable - new tools in groups work automatically
- All tests passing (26/26)

* fix: add fallback to default mode when mode config not found

Ensures the agent always has functional tools even if:
- A custom mode is deleted while tasks still reference it
- Mode configuration becomes corrupted
- An invalid mode slug is provided

Without this fallback, the agent would have zero tools (not even
ask_followup_question or attempt_completion), completely breaking it.
2025-11-13 20:50:57 -05:00
Hannes Rudolph
aaab2bf4d4
refactor(task): switch to <feedback> wrapper to prevent focus drift after context-management event (condense/truncate) (#9237)
* refactor(task): wrap initial user message in <feedback> instead of <task> to prevent focus drift after context-management

Rationale: After a successful context-management event, framing the next user block as feedback reduces model focus drift. Mentions parsing already supports <feedback>, and tool flows (attemptCompletion, responses) are aligned. No change to loop/persistence.

* refactor(mentions): drop <task> parsing; standardize on <feedback>; update tests
2025-11-13 20:02:57 -05:00
Daniel
5069ce92a0
fix: change tool_choice from required to auto for native protocol (#9242) 2025-11-13 15:16:15 -05:00
Daniel
237c324fcd
fix: resolve 400 error with native tools on OpenRouter (#9238) 2025-11-13 15:10:38 -05:00
Matt Rubens
d270ea1983
Consistently use Package.name for better support of the nightly app (#9240) 2025-11-13 15:07:14 -05:00
Daniel
5e6e601b0a
Add native tool call support (#9159)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-11-13 12:48:35 -05:00
github-actions[bot]
2b26cf3011
Changeset version bump (#9233)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-11-13 09:51:25 -05:00
Hannes Rudolph
7730c6f862
OpenAI Native: gate encrypted_content include; remove gpt-5-chat-latest verbosity flag (fixes #9225) (#9231)
openai-native: include reasoning.encrypted_content only when reasoningEffort is set; prevent Responses API error on non-reasoning models. types: remove supportsVerbosity from gpt-5-chat-latest to avoid invalid verbosity error. Fixes #9225
2025-11-13 09:29:31 -05:00
Hannes Rudolph
4e6cdad052
Fix: Roo Anthropic input token normalization (avoid double-count) (#9224) 2025-11-13 01:46:11 -05:00
Hannes Rudolph
bb6cac4980
rename: sliding-window -> context-management; truncateConversationIfNeeded -> manageContext (#9206) 2025-11-12 22:16:25 -05:00
github-actions[bot]
bbad2dcfdb
Changeset version bump (#9217)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-11-12 22:09:53 -05:00
Hannes Rudolph
0fdbd392e8
Migrate conversation continuity to plugin-side encrypted reasoning items (Responses API) (#9203)
* Migrate conversation continuity to plugin-side encrypted reasoning items (Responses API)

Summary
We moved continuity off OpenAI servers and now maintain conversation state locally by persisting and replaying encrypted reasoning items. Requests are stateless (store=false) while retaining the performance/caching benefits of the Responses API.

Why
This aligns with how Roo manages context and simplifies our Responses API implementation while keeping all the benefits of continuity, caching, and latency improvements.

What changed
- All OpenAI models now use the Responses API; system instructions are passed via the top-level instructions field; requests include store=false and include=["reasoning.encrypted_content"].
- We persist encrypted reasoning items (type: "reasoning", encrypted_content, optional id) into API history and replay them on subsequent turns.
- Reasoning summaries default to summary: "auto" when supported; text.verbosity only when supported.
- Atomic persistence via safeWriteJson.

Removed
- previous_response_id flows, suppressPreviousResponseId/skipPrevResponseIdOnce, persistGpt5Metadata(), and GPT‑5 response ID metadata in UI messages.

Kept
- taskId and mode metadata for cross-provider features.

Result
- ZDR-friendly, stateless continuity with equal or better performance and a simpler codepath.

* fix(webview): remove unused metadata prop from ReasoningBlock render

* Responses API: retain response id for troubleshooting (not continuity)

Continuity is stateless via encrypted reasoning items that we persist and replay. We now capture the top-level response id in OpenAiNativeHandler and persist the assistant message id into api_conversation_history.json solely for debugging/correlation with provider logs; it is not used for continuity or control flow.

Also: silence request-body debug logging to avoid leaking prompts.

* remove DEPRECATED tests

* chore: remove unused Task types file to satisfy knip CI

* fix(task): properly type cleanConversationHistory and createMessage args in Task to address Dan's review
2025-11-12 19:50:24 -05:00
Hannes Rudolph
8902facf49
fix: Apply updated API profile settings when provider/model unchanged (#9208) (#9210)
fix: apply updated API profile settings when provider/model unchanged (#9208)
2025-11-12 19:45:51 -05:00