Repository navigation
feat: 网关支持 409 历史密文省略(Beta) - #820
Merged
Merged
Conversation
This was referenced Nov 12, 2026
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.
解决的问题与行为变化
已完成的加密 agent 历史绑定原账号;原账号暂停或路线变化时,HTTP Responses 会在选号阶段返回本地 409。新增系统设置 → 网关设置 →「409 省略加密内容(Beta)」,默认关闭。开启后在首次上游发送前省略旧密文,保留可读上下文和工具关系,再通过正常准入选择账号。
这是有损恢复;当前任务、服务端会话指针、冲突/未确认交付、共享存储故障和 WebSocket 不适用。不改写任意供应商 409,不清 owner 缓存,不自动重放省略后的已发送请求。
关联记录与来源
管理员新功能提示
openai-409-omit-encrypted-history-beta,登记于frontend/src/constants/newFeatureNotices.ts。复现与验收
使用虚构密文、隔离 Redis 和 localhost HTTP 上游:A 生成并交付 agent 项,暂停 A 或改变其凭据,再提交同一 Key/会话的完整历史。关闭时保持 409;开启时仅省略旧密文,按普通准入发送一次。JSON/SSE、池不可用、当前任务拒绝、省略后上游拒绝和旧 owner 不变均有回归。
服务层另覆盖数字精度、可读工具参数和结果、当前用户/工具内容、指针/压缩状态、重复 JSON 键、默认关闭及取消。测试文件:
openai_409_omit_history_test.go(service/handler),设置 API 与 SettingsView 回归。协议、调度或传输改动补充
/v1/responses,API-key/OAuth 的现有原生 HTTP 路线,JSON/SSE;WebSocket 不启用此恢复。agent_message.encrypted_content+ 可读后续用户任务 → 带归属说明和省略标记的普通上下文 + 完整可读后续任务。实际验证
git diff --checkmake test-unit、make test-integrationmake test-frontend兼容性与运行影响
文档与用户可见变化
新增
docs/encrypted-history-409-beta.md,中英文入口、Beta 标识和适用边界提示。此 PR 不发布或部署。截图对应组件源码
b392e98f6cbfab0142c4786ea86c0ae87fcd2c3b,图片保存在本 PR 后续文档提交。实际组件 / 虚构数据:手机深色与英文截图。
Agent 使用声明
提交前自查