feat: keep-system-text mode — never image session config (compressSystem option)#105
Open
adrade2 wants to merge 1 commit into
Open
feat: keep-system-text mode — never image session config (compressSystem option)#105adrade2 wants to merge 1 commit into
adrade2 wants to merge 1 commit into
Conversation
…tem option) System-prompt-shaped content rendered inside user-message images trips Anthropic's reasoning_extraction refusal classifier (stop_reason: refusal on cold-start hellos; the same heuristic behind the banner/stub wording notes in transform.ts). Measured on production Claude Code traffic (events.jsonl 2026-07-11): 88/3448 (2.6%) refusals on reminder-imaged requests, 1/219 on other compressed, 0/6533 uncompressed. Wording tweaks lower the classifier score; keeping the config out of images clears it. - New TransformOptions.compressSystem (default true = unchanged). false skips the slab gate/render, the system-field rewrite, the first-message splice/5a, and env relocation; tool_result (5b) and history (6) compression still run, so discovery bulk keeps its savings. - PXPIPE_KEEP_SYSTEM_TEXT=1 env var (or config.json keepSystemText: true) makes the proxy pass compressSystem/compressTools/compressReminders all false — tool docs and reminders are config too and stubbed tools previously retripped the classifier (see 2026-07-02 wording note). - New HistoryCollapseOptions.preserveReminderText (default false = unchanged), set by the transform in keep mode: <system-reminder> text blocks in the protected head survive verbatim instead of tombstoning — without slab pages, that head text is the only copy of the session config (CLAUDE.md, memory index), and demoting it drops the operating instructions from context. Verified against captured production traffic: a previously-refused cold-start request forwards with system/tools/reminders as native text and zero images; a long session still images tool_results and collapses history (10 turns -> pages) with the opening reminder intact; default mode output is byte-identical to before.
Owner
|
Thanks for the contribution. I like the idea of allowing users to opt out of imaging the system prompt. The exact scope is open for discussion: it could preserve only the system prompt, or all session configuration, including tools and reminders. The current name suggests system-only behavior, while the implementation is broader. I’m open to either approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
System-prompt-shaped content rendered inside user-message images trips Anthropic's reasoning_extraction refusal classifier (stop_reason: refusal on cold-start hellos; the same heuristic behind the banner/stub wording notes in transform.ts). Measured on production Claude Code traffic (events.jsonl 2026-07-11): 88/3448 (2.6%) refusals on reminder-imaged requests, 1/219 on other compressed, 0/6533 uncompressed. Wording tweaks lower the classifier score; keeping the config out of images clears it.
Verified against captured production traffic: a previously-refused cold-start request forwards with system/tools/reminders as native text and zero images; a long session still images tool_results and collapses history (10 turns -> pages) with the opening reminder intact; default mode output is byte-identical to before.