fix: skip Continue update status when updates are disabled
Continue still displayed Checking for updates even when version lookup was disabled. Skip the update service before it emits checking state and retain the lower-level lookup guard in the shared local and Agent adapter. Add a regression for disabled and normal update paths and record real terminal and production Electron validation. Seven real model requests returned HTTP 200; Linux validation covered startup only. The reported UI freeze was not reproduced, full Agent/model acceptance remains open, and full-suite failures are documented. Release note: 修复 Continue 禁用自动更新后仍显示 Checking for updates 的问题,终端现在保持正常空闲状态。
This commit is contained in:
@@ -78,6 +78,7 @@ async function createDistribution(version = '1.5.47'): Promise<{
|
||||
'let j=(0,atn.default)();j.use(atn.default.json()),j.get("/state"',
|
||||
'listen(i,async()=>{console.log(Ht.green(`Server started on http://localhost:${i}`))',
|
||||
'async function SCt(e){return n5e||',
|
||||
'async checkAndAutoUpdate(){throw new Error("Update check reached")}',
|
||||
'shouldUseResponsesEndpoint(t){return this.config.useResponsesApi===!1?!1:this.apiBase==="https://api.openai.com/v1/"&&A0e(t)}',
|
||||
'function uAe(e,t){let n={provider:e.provider,model:e.model,apiKey:e.apiKey,apiBase:e.apiBase,requestOptions:e.requestOptions,env:e.env};return CGn(n)??null}',
|
||||
'function Sin(e,t){let n=[];n.push({role:"system",content:t});let r=oot(e);return n.push(...r),n}',
|
||||
@@ -232,6 +233,20 @@ describe('ContinueHostAdapter', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('skips update work and checking state when updates are disabled', async () => {
|
||||
const distribution = await createDistribution()
|
||||
const adapter = new ContinueHostAdapter({ binaryPath: distribution.entryPath, configPath: '', workspace: process.cwd(), cacheRoot: distribution.cacheRoot, trustedBundleHashes: [distribution.sourceHash] })
|
||||
const prepared = await adapter.getPreparedHost()
|
||||
const bundle = await readFile(join(prepared.entryPath, '..', 'index.js'), 'utf8')
|
||||
const method = bundle.slice(bundle.indexOf('async checkAndAutoUpdate(){'), bundle.indexOf(';shouldUseResponsesEndpoint'))
|
||||
const service = new Function('process', `return {${method}}`)({ env: { GOODBUDDY_DISABLE_CONTINUE_UPDATES: '1' } })
|
||||
service.setState = vi.fn()
|
||||
await service.checkAndAutoUpdate()
|
||||
expect(service.setState).toHaveBeenCalledExactlyOnceWith({ autoUpdate: false, status: 'idle', message: 'Continue CLI', isUpdateAvailable: false })
|
||||
const enabled = new Function('process', `return {${method}}`)({ env: {} })
|
||||
await expect(enabled.checkAndAutoUpdate()).rejects.toThrow('Update check reached')
|
||||
})
|
||||
|
||||
it('rejects unsupported Continue versions without patching them', async () => {
|
||||
const distribution = await createDistribution('1.6.0')
|
||||
const adapter = new ContinueHostAdapter({
|
||||
|
||||
Reference in New Issue
Block a user