fix: remove tools from condensation metadata to fix 500 errors on proxies#11770
Draft
roomote[bot] wants to merge 1 commit intomainfrom
Draft
fix: remove tools from condensation metadata to fix 500 errors on proxies#11770roomote[bot] wants to merge 1 commit intomainfrom
roomote[bot] wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #11743
Description
This PR attempts to address Issue #11743 where context condensation fails with a 500 Internal Server Error when using the Roo Code Router.
Root cause: The condensation flow in
src/core/condense/index.tsalready converts alltool_useandtool_resultblocks to plain text, and theSUMMARY_PROMPTexplicitly instructs the model not to call tools. However, the three call sites inTask.tsthat trigger condensation were building and passing tool definitions (tools,tool_choice: "auto",parallelToolCalls: true) in the metadata. This inconsistent combination -- tool definitions present but no tool blocks in messages -- causes 500 errors on proxies like the Roo Code Router.Fix: Remove
tools,tool_choice, andparallelToolCallsfrom the condensation metadata in all three places inTask.ts:condenseContext()(manual condensation)handleContextWindowExceededError()(context window exceeded)recursivelyMakeClineRequests()(automatic context management)The metadata now only includes
modeandtaskId, which is consistent with the existing design intent.Feedback and guidance are welcome.
Test Procedure
Task.spec.tsverifying thatcondenseContext()does NOT passtools,tool_choice, orparallelToolCallstosummarizeConversationPre-Submission Checklist
Documentation Updates
Additional Notes
The
buildNativeToolsArrayWithRestrictionsimport inTask.tsis retained because it is still used for normal API calls (line ~4230).Interactively review PR in Roo Code Cloud