Skip to content

Commit fd2cab7

Browse files
roblourensisidorn
andauthored
introduce maxRequestsLimit (#282121)
introduce maxRequestsLimit (#281970) Co-authored-by: Isidor Nikolic <[email protected]>
1 parent 006e4ee commit fd2cab7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/contrib/chat/browser/chat.contribution.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,10 @@ class ChatAgentSettingContribution extends Disposable implements IWorkbenchContr
961961
const treatmentId = this.entitlementService.entitlement === ChatEntitlement.Free ?
962962
'chatAgentMaxRequestsFree' :
963963
'chatAgentMaxRequestsPro';
964-
this.experimentService.getTreatment<number>(treatmentId).then(value => {
964+
Promise.all([
965+
this.experimentService.getTreatment<number>(treatmentId),
966+
this.experimentService.getTreatment<number>('chatAgentMaxRequestsLimit')
967+
]).then(([value, maxLimit]) => {
965968
const defaultValue = value ?? (this.entitlementService.entitlement === ChatEntitlement.Free ? 25 : 25);
966969
const node: IConfigurationNode = {
967970
id: 'chatSidebar',
@@ -972,6 +975,7 @@ class ChatAgentSettingContribution extends Disposable implements IWorkbenchContr
972975
type: 'number',
973976
markdownDescription: nls.localize('chat.agent.maxRequests', "The maximum number of requests to allow per-turn when using an agent. When the limit is reached, will ask to confirm to continue."),
974977
default: defaultValue,
978+
maximum: maxLimit,
975979
},
976980
}
977981
};

0 commit comments

Comments
 (0)