Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Commit b86ad3b

Browse files
committed
removing stale compaction item
1 parent 4d53076 commit b86ad3b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/platform/endpoint/node/responsesApi.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ import { getStatefulMarkerAndIndex } from '../common/statefulMarkerContainer';
3030
import { rawPartAsThinkingData } from '../common/thinkingDataContainer';
3131

3232
export function getResponsesApiCompactionThreshold(configService: IConfigurationService, expService: IExperimentationService, endpoint: IChatEndpoint): number | undefined {
33-
const contextManagementEnabled = !modelsWithoutResponsesContextManagement.has(endpoint.family);
33+
const contextManagementEnabled = configService.getExperimentBasedConfig(ConfigKey.ResponsesApiContextManagementEnabled, expService) && !modelsWithoutResponsesContextManagement.has(endpoint.family);
3434
if (!contextManagementEnabled) {
3535
return undefined;
3636
}
3737

38-
// return endpoint.modelMaxPromptTokens > 0
39-
// ? Math.floor(endpoint.modelMaxPromptTokens * 0.9)
40-
// : 50000;
41-
return 10000;
38+
return endpoint.modelMaxPromptTokens > 0
39+
? Math.floor(endpoint.modelMaxPromptTokens * 0.9)
40+
: 50000;
4241
}
4342

4443
export function createResponsesRequestBody(accessor: ServicesAccessor, options: ICreateEndpointBodyOptions, model: string, endpoint: IChatEndpoint): IEndpointBody {
@@ -628,7 +627,6 @@ export class OpenAIResponsesProcessor {
628627
if (this.latestCompactionOutputIndex !== undefined && chunk.output_index < this.latestCompactionOutputIndex) {
629628
return;
630629
}
631-
632630
this.latestCompactionOutputIndex = chunk.output_index;
633631
this.latestCompactionItem = compactionItem;
634632
this.sawCompactionMessage = true;

0 commit comments

Comments
 (0)