fix(web): harden typed SPA chat lifecycle

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
This commit is contained in:
shaggy (mosaic-dev box)
2026-08-10 00:24:20 -05:00
co-authored by Claude Haiku 4.5
parent b2e005f2b4
commit caebf9ef70
20 changed files with 1778 additions and 125 deletions
+18
View File
@@ -0,0 +1,18 @@
/**
* Bounds on server-fed chat state. A hostile or malfunctioning gateway can
* flood any of these collections; caps keep memory/render cost flat instead
* of growing unboundedly for the lifetime of the connection.
*/
/** Max characters retained for the in-flight streamed text/thinking buffers. */
export const MAX_STREAM_CHARS = 20_000;
/** Max transcript turns retained (oldest dropped first). */
export const MAX_MESSAGES = 500;
/** Max tool-call entries (including anomaly entries) retained per turn history. */
export const MAX_TOOLS = 200;
/** Max slash-command results retained. */
export const MAX_COMMAND_RESULTS = 200;
/** Max commands/skills accepted from a single manifest push. */
export const MAX_MANIFEST_ITEMS = 500;
/** Max executed approval IDs remembered for single-flight dedup. */
export const MAX_EXECUTED_APPROVAL_IDS = 200;