fix(proxy): make TokenSaver message compression opt-in#2
Merged
Conversation
The proxy silently truncated any message content over 8000 chars and rewrote git diffs/JSON by default — fatal for a drop-in OpenAI-compatible proxy carrying long coding-agent contexts, and invisible to the client. Compression now requires TOKEN_SAVER_ENABLED=true (config.tokenSaverEnabled). Default behavior is byte-for-byte passthrough. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
问题
代理默认对超过 8000 字符的消息静默截断(并改写 git diff / JSON),客户端无从知晓。作为 drop-in OpenAI 兼容代理,接长上下文 coding agent 时这是致命行为。
修复
压缩改为显式 opt-in:
TOKEN_SAVER_ENABLED=true(config.tokenSaverEnabled)。默认逐字节透传。.env.example补充说明。测试
🤖 Generated with Claude Code