openclaw-matrix-multiaccounts/ui/src/ui
Dave Lauer d03c404cb4
feat(compaction): add adaptive chunk sizing, progressive fallback, and UI indicator (#1466)
* fix(ui): allow relative URLs in avatar validation

The isAvatarUrl check only accepted http://, https://, or data: URLs,
but the /avatar/{agentId} endpoint returns relative paths like /avatar/main.
This caused local file avatars to display as text instead of images.

Fixes avatar display for locally configured avatar files.

* fix(gateway): resolve local avatars to URL in HTML injection and RPC

The frontend fix alone wasn't enough because:
1. serveIndexHtml() was injecting the raw avatar filename into HTML
2. agent.identity.get RPC was returning raw filename, overwriting the
   HTML-injected value

Now both paths resolve local file avatars (*.png, *.jpg, etc.) to the
/avatar/{agentId} endpoint URL.

* feat(compaction): add adaptive chunk sizing and progressive fallback

- Add computeAdaptiveChunkRatio() to reduce chunk size for large messages
- Add isOversizedForSummary() to detect messages too large to summarize
- Add summarizeWithFallback() with progressive fallback:
  - Tries full summarization first
  - Falls back to partial summarization excluding oversized messages
  - Notes oversized messages in the summary output
- Add SAFETY_MARGIN (1.2x) buffer for token estimation inaccuracy
- Reduce MIN_CHUNK_RATIO to 0.15 for very large messages

This prevents compaction failures when conversations contain
unusually large tool outputs or responses that exceed the
summarization model's context window.

* feat(ui): add compaction indicator and improve event error handling

Compaction indicator:
- Add CompactionStatus type and handleCompactionEvent() in app-tool-stream.ts
- Show '🧹 Compacting context...' toast while active (with pulse animation)
- Show '🧹 Context compacted' briefly after completion
- Auto-clear toast after 5 seconds
- Add CSS styles for .callout.info, .callout.success, .compaction-indicator

Error handling improvements:
- Wrap onEvent callback in try/catch in gateway.ts to prevent errors
  from breaking the WebSocket message handler
- Wrap handleGatewayEvent in try/catch with console.error logging
  to isolate errors and make them visible in devtools

These changes address UI freezes during heavy agent activity by:
1. Showing users when compaction is happening
2. Preventing uncaught errors from silently breaking the event loop

* fix(control-ui): add agentId to DEFAULT_ASSISTANT_IDENTITY

TypeScript inferred the union type without agentId when falling back to
DEFAULT_ASSISTANT_IDENTITY, causing build errors at control-ui.ts:222-223.
2026-01-23 06:32:30 +00:00
..
__screenshots__ refactor(ui): split render + connections 2026-01-14 05:40:14 +00:00
chat fix(ui): allow relative URLs in avatar validation 2026-01-22 12:09:27 -05:00
components test(ui): add tests for chat modules and update for icon refactor 2026-01-09 19:47:19 +01:00
controllers feat: extend Control UI assistant identity 2026-01-22 07:08:13 +00:00
data fix: sync Moonshot Kimi K2 models (#818) (thanks @mickahouan) 2026-01-13 03:19:49 +00:00
types test(ui): add tests for chat modules and update for icon refactor 2026-01-09 19:47:19 +01:00
views feat(compaction): add adaptive chunk sizing, progressive fallback, and UI indicator (#1466) 2026-01-23 06:32:30 +00:00
app-channels.ts feat: add Nostr channel plugin and onboarding install defaults 2026-01-20 20:15:56 +00:00
app-chat.ts feat: add agent avatar support (#1329) (thanks @dlauer) 2026-01-22 04:00:07 +00:00
app-defaults.ts refactor(ui): split app modules 2026-01-14 09:11:36 +00:00
app-events.ts refactor(ui): split render + connections 2026-01-14 05:40:14 +00:00
app-gateway.ts feat(compaction): add adaptive chunk sizing, progressive fallback, and UI indicator (#1466) 2026-01-23 06:32:30 +00:00
app-lifecycle.ts Add auto-refresh polling for debug view 2026-01-22 02:03:40 +00:00
app-polling.ts Add auto-refresh polling for debug view 2026-01-22 02:03:40 +00:00
app-render.helpers.ts ui: add onboarding mode for control ui 2026-01-22 11:40:33 +00:00
app-render.ts feat(compaction): add adaptive chunk sizing, progressive fallback, and UI indicator (#1466) 2026-01-23 06:32:30 +00:00
app-scroll.ts refactor(ui): split app modules 2026-01-14 09:11:36 +00:00
app-settings.test.ts fix: sync debug polling with route changes (#1373) (thanks @yazinsai) 2026-01-22 02:24:19 +00:00
app-settings.ts fix: sync debug polling with route changes (#1373) (thanks @yazinsai) 2026-01-22 02:24:19 +00:00
app-tool-stream.ts feat(compaction): add adaptive chunk sizing, progressive fallback, and UI indicator (#1466) 2026-01-23 06:32:30 +00:00
app-view-state.ts ui: add onboarding mode for control ui 2026-01-22 11:40:33 +00:00
app.ts feat(compaction): add adaptive chunk sizing, progressive fallback, and UI indicator (#1466) 2026-01-23 06:32:30 +00:00
assistant-identity.ts feat: extend Control UI assistant identity 2026-01-22 07:08:13 +00:00
chat-markdown.browser.test.ts feat(ui): add copy-as-markdown in chat 2026-01-21 02:58:56 +00:00
config-form.browser.test.ts fix: show raw any-map entries in config UI 2026-01-15 08:24:23 +00:00
device-auth.ts feat: wire role-scoped device creds 2026-01-20 13:04:19 +00:00
device-identity.ts fix: update device identity signing 2026-01-20 15:48:52 +00:00
focus-mode.browser.test.ts Config: schema-driven channels and settings 2026-01-17 00:43:05 +00:00
format.test.ts fix: strip thinking tags in chat UI 2026-01-09 05:24:11 +00:00
format.ts fix: strip thinking tags in chat UI 2026-01-09 05:24:11 +00:00
gateway.ts feat(compaction): add adaptive chunk sizing, progressive fallback, and UI indicator (#1466) 2026-01-23 06:32:30 +00:00
icons.ts refactor(ui): reuse emoji icon helpers 2026-01-21 02:58:56 +00:00
markdown.test.ts fix(ui): render markdown in chat 2026-01-04 21:51:26 +01:00
markdown.ts fix(ui): preserve ordered list numbering (#1341) - thanks @bradleypriest 2026-01-21 00:12:21 +00:00
navigation.browser.test.ts Config: schema-driven channels and settings 2026-01-17 00:43:05 +00:00
navigation.test.ts Config: schema-driven channels and settings 2026-01-17 00:43:05 +00:00
navigation.ts Config: schema-driven channels and settings 2026-01-17 00:43:05 +00:00
presenter.ts feat(ui): expand control dashboard 2025-12-21 00:34:39 +00:00
storage.ts feat(ui): add copy-as-markdown in chat 2026-01-21 02:58:56 +00:00
theme-transition.ts feat: add ui theme toggle 2025-12-30 20:25:58 +01:00
theme.ts feat: add ui theme toggle 2025-12-30 20:25:58 +01:00
tool-display.json feat: add gateway config/update restart flow 2026-01-08 01:30:02 +01:00
tool-display.ts feat: centralize tool display metadata 2026-01-03 13:18:27 +01:00
types.ts fix: harden Mattermost plugin gating (#1428) (thanks @damoahdominic) 2026-01-23 01:23:23 +00:00
ui-types.ts refactor: extend channel plugin boundary 2026-01-20 12:07:54 +00:00
uuid.test.ts fix(ui): robust UUID generation on HTTP 2026-01-03 13:43:20 +00:00
uuid.ts fix(ui): robust UUID generation on HTTP 2026-01-03 13:43:20 +00:00