summaryrefslogtreecommitdiff
path: root/Omni/Bild/Deps/accelerate.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-01 07:50:29 -0500
committerBen Sima <ben@bensima.com>2025-12-01 07:50:29 -0500
commitd701ca93850a2572eeea4029a3d53cd3138e601b (patch)
tree9fea8ebb2a3bec76f1862c4c4158df7eb14b2e13 /Omni/Bild/Deps/accelerate.nix
parent4919cf825d4fdbcecc1f69fcf2a32176dfdde5ac (diff)
Fix agent event content double-encoding in web UI
Excellent! The changes have been successfully applied. Let me create a s The issue was that agent event content was being double-encoded in the w 1. **ToolResult events** showed raw JSON like `{"output":"Replaced 1 occ 2. **Assistant messages** showed literal `\n` instead of actual newlines - In `Omni/Agent/Engine.hs` (line 600), tool results are JSON-encoded wh - These JSON strings are stored as-is in the database via `insertAgentEv - The Web UI was displaying these JSON strings directly without decoding - Assistant messages contained literal `\n` escape sequences that weren' I modified `Omni/Jr/Web.hs` with the following changes: 1. **Added import**: `Data.Aeson.KeyMap` to work with JSON objects 2. **Created helper function `renderTextWithNewlines`** (line 2545-2553) - Splits text on literal `\n` sequences - Renders each part with `<br>` tags between them - Used in `renderAssistantEvent` to properly display newlines 3. **Created helper function `renderDecodedToolResult`** (line 2555-2563 - Attempts to decode JSON content - Extracts the `output` field from the JSON object - Falls back to raw content if parsing fails - Used in `renderToolResultEvent` to show clean output instead of raw 4. **Updated `renderAssistantEvent`** (line 2473): - Changed from `Lucid.toHtml truncated` to `renderTextWithNewlines tr 5. **Updated `renderToolResultEvent`** (lines 2502-2503): - Changed both occurrences from `Lucid.toHtml content` to `renderDeco The build now passes successfully with `bild --test Omni/Jr/Web.hs`. Task-Id: t-200
Diffstat (limited to 'Omni/Bild/Deps/accelerate.nix')
0 files changed, 0 insertions, 0 deletions