mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
Fix SSE reliability and message delivery for production environments (#85)
* Switch to sync prompt endpoint for reliable message delivery Use the synchronous /message endpoint instead of /prompt_async to ensure the UI receives authoritative response data. This matches OpenCode TUI behavior and prevents message desync during sub-agent tasks. * Add SSE heartbeat to prevent Cloudflare 524 timeout
This commit is contained in:
1 parent
d78bb120ed
commit
a05535e0ef
6 files changed
+61
-10
No files matched your search
@@ -214,7 +214,8 @@ export const useSSE = (opcodeUrl: string | null | undefined, directory?: string,
|
||||
|
||||
setSessionStatus(sessionID, { type: 'idle' })
|
||||
|
||||
const currentData = queryClient.getQueryData<MessageListResponse>(['opencode', 'messages', opcodeUrl, sessionID, directory])
|
||||
const messagesQueryKey = ['opencode', 'messages', opcodeUrl, sessionID, directory]
|
||||
const currentData = queryClient.getQueryData<MessageListResponse>(messagesQueryKey)
|
||||
if (!currentData) break
|
||||
|
||||
const now = Date.now()
|
||||
@@ -253,7 +254,9 @@ export const useSSE = (opcodeUrl: string | null | undefined, directory?: string,
|
||||
}
|
||||
})
|
||||
|
||||
queryClient.setQueryData(['opencode', 'messages', opcodeUrl, sessionID, directory], updated)
|
||||
queryClient.setQueryData(messagesQueryKey, updated)
|
||||
|
||||
queryClient.invalidateQueries({ queryKey: messagesQueryKey })
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user