mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix: preserve prompt on network error, swallow 524 to avoid duplicate sends
This commit is contained in:
1 parent
909effee28
commit
da28f58706
4 files changed
+51
-2
No files matched your search
@@ -9,7 +9,7 @@ import type {
|
||||
MessageWithParts,
|
||||
} from "../api/types";
|
||||
import type { paths, components } from "../api/opencode-types";
|
||||
import { parseNetworkError } from "../lib/opencode-errors";
|
||||
import { parseNetworkError, isGatewayTimeout } from "../lib/opencode-errors";
|
||||
import { showToast } from "../lib/toast";
|
||||
import { useSendErrorStore } from "../stores/sendErrorStore";
|
||||
import { useSessionStatus } from "../stores/sessionStatusStore";
|
||||
@@ -510,6 +510,10 @@ export const useSendPrompt = (opcodeUrl: string | null | undefined, directory?:
|
||||
(old) => old?.filter((msgWithParts) => !msgWithParts.info.id.startsWith("optimistic_")),
|
||||
);
|
||||
|
||||
if (isGatewayTimeout(error)) {
|
||||
return;
|
||||
}
|
||||
|
||||
useSessionStatus.getState().clearStatus(sessionID);
|
||||
|
||||
const parsed = parseNetworkError(error);
|
||||
|
||||
Reference in new issue
Block a user