fix: preserve prompt text on network error and allow offline typing (#276)

* fix: preserve prompt text on network error and allow offline typing

* fix: preserve prompt on network error, swallow 524 to avoid duplicate sends

* feat: add service worker precaching with app shell and runtime cache strategies

* fix: copy frontend/plugins into Docker build context

* fix: improve service worker update checks with visibility and focus handlers

* fix: add connect timeout to event stream to recover from failed connections

* fix: remove optimistic message insert, keep prompt in input until server confirms
This commit is contained in:
Chris Scott authored and GitHub committed 2026-06-17 17:28:59 -04:00
1 parent a7d0c13f9a
commit 3e617c2df8
18 files changed
+569 -57

No files matched your search

@@ -44,6 +44,20 @@ describe('OpenCodeEventStream', () => {
expect(healthStates.at(-1)).toMatchObject({ isConnected: true, isHealthy: true, isStalled: false })
})
it('recovers when a connection never opens', async () => {
const transport = new TestEventStreamTransport()
const stream = new OpenCodeEventStream({ transport })
stream.subscribeGlobalMonitor({ directories: [], onEvent: vi.fn() })
expect(transport.openedUrls).toHaveLength(1)
await vi.advanceTimersByTimeAsync(10_000)
expect(transport.closeCount).toBeGreaterThan(0)
await vi.advanceTimersByTimeAsync(1_000)
expect(transport.openedUrls.length).toBeGreaterThan(1)
})
it('reconnects when the watchdog detects a stall', async () => {
const transport = new TestEventStreamTransport()
const stream = new OpenCodeEventStream({ transport })