fix: stabilize Runtime workflows for 0.12.3
OpenCode status checks could cold-start throwaway servers, unrelated conversations could block each other, and model, Continue, or remote paths could replay or duplicate work under failure and backlog conditions. Settings could also lose edits or overwrite unrelated model fields. This update makes status checks passive, keeps per-conversation ordering while allowing concurrency, preserves native long-running work with bounded display capture and backpressure, narrows retries to known pre-dispatch failures, and aligns remote Ask permissions without reducing Execute. It also keeps Embedding updates narrow, improves settings and browser guidance, removes the unused legacy Main gateway state, and records the validated Desktop 0.12.3 and Agent 0.11.17 release metadata. Release note: 改善 OpenCode 切换、多会话长任务、模型重试、远程 Ask/Execute 与设置保存可靠性,并完成 Desktop 0.12.3 / Agent 0.11.17 发布准备。
This commit is contained in:
@@ -1346,6 +1346,88 @@ describe('ContinueHostAdapter', () => {
|
||||
}
|
||||
)
|
||||
|
||||
it('stops forwarding later deltas after the patched stream overflows', async () => {
|
||||
const distribution = await createDistribution()
|
||||
let stateRequests = 0
|
||||
vi.stubGlobal(
|
||||
'fetch',
|
||||
vi.fn(async (input: string | URL | Request) => {
|
||||
if (String(input).endsWith('/state')) {
|
||||
stateRequests += 1
|
||||
return Response.json({
|
||||
session: {
|
||||
history:
|
||||
stateRequests < 4
|
||||
? []
|
||||
: [
|
||||
{
|
||||
message: {
|
||||
role: 'assistant',
|
||||
content: 'prefix missing suffix'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
isProcessing: stateRequests < 4,
|
||||
messageQueueLength: 0,
|
||||
pendingPermission: null,
|
||||
goodbuddyEvents:
|
||||
stateRequests === 2
|
||||
? [{ type: 'text', delta: 'prefix ' }]
|
||||
: stateRequests === 3
|
||||
? [{ type: 'text', delta: 'suffix' }]
|
||||
: [],
|
||||
goodbuddyEventsOverflow: stateRequests === 3
|
||||
})
|
||||
}
|
||||
return Response.json({})
|
||||
})
|
||||
)
|
||||
const forwarded: unknown[] = []
|
||||
const adapter = new ContinueHostAdapter({
|
||||
binaryPath: distribution.entryPath,
|
||||
configPath: '',
|
||||
workspace: process.cwd(),
|
||||
cacheRoot: distribution.cacheRoot,
|
||||
trustedBundleHashes: [distribution.sourceHash],
|
||||
launchHost: () => ({
|
||||
exitCode: null,
|
||||
killed: false,
|
||||
stderr: null,
|
||||
once: () => undefined,
|
||||
kill: () => true
|
||||
}),
|
||||
modelProfile: {
|
||||
id: randomUUID(),
|
||||
name: 'Local model',
|
||||
baseUrl: 'http://127.0.0.1:11434/v1',
|
||||
modelName: 'qwen3',
|
||||
protocol: 'openai-chat-completions',
|
||||
authentication: 'none'
|
||||
}
|
||||
})
|
||||
|
||||
await expect(
|
||||
adapter.run(
|
||||
'hello',
|
||||
new AbortController().signal,
|
||||
async () => 'deny',
|
||||
{
|
||||
onEvent: (event) => {
|
||||
forwarded.push(event)
|
||||
}
|
||||
}
|
||||
)
|
||||
).resolves.toMatchObject({
|
||||
text: 'prefix missing suffix',
|
||||
streamedText: true,
|
||||
streamTruncated: true
|
||||
})
|
||||
expect(forwarded).toEqual([
|
||||
{ type: 'text', delta: 'prefix ' }
|
||||
])
|
||||
})
|
||||
|
||||
it('forwards more than 100 unique tool calls', async () => {
|
||||
const distribution = await createDistribution()
|
||||
let stateRequests = 0
|
||||
|
||||
Reference in New Issue
Block a user