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:
@@ -45,8 +45,10 @@ class MemoryAcpJournal implements RuntimeAcpJournal {
|
||||
mainAckSequence = '0'
|
||||
failAppend = false
|
||||
capacityBlocked = false
|
||||
appendAttempts = 0
|
||||
|
||||
appendAcpFrame(input: (typeof this.frames)[number]): { created: boolean } {
|
||||
this.appendAttempts += 1
|
||||
if (this.capacityBlocked) {
|
||||
throw new EventJournalCapacityError(
|
||||
'journal capacity',
|
||||
@@ -1251,6 +1253,34 @@ describe('RuntimeAcpBackend', () => {
|
||||
expect(fixture.outputFrames).toEqual(['later'])
|
||||
})
|
||||
|
||||
it('backs off while durable journal capacity remains unavailable', async () => {
|
||||
vi.useFakeTimers()
|
||||
try {
|
||||
const fixture = harness()
|
||||
await open(fixture)
|
||||
await invoke(
|
||||
fixture,
|
||||
'runtime/preparePrompt',
|
||||
fixture.preparation()
|
||||
)
|
||||
fixture.journal.capacityBlocked = true
|
||||
const output = fixture.process.emit('stdout', 'later')
|
||||
|
||||
await vi.advanceTimersByTimeAsync(775)
|
||||
expect(fixture.journal.appendAttempts).toBeLessThanOrEqual(6)
|
||||
expect(fixture.process.stops).toEqual([])
|
||||
|
||||
fixture.journal.capacityBlocked = false
|
||||
await vi.advanceTimersByTimeAsync(800)
|
||||
await output
|
||||
|
||||
expect(fixture.outputFrames).toEqual(['later'])
|
||||
await fixture.backend.dispose()
|
||||
} finally {
|
||||
vi.useRealTimers()
|
||||
}
|
||||
})
|
||||
|
||||
it('stops with output quota when the detached durable journal is exhausted', async () => {
|
||||
const fixture = harness()
|
||||
await open(fixture)
|
||||
|
||||
Reference in New Issue
Block a user