fix(webui): upload TUI and WebUI attachments over binary HTTP (#5980)

* feat(webui): add bounded binary attachment staging

* feat(webui): bridge binary HTTP bodies alongside websocket listener

* fix(webui): deliver attachments over authenticated binary HTTP

* fix(webui): bound incomplete upload headers and preserve staging markers

* test: reflect aiohttp runtime dependency for binary uploads

* fix(webui): relay binary uploads and retain rejected drafts

* refactor(webui): remove obsolete attachment transport errors

* refactor(websocket): own binary attachment transport

* fix(websocket): allow bounded uploads over slow connections

* test(webui): restore upload timeout before retry

* docs(websocket): focus attachment guide on client usage
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-08 11:55:13 +08:00
1 parent 5be1e589f2
commit 6646f5fbee
53 files changed
+1972 -847

No files matched your search

+9 -2
View File
@@ -78,6 +78,7 @@ export interface SendOptions {
}
export interface SubmittedTurn {
delivery?: Promise<void>;
turnId: string;
userMessageId: string;
sideChannel: boolean;
@@ -993,8 +994,14 @@ export function useNanobotStream(
delete clientOptions.sideChannel;
delete clientOptions.finalizeActiveTurn;
delete clientOptions.continueActiveTurn;
client.sendMessage(chatId, outboundContent, wireMedia, clientOptions);
return { turnId, userMessageId, sideChannel };
const delivery = wireMedia?.length
? client.sendAttachments(chatId, outboundContent, wireMedia, clientOptions)
: undefined;
if (!delivery) client.sendMessage(chatId, outboundContent, undefined, clientOptions);
// Every caller may keep this promise to retain its draft until accepted.
// Also observe it here for queued/landing sends without an active composer.
void delivery?.catch(() => {});
return { turnId, userMessageId, sideChannel, delivery };
},
[chatId, clearActivitySegment, client, flushPendingStreamEvents, setMessages],
);