Taylor Ho 86cd8ab975 fix: strip XML wrapper from replayed user messages (#150)
* fix: strip XML wrapper from replayed user messages

When loading a previous session, user messages were displayed with raw
XML tags (<persona-instructions>, <user-message>, etc.) because the
goose binary stores the full wrapped prompt in its session history.

Add extract_user_message() to parse out just the <user-message> content
before emitting it to the frontend during session replay.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: move dispatcher tests to separate file to stay under line limit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt and trim to file size limit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove blank line to satisfy file size check

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: anchor XML close tag to end of string to avoid truncating user input

Addresses review feedback: if a user's message literally contains
"</user-message>", the previous find()-based approach would truncate.
Now we require the close tag to be at the end of the string, matching
the backend's wrapping format exactly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 11:10:29 -10:00
S
Description
No description provided
Apache-2.0 1.5 GiB
Languages
Rust 63.6%
TypeScript 29.6%
JavaScript 1.7%
Shell 1.6%
Python 1.5%
Other 1.8%