Repository navigation
fix: 恢复 Responses 有损历史跨账号续聊 - #834
Merged
Merged
Conversation
Owner
Author
|
维护复验当前
归属仍为本PR原 supervisor/唯一writer thread |
…t409-readable-continuation
12 tasks done
12 tasks done
…uction integration
ranxi2001
marked this pull request as ready for review
November 14, 2026 14:38
10 of 21 tasks
This was referenced Nov 14, 2026
Merged
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.
解决的问题与行为变化
开启既有
openai_409_omit_encrypted_history_enabled后,原账号不可用时,网关可从现存可读任务、完整工具调用和已完成结果重建 Responses 请求,选择合格账号继续同一客户端会话。旧不可读历史可能丢失,不承诺无损迁移或上游接受。默认仍关闭。本 PR 包含 HTTP JSON/SSE、原生 OAuth 转换、provider pointer 脱离,以及 WebSocket 当前轮尚未发送时的重新选号。已发送、交付不明、pending/failed/conflict owner、权限/额度拒绝或存储故障不能触发自动重放。原 A owner 不会改写成 B,已完成工具不自动重做。
成功交付的任务可在 Beta 开启时保留有界 readable shadow,供随后仅回带同一 opaque agent item 的请求恢复。记录按用户/API Key、分组、模型、会话和精确任务隔离;每个用户/API Key 最多 8 条,每条最多 64 KiB,TTL 最多 30 分钟。内容包含可读任务,属于 Redis 数据保留范围;恢复正文不进入普通日志、审计正文持久队列或处罚摘录。
恢复后的任务和上下文重新接受提示词审核及所选上游内容审核。正常请求的当前用户消息提取规则保持不变;已恢复请求的历史说明不会遮住前面的实际任务。
关联记录与来源
production;最终 head:62bd8651f91141b8e5784eb45e3b2d041b5e7902。已普通合入production@9aeeeb3a235014a09994ce5dc6c441edcdd9f1b3,保留 feat: scope content moderation to selected upstream accounts #848 所选上游审核、先前 fork 定制与原作者提交。随后 fix: 防止手动质量检测请求被抢占或覆盖 #849 合入,维护核对production@37dc4620a41a68abaeab329358c15821c41e3f7f与最终 head 的合并树f305ecaf81985dbaa516b3625c3a3f778291b885无冲突,双方产品文件不重叠。3db131a6b修复恢复上下文被最后历史说明遮挡的问题,并按实际协议区分 prompt close4403 与 legacy close1008;878b70857整理当前能力和历史文档;62bd8651f修复 CI 的 APT 镜像停滞,使用官方 HTTPS archive 和有界网络等待,产品逻辑未变。管理员新功能提示
复现与验收
使用隔离 Redis、虚构身份、localhost HTTP/WS provider 和内存工具账本。实际 handler/service/transport 执行 A→B→B,同一客户端保留任务、tools/schema、call/result,供应端验证 B 身份和旧 provider pointer 缺失;不能只凭 HTTP200 判断成功。
协议、调度与传输边界
实际验证
当前 head:
62bd8651f91141b8e5784eb45e3b2d041b5e7902。本轮维护仅静态源码/差异检查、远程 CI 和原始产物核对;未运行本地测试、lint、类型检查、构建或付费请求。下列结果均已按最终 head 回读;旧头结果不替代新头。go test -race -json -tags=unit ./internal/handler -run '^TestOpenAI409HTTPTaskRebuild$' -count=1 -timeout=5m,以及同 workflow 的边界、tools、混合 owner、规范化回归go test -race -json -tags=unit ./internal/handler -run '^TestOpenAI409WSReadableContinuation$' -count=1 -timeout=5m,以及同 workflow 的边界、ticket、namespace 和恢复审核用例go test -race -json -tags=unit ./internal/handler -run '^TestOpenAI409FutureShadowHTTP$' -count=1 -timeout=5m,以及同 workflow 的 scope、资源和精确任务关联go test -race -json -tags=integration ./internal/securityaudit -run '^TestRecoveredContextAsyncEnforcement$' -count=1 -timeout=5m,以及 workflow 中交付 epoch、审计持久化、OAuth 与 oracle 用例.github/workflows/encrypted-history-400.yml、encrypted-history-409.yml、Issue715/805、weekly429 与其他已触发回归make test-unit、make test-integration;前端关键测试/类型检查、lint 与安全扫描git diff --check origin/production...HEAD、源码调用链与合并树既往维护正文报告
afa7dbd6fccffef950febadc666b9243bba2454d的真实 API-key HTTP response-pointer 试验:同客户端 A 停用后,Beta off 本地409且无新增发送;Beta on 转到 B 完成纯函数工具循环,最终18。该记录是此前维护报告,本轮未重新执行或独立取得其原始报告;不扩展为当前 head、OAuth、opaque-agent 或 WS 的真实供应商成功。历史失败保留其归属:
3361f063c曾因恢复任务被最后历史说明遮住及 close code 断言不符而失败,后续产品修复为3db131a6b;不把这些候选失败当成预期 RED。旧源码 RED 必须到达业务断言,编译/skip/panic/race/无测试不算有效对照。UI:只修改既有设置的中英文提示,组件布局与交互未改;本轮静态核对文案及前端 CI,不声称新截图或生产 UI 验收。
兼容性与运行影响
文档与用户可见变化
docs/encrypted-history-readable-continuation.md为当前能力入口。shadow、HTTP/WS TDD 文档保留历史设计并明确阶段归属;不再把旧“尚未实现”的检查点当成最终产品状态。设置提示披露 Redis 保留和有损续接限制。Agent 使用声明
gpt-6-astra/xhigh,负责 HTTP/WS/shadow、回归和生产基线整合;fast 仅请求值,实际交付未确认。gpt-6.1-sol,推理强度未知(原运行未暴露);源码与远程证据复核。其他早期 Codex 记录的精确运行时型号/强度未知,保留原历史归属。提交前自查