fix(session): unify prompt sends on prompt_async and suppress stale network banners

Remove the long-lived synchronous POST to /session/{id}/message that produced
spurious "Connection Failed" banners on transient network blips; route every
send (normal, streaming-queue follow-up, message refresh) through prompt_async,
whose failure genuinely means not-delivered. Suppress network-kind banners
while SSE is disconnected or reconnecting (the header already shows that state);
session-kind banners still appear and reconcile clears confirmed prompts after
reconnect.
This commit is contained in:
Chris Scott committed 2026-07-20 23:45:46 -04:00
1 parent 80bca441ed
commit 59fd516b75
9 files changed
+156 -167

No files matched your search

+7 -7
View File
@@ -116,28 +116,28 @@ export function useRefreshMessage({ opcodeUrl, sessionId, directory }: UseRefres
(old) => [...(old || []), optimisticMessageWithParts]
)
interface SendPromptRequest {
interface RefreshPromptRequest {
parts: Array<{ type: 'text'; text: string }>
model?: { providerID: string; modelID: string }
agent?: string
}
const requestData: SendPromptRequest = {
const requestData: RefreshPromptRequest = {
parts: [{ type: 'text', text: userMessageContent }]
}
if (model) {
const [providerID, modelID] = model.split('/')
if (providerID && modelID) {
requestData.model = { providerID, modelID }
}
}
if (agent) {
requestData.agent = agent
}
await client.sendPrompt(sessionId, requestData)
await client.sendPromptAsync(sessionId, requestData)
return { optimisticUserID, userMessageContent }
},