fix(web): hide injected system asides in user message bubbles - #1535
Conversation
🦋 Changeset detectedLatest commit: 99f739a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db51059bea
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const stripped = stripSystemTags(c.text); | ||
| if (stripped !== c.text && stripped.trim().length === 0) continue; | ||
| textParts.push(stripped); |
There was a problem hiding this comment.
Preserve literal system tags in user prompts
Because msg.content also carries verbatim user text for normal user/absent origins, stripping every <system>...</system> block here removes content when a user intentionally pastes or asks about that markup (for example XML/prompt examples). The bubble text and edit/resend payload derived from turn.text then no longer match what the user sent; restrict this to known injected captions/metadata instead of all user text parts.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ca156a804
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| web: Fix user-typed `<system>` text being removed from message bubbles and edit/resend payloads. |
There was a problem hiding this comment.
Remove the misleading duplicate changeset
This commit only ships the narrow image-compression caption stripping; ordinary user-typed <system> blocks were already preserved by the parent behavior and still are. Leaving this second changeset will produce a separate changelog entry claiming a user-visible fix that was not actually part of the release, alongside the real caption-hiding entry, so the release notes become misleading. Please fold or remove this changeset and keep one entry for the actual web fix.
Useful? React with 👍 / 👎.
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
No linked issue — see Problem.
Problem
When a user uploads a large image on the web UI, the server compresses it and inlines a model-facing
<system>Image compressed to fit model limits: …</system>aside next to the image. The web app rendered that aside verbatim as user text inside the message bubble, leaking harness markup that should stay hidden from the user.What changed
Strip every
<system>…</system>block from a user turn's text when converting messages to chat turns. It keys on the tag rather than on any specific caption wording, so the stripping stays robust to caption wording changes and also covers any other injected aside. Added regression tests for the standalone caption part, caption-only uploads, captions merged into prose, arbitrary<system>asides, and a guard that ordinary text and stray angle brackets are left untouched.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.