mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
fix: respect 1M token context window for auto-condensing
- Update Task.ts to use actual context window from api.getModel().info - This ensures the 1M token extension is properly respected when enabled - Fixes auto-condensing triggering at base model limits instead of extended limits Fixes #9831
This commit is contained in:
parent
29385e01d7
commit
a2c10694e3
1 changed files with 8 additions and 4 deletions
|
|
@ -3338,10 +3338,12 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
const { profileThresholds = {} } = state ?? {}
|
||||
|
||||
const { contextTokens } = this.getTokenUsage()
|
||||
const modelInfo = this.api.getModel().info
|
||||
// Get the actual model info from the API handler which includes 1M context updates
|
||||
const actualModel = this.api.getModel()
|
||||
const modelInfo = actualModel.info
|
||||
|
||||
const maxTokens = getModelMaxOutputTokens({
|
||||
modelId: this.api.getModel().id,
|
||||
modelId: actualModel.id,
|
||||
model: modelInfo,
|
||||
settings: this.apiConfiguration,
|
||||
})
|
||||
|
|
@ -3483,10 +3485,12 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
const { contextTokens } = this.getTokenUsage()
|
||||
|
||||
if (contextTokens) {
|
||||
const modelInfo = this.api.getModel().info
|
||||
// Get the actual model info from the API handler which includes 1M context updates
|
||||
const actualModel = this.api.getModel()
|
||||
const modelInfo = actualModel.info
|
||||
|
||||
const maxTokens = getModelMaxOutputTokens({
|
||||
modelId: this.api.getModel().id,
|
||||
modelId: actualModel.id,
|
||||
model: modelInfo,
|
||||
settings: this.apiConfiguration,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue