← Back to PRs

#22832: fix: strip [[reply_to_current]] directive from chat history

by willkriski open 2026-02-21 18:42 View on GitHub →
app: web-ui gateway size: XS
Codex 5.3 emits [[reply_to_current]] tags that leak into the web UI via chat.history. This strips them in sanitizeChatHistoryContentBlock, matching the same patterns already handled by parseInlineDirectives() on messaging-channel paths. <!-- greptile_comment --> <h3>Greptile Summary</h3> Added `stripChatDirectiveTags()` to remove Codex 5.3 directive tags (`[[reply_to_current]]`, `[[reply_to:...]]`, `[[audio_as_voice]]`) from chat history content blocks before serving to the web UI, matching the same patterns already handled by `parseInlineDirectives()` in `directive-tags.ts`. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The change is minimal and well-scoped: it adds a sanitization step to strip directive tags from chat history using a regex pattern that matches the existing implementation in `directive-tags.ts`. The logic correctly tracks whether changes were made and integrates cleanly into the existing sanitization pipeline. - No files require special attention <sub>Last reviewed commit: bc914bb</sub> <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs