Repository navigation
fix: 补齐 WS 后续轮错误采集与历史恢复诊断 - #880
Merged
Merged
Conversation
…-capture-20261116
…-capture-20261116
12 tasks done
7 tasks done
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.
解决的问题与行为变化
Responses WS 首轮结束后,第二轮及后续轮的错误可能没有出现在定向采集中。后续帧绕过了采集器的
ClientFrame;下游独立写入 context 丢失采集会话;透传还可能在终态写入记账之前接收下一轮,误判为重叠请求。历史 RED 还需将未选中的分组计费测试恢复至相同旧 API,避免 #878 新字段使旧源码编译失败;保留全部恢复断言和候选测试。
当未发送轮未能附加连接内历史时,补充固定原因、历史状态和数量日志,不记录任务正文、密文、响应 ID 或工具身份;恢复条件保持原样。新增脱敏断言防止诊断内容越界。
本次在处理器实际消费队列帧时开始新一轮采集,包含准入等待后保留的帧;为下游写入显式继承采集会话,并串行处理成功写入和终态提交。写入失败保留原错误并标记部分采集。修复范围是采集完整性,续接实现见 #877。
关联记录与来源
Refs #873、#875、#877。base 为
production,已同步da526bfba(#878)。当前 head600fd2f82f88e8e1f841fcf4f02e31eded1e83f1。无外仓实现引入。管理员新功能提示
不适用:已有定向采集内部修复,没有新增菜单或设置。提示 ID、标签展示位置、ID 沿用、关闭同步及 A→B→C/刷新/重登回归均不适用。
复现与验收
TestOpenAIWSFollowupErrorCapture使用真实 loopback WS 客户端、真实 handler、假 WS/HTTP 上游以及实际采集 Manager 和文件 writer。五种模式均检查:首轮成功不保留;第二轮response.failed只保留一个 turn=2 错误记录;包含客户端请求/响应和上游请求/响应四段;不混入首轮;上游调用数为 2。RED 恢复固定
2927209f5492d8cb690b83a1964b2f093c19ad7a的四个实现文件,要求 http_bridge/ctx_pool/shared/dedicated 命中FOLLOWUP_ERROR_CAPTURE_MISSING,passthrough 命中FOLLOWUP_ERROR_CAPTURE_WRONG_TURN;GREEN 使用当前 head 和相同业务断言。未运行真实供应商请求。协议、调度或传输改动补充
/v1/responsesWS,覆盖 http_bridge、ctx_pool、shared、dedicated、passthrough。response.create → response.completed;次轮response.create → response.failed;立即发送次轮后立即断开,验证采集归属。实际验证
git diff --checkgo test -race -json -tags=unit,plaintextowner,followupcapture ./internal/handler -run '^TestOpenAIWSFollowupErrorCapture$' -count=1 -timeout=3mgo test -race -tags=unit,followupcapture ./internal/service -run '^TestOpenAIWSUnsentHistoryDiagnostics$' -count=1 -timeout=2m当前精确头600fd2f82f88e8e1f841fcf4f02e31eded1e83f1全量CI已核:135 checks=89 success+46 skipped,traditional statuses 0。新增history diagnostics及完整生产增量独审未发现阻断。pending_last原断言保留且当前头通过;不据此宣称旧失败根因已查清。专用PG证据属于旧#855,不冒充当前头重跑。原客户端原会话A停调→B续答及工具循环、真实供应商均NOT EXECUTED;不关闭#854/#865,#884独立验收不被本PR代替。
兼容性与运行影响
文档与用户可见变化
既有错误采集可保留后续轮的四段证据。无 UI 改动,截图不适用。
Agent 使用声明
提交前自查