Fixes readme update#8
Conversation
Fly143
left a comment
There was a problem hiding this comment.
Thanks for the PR @PNP-MA! I went through it and most of the fixes listed are actually already implemented on the main branch:
- DSML tag sanitization →
tool_dsml.py+tool_sieve.py [citation:N]cleanup →tool_call.py:174- Multi-account 401 dead loop →
config.pymark_invalid() - Responses API fc_id consistency → full
/v1/responses/*endpoints - Session cleanup →
session_store.get_expired_sessions() - Anthropic multi-account + Vision →
config_manager.get_next_account() - Anthropic model aliases →
ANTHROPIC_MODEL_ALIASESinapp/anthropic_routes.py
The main novel contribution is context_manager.py for handling "Content is too long" errors — that's something we don't have yet and could be useful.
However, the proxy.py changes (+923/-213 lines) are based on an older version of the codebase and would conflict badly with recent additions: client-level WAF proxy support, SSE comment line fix, streaming text buffering fixes, etc.
Also, the PR includes a lot of unintended files that shouldn't be committed: Playwright debug logs (.playwright-mcp/console-*.log and page-*.yml), coverage cache (.coverage), orchestrator data (.sisyphus/), server logs (server.log).
Would you be able to open a cleaner PR with just context_manager.py and the minimal integration changes? That way we can review and merge it cleanly.
修复与改进
本项目持续修复了以下问题,按严重程度分类:
🚨 严重修复
context_manager.py模块,实现两级上下文裁剪:4 级渐进式清除(旧轮次→工具定义→历史消息→系统提示) + 2 级激进回退(激进裁剪→终极后备)。主入口enforce_context_limit()在请求发出前检查并自动裁减超长上下文。含 515 行单元测试 + 236 行集成测试。详见REMEDIATION_REPORT.md937f861proxy.py的 chat completions 路由和app/anthropic_routes.py的 Messages API 路由d51dbc150330d4/v1/messages端点未接入多账号轮询、ref_file_ids 硬编码为空、tool_result block 遗漏、工具定义未注入 prompt 等问题74fd560🧹 输出卫生修复
sanitize_leaked_output()过滤流式输出中泄漏的 DSML 格式标记(如<|end_of_sentence|>、<|tool|>),修复 Hermes 等工具对话时文本泄漏00451d9414298f[citation:N]清理[citation:N]引文标记的清洗15c6230、84a8447🔁 多账号修复
c78eedcrelogin()key 不一致relogin()中 key 名不一致导致 Token 写不回账号池c78eedc5169e26🧠 Responses API 修复
fc_id在 output_item 事件间不一致的问题8b04df0{}{}多余括号问题2f96cf4🗄️ 会话管理
session_store跟踪会话续期,TTL=3 天后自动清理。新增delete_sessionAPI、启动时清理、Vision 模式下归档旧会话。含管理面板手动清理按钮c50cbce、243ead2📱 管理面板 UI
nowrapd080908b56eb78📖 文档修复
d6f0113config.json,加入.gitignoredc5428c🔬 内部改进
ANTHROPIC_MODEL_ALIASES映射表,Claude Code CLI 等工具可使用claude-sonnet-4-6等 Anthropic 风格名调用71717e5app/anthropic_routes.py(APIRouter)+app/anthropic.py+app/batch.pyfaac19b