Skip to content

Commit a4d63b2

Browse files
authored
Merge pull request #311348 from microsoft/cherry-pick/311331
[cherry-pick] Refactor auto mode hints logic to include 'auto' in model hints for editor location
2 parents dab10da + b64c9fe commit a4d63b2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

extensions/copilot/src/platform/endpoint/node/automodeService.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,18 @@ class AutoModeTokenBank extends Disposable {
6363
this._fetchedValue = this._register(createCapiClientFetchedValue<AutoModeAPIResponse>(capiClientService, envService, {
6464
request: async () => {
6565
const authToken = (await authService.getCopilotToken()).token;
66-
const autoModeHint = expService.getTreatmentVariable<string>(expName) || 'auto';
66+
const extValue = expService.getTreatmentVariable<string>(expName);
67+
const model_hints = [extValue || 'auto'];
68+
if (location === ChatLocation.Editor && model_hints[0] !== 'auto') {
69+
model_hints.push('auto');
70+
}
6771
return {
6872
headers: {
6973
'Content-Type': 'application/json',
7074
'Authorization': `Bearer ${authToken}`,
7175
},
7276
method: 'POST' as const,
73-
json: { auto_mode: { model_hints: [autoModeHint] } },
77+
json: { auto_mode: { model_hints } },
7478
};
7579
},
7680
requestMetadata: { type: RequestType.AutoModels },

0 commit comments

Comments
 (0)