SIGN IN SIGN UP

fix(webview): throttle state pushes to prevent gray screen OOM (#1078)

* fix(webview): throttle large state updates

Coalesce repeated full-state webview updates with a leading and trailing debounce and a one-second maximum wait. Keep task-start, API-boundary, and stream-completion updates immediate, and flush pending state during partial-message initialization and task abort.

Reset aggregated task costs when switching tasks and ignore delayed responses for inactive tasks so stale per-task data is not retained or displayed.

Add regression coverage for debounce timing, flush and disposal behavior, partial-message ordering, queue failures, and task-switch cost cleanup.

Signed-off-by: JunyongParkDev <jun94.park@samsung.com>

* fix(task): preserve lifecycle on state push failures

Log throttled state scheduling and flush failures without dropping message persistence or abort cleanup. Cover Task rejection paths and failures from a pending debounced flush.

Signed-off-by: JunyongParkDev <jun94.park@samsung.com>

* refactor(webview): clarify throttled state semantics

Document the distinction between scheduling and flushing throttled state updates. Use the typed abort event in ordering coverage.

Signed-off-by: JunyongParkDev <jun94.park@samsung.com>

* fix(webview): skip unused task history computation

Avoid sorting task history for state payloads that omit it while preserving a single late history read for full-state payloads. Add focused regression coverage for both paths.

Signed-off-by: JunyongParkDev <jun94.park@samsung.com>

* test(webview): verify throttled flush completion

Strengthen the existing flush test to confirm that the provider waits for a pending asynchronous trailing state post and still invokes it exactly once.

Signed-off-by: JunyongParkDev <jun94.park@samsung.com>

* test(webview): use shared state fixture in chat tests

Align the rebased aggregated-cost task-state helper with the shared extension-state factory and provide the required history item fields.

Signed-off-by: JunyongParkDev <jun94.park@samsung.com>

---------

Signed-off-by: JunyongParkDev <jun94.park@samsung.com>
J
JunyongParkDev committed
8cac2ac9705984df037caae347ed09aea669e2de
Parent: d52f659
Committed by GitHub <noreply@github.com> on 8/16/2026, 9:18:09 PM