AstrBot-Desktop/src-tauri/src
YokiiroBW c4c40bd561 fix(astrbot): do not resend messages after the response starts
`should_retry_astrbot` treated every `reqwest::Error` as retryable, but that
class covers both "the POST never left" and "the response body broke". `POST
/api/v1/chat` carries no idempotency key, so retrying the second case appended
the user's message to the remote conversation a second time, produced a second
answer, and interleaved the two attempts' deltas into one garbled bubble.

Retries are now limited to connect-phase failures, the one case where the
request provably never reached the server. Anything after that surfaces a
`streamInterrupted` code so the UI can offer a manual retry instead.

Also stops a send from checking the client out of its slot. The other five slot
commands read the client and report "not connected" when it is absent, so a
send disabled sessions, capabilities, upload, download, and session switching
for its whole duration. That window used to be bounded by the client's 120s
total timeout; now that streaming has no total deadline it would last as long
as the reply, so an ordinary long answer would disable the rest of the slot.
The client is cloned instead and concurrent sends are rejected with `slotBusy`.
(P2-13 / F-49, pulled forward from batch R7 because this batch is what made it
user-visible.)

Refs P1-2 / F-12.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 23:12:57 +08:00
..
credentials feat(pet): separate remote identity and add paper pet window 2026-07-20 16:28:42 +08:00
database feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
diagnostics feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
file_transfer feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
networking fix(astrbot): do not resend messages after the response starts 2026-07-26 23:12:57 +08:00
secure_store feat(chat): add AstrBot dual-slot chat foundation 2026-07-20 11:31:41 +08:00
windows feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
auth.rs feat(auth): add dashboard jwt login 2026-07-20 16:12:11 +08:00
lib.rs fix(chat): prevent duplicate history on session switch 2026-07-22 02:52:31 +08:00
logging.rs feat(foundation): add persistent bootstrap safeguards 2026-07-18 22:17:29 +08:00
main.rs feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
pet.rs feat(chat): add AstrBot dual-slot chat foundation 2026-07-20 11:31:41 +08:00
policy.rs feat(pet): separate remote identity and add paper pet window 2026-07-20 16:28:42 +08:00
profiles.rs feat(pet): separate remote identity and add paper pet window 2026-07-20 16:28:42 +08:00
quick_window.rs feat(window): persist quick chat geometry 2026-07-20 14:59:55 +08:00
runtime_guards.rs feat(connection): validate auto-connect and guard operations switches 2026-07-20 00:49:15 +08:00
slots.rs feat(pet): separate remote identity and add paper pet window 2026-07-20 16:28:42 +08:00