fix: hide system reminders in chat#45
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb94b6bfc3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return text | ||
| .replace(SYSTEM_REMINDER_PATTERN, "") | ||
| .replace(/\n{3,}/gu, "\n\n") | ||
| .trim(); |
There was a problem hiding this comment.
Avoid trimming normal assistant text in sanitizer
removeSystemReminderMarkup always applies .replace(/\n{3,}/, ...) and .trim() even when the message contains no <system_reminder> tag, so this commit now rewrites all assistant/reasoning/status output text rather than only removing internal markup. That can alter user-visible formatting (for example, leading indentation used for Markdown code blocks or intentional extra blank lines) in ordinary responses, which is a behavior regression unrelated to reminder removal.
Useful? React with 👍 / 👎.
Summary
Prevent raw
<system_reminder>XML from rendering in chat messages.Context
Resolves #31. System reminders can appear in assistant-visible transcript text, but that internal markup should not be displayed directly to users.
Changes
<system_reminder>...</system_reminder>blocks before messages reach the visible chat rows.Testing
cargo check --manifest-path src-tauri/Cargo.tomlgit diff --checkAttempted but unavailable in this environment:
bun test src/components/chat/ChatWorkRow.test.ts(bunis not installed)npx tsc -b(npxis not installed)Links