Default middle-out compression to on

This commit is contained in:
Matt Rubens 2025-03-02 18:04:22 -05:00
parent a253a37567
commit 9b91ab21b6
4 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
"roo-cline": patch
---
Default middle-out compression to on for OpenRouter

View file

@ -114,7 +114,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
stream: true,
include_reasoning: true,
// This way, the transforms field will only be included in the parameters when openRouterUseMiddleOutTransform is true.
...(this.options.openRouterUseMiddleOutTransform && { transforms: ["middle-out"] }),
...((this.options.openRouterUseMiddleOutTransform ?? true) && { transforms: ["middle-out"] }),
}
const stream = await this.client.chat.completions.create(completionParams)

View file

@ -2430,6 +2430,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
autoApprovalEnabled: autoApprovalEnabled ?? false,
customModes,
maxOpenTabsContext: maxOpenTabsContext ?? 20,
openRouterUseMiddleOutTransform: openRouterUseMiddleOutTransform ?? true,
}
}

View file

@ -498,7 +498,7 @@ const ApiOptions = ({
/>
)}
<Checkbox
checked={apiConfiguration?.openRouterUseMiddleOutTransform || false}
checked={apiConfiguration?.openRouterUseMiddleOutTransform ?? true}
onChange={handleInputChange("openRouterUseMiddleOutTransform", noTransform)}>
Compress prompts and message chains to the context size (
<a href="https://openrouter.ai/docs/transforms">OpenRouter Transforms</a>)