@@ -153,10 +153,10 @@ describe('applyLocalAction (side effects on process.env)', () => {
153153 beforeEach ( ( ) => {
154154 originalBaseUrl = process . env . CODEBUFF_BASE_URL
155155 originalApiKey = process . env . CODEBUFF_PROVIDER_API_KEY
156- originalModel = process . env . CODEBUFF_LOCAL_MODEL
156+ originalModel = process . env . CODEBUFF_PROVIDER_MODEL
157157 delete process . env . CODEBUFF_BASE_URL
158158 delete process . env . CODEBUFF_PROVIDER_API_KEY
159- delete process . env . CODEBUFF_LOCAL_MODEL
159+ delete process . env . CODEBUFF_PROVIDER_MODEL
160160 } )
161161
162162 afterEach ( ( ) => {
@@ -165,18 +165,18 @@ describe('applyLocalAction (side effects on process.env)', () => {
165165 if ( originalApiKey === undefined )
166166 delete process . env . CODEBUFF_PROVIDER_API_KEY
167167 else process . env . CODEBUFF_PROVIDER_API_KEY = originalApiKey
168- if ( originalModel === undefined ) delete process . env . CODEBUFF_LOCAL_MODEL
169- else process . env . CODEBUFF_LOCAL_MODEL = originalModel
168+ if ( originalModel === undefined ) delete process . env . CODEBUFF_PROVIDER_MODEL
169+ else process . env . CODEBUFF_PROVIDER_MODEL = originalModel
170170 } )
171171
172172 test ( 'enable without model sets baseUrl, clears any previous model override' , async ( ) => {
173- process . env . CODEBUFF_LOCAL_MODEL = 'stale-model'
173+ process . env . CODEBUFF_PROVIDER_MODEL = 'stale-model'
174174 const msg = await applyLocalAction ( {
175175 kind : 'enable' ,
176176 baseUrl : 'http://localhost:11434/v1' ,
177177 } )
178178 expect ( process . env . CODEBUFF_BASE_URL ) . toBe ( 'http://localhost:11434/v1' )
179- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBeUndefined ( )
179+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBeUndefined ( )
180180 expect ( msg ) . toContain ( 'ON' )
181181 expect ( msg ) . toContain ( 'No model override' )
182182 expect ( msg ) . toContain ( 'llama3.1:8b' )
@@ -189,7 +189,7 @@ describe('applyLocalAction (side effects on process.env)', () => {
189189 model : 'llama3.1:8b' ,
190190 } )
191191 expect ( process . env . CODEBUFF_BASE_URL ) . toBe ( 'http://localhost:11434/v1' )
192- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBe ( 'llama3.1:8b' )
192+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBe ( 'llama3.1:8b' )
193193 expect ( msg ) . toContain ( 'Model override: llama3.1:8b' )
194194 } )
195195
@@ -198,7 +198,7 @@ describe('applyLocalAction (side effects on process.env)', () => {
198198 kind : 'set-model' ,
199199 model : 'llama3.1:8b' ,
200200 } )
201- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBeUndefined ( )
201+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBeUndefined ( )
202202 expect ( msg ) . toContain ( 'OFF' )
203203 } )
204204
@@ -208,16 +208,16 @@ describe('applyLocalAction (side effects on process.env)', () => {
208208 kind : 'set-model' ,
209209 model : 'llama3.1:8b' ,
210210 } )
211- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBe ( 'llama3.1:8b' )
211+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBe ( 'llama3.1:8b' )
212212 expect ( msg ) . toContain ( 'Model override: llama3.1:8b' )
213213 } )
214214
215215 test ( 'clear-model removes only the model, keeps baseUrl' , async ( ) => {
216216 process . env . CODEBUFF_BASE_URL = 'http://localhost:11434/v1'
217- process . env . CODEBUFF_LOCAL_MODEL = 'llama3.1:8b'
217+ process . env . CODEBUFF_PROVIDER_MODEL = 'llama3.1:8b'
218218 const msg = await applyLocalAction ( { kind : 'clear-model' } )
219219 expect ( process . env . CODEBUFF_BASE_URL ) . toBe ( 'http://localhost:11434/v1' )
220- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBeUndefined ( )
220+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBeUndefined ( )
221221 expect ( msg ) . toContain ( 'cleared' )
222222 } )
223223
@@ -229,11 +229,11 @@ describe('applyLocalAction (side effects on process.env)', () => {
229229 test ( 'disable clears baseUrl, apiKey, and model' , async ( ) => {
230230 process . env . CODEBUFF_BASE_URL = 'http://localhost:11434/v1'
231231 process . env . CODEBUFF_PROVIDER_API_KEY = 'ollama'
232- process . env . CODEBUFF_LOCAL_MODEL = 'llama3.1:8b'
232+ process . env . CODEBUFF_PROVIDER_MODEL = 'llama3.1:8b'
233233 const msg = await applyLocalAction ( { kind : 'disable' } )
234234 expect ( process . env . CODEBUFF_BASE_URL ) . toBeUndefined ( )
235235 expect ( process . env . CODEBUFF_PROVIDER_API_KEY ) . toBeUndefined ( )
236- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBeUndefined ( )
236+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBeUndefined ( )
237237 expect ( msg ) . toContain ( 'OFF' )
238238 expect ( msg ) . toContain ( 'llama3.1:8b' )
239239 } )
@@ -251,7 +251,7 @@ describe('applyLocalAction (side effects on process.env)', () => {
251251
252252 test ( 'status when on with model shows both URL and model' , async ( ) => {
253253 process . env . CODEBUFF_BASE_URL = 'http://localhost:1234/v1'
254- process . env . CODEBUFF_LOCAL_MODEL = 'llama3.1:8b'
254+ process . env . CODEBUFF_PROVIDER_MODEL = 'llama3.1:8b'
255255 const msg = await applyLocalAction ( { kind : 'status' } )
256256 expect ( msg ) . toContain ( 'ON' )
257257 expect ( msg ) . toContain ( 'http://localhost:1234/v1' )
@@ -285,48 +285,48 @@ describe('parseLocalArgs + applyLocalAction end-to-end', () => {
285285
286286 beforeEach ( ( ) => {
287287 originalBaseUrl = process . env . CODEBUFF_BASE_URL
288- originalModel = process . env . CODEBUFF_LOCAL_MODEL
288+ originalModel = process . env . CODEBUFF_PROVIDER_MODEL
289289 delete process . env . CODEBUFF_BASE_URL
290- delete process . env . CODEBUFF_LOCAL_MODEL
290+ delete process . env . CODEBUFF_PROVIDER_MODEL
291291 } )
292292
293293 afterEach ( ( ) => {
294294 if ( originalBaseUrl === undefined ) delete process . env . CODEBUFF_BASE_URL
295295 else process . env . CODEBUFF_BASE_URL = originalBaseUrl
296- if ( originalModel === undefined ) delete process . env . CODEBUFF_LOCAL_MODEL
297- else process . env . CODEBUFF_LOCAL_MODEL = originalModel
296+ if ( originalModel === undefined ) delete process . env . CODEBUFF_PROVIDER_MODEL
297+ else process . env . CODEBUFF_PROVIDER_MODEL = originalModel
298298 } )
299299
300300 test ( 'user types `/local on llama3.1:8b` → URL default + model set' , async ( ) => {
301301 await applyLocalAction ( parseLocalArgs ( 'on llama3.1:8b' ) )
302302 expect ( process . env . CODEBUFF_BASE_URL ) . toBe ( DEFAULT_LOCAL_BASE_URL )
303- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBe ( 'llama3.1:8b' )
303+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBe ( 'llama3.1:8b' )
304304 } )
305305
306306 test ( 'user types `/local llama3.1:8b` (no `on`) → same effect' , async ( ) => {
307307 await applyLocalAction ( parseLocalArgs ( 'llama3.1:8b' ) )
308308 expect ( process . env . CODEBUFF_BASE_URL ) . toBe ( DEFAULT_LOCAL_BASE_URL )
309- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBe ( 'llama3.1:8b' )
309+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBe ( 'llama3.1:8b' )
310310 } )
311311
312312 test ( 'user types `/local on http://x/v1 llama3.1:8b` → both set' , async ( ) => {
313313 await applyLocalAction ( parseLocalArgs ( 'on http://x.example.com:9999/v1 llama3.1:8b' ) )
314314 expect ( process . env . CODEBUFF_BASE_URL ) . toBe ( 'http://x.example.com:9999/v1' )
315- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBe ( 'llama3.1:8b' )
315+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBe ( 'llama3.1:8b' )
316316 } )
317317
318318 test ( 'user types `/local model llama3.1:8b` after `/local on` → model added' , async ( ) => {
319319 await applyLocalAction ( parseLocalArgs ( 'on' ) )
320- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBeUndefined ( )
320+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBeUndefined ( )
321321 await applyLocalAction ( parseLocalArgs ( 'model llama3.1:8b' ) )
322- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBe ( 'llama3.1:8b' )
322+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBe ( 'llama3.1:8b' )
323323 } )
324324
325325 test ( 'user types `/local off` → both cleared' , async ( ) => {
326326 await applyLocalAction ( parseLocalArgs ( 'on llama3.1:8b' ) )
327327 await applyLocalAction ( parseLocalArgs ( 'off' ) )
328328 expect ( process . env . CODEBUFF_BASE_URL ) . toBeUndefined ( )
329- expect ( process . env . CODEBUFF_LOCAL_MODEL ) . toBeUndefined ( )
329+ expect ( process . env . CODEBUFF_PROVIDER_MODEL ) . toBeUndefined ( )
330330 } )
331331
332332 test ( 'mutations are visible via getter functions' , async ( ) => {
0 commit comments