[fix]: 修复会话与失败请求恢复,完善 Provider 错误分类和展示 - #1
Merged
Conversation
- 复用当前 turn 的已压缩状态,继续压缩既有摘要与新增工具结果 - 保留 turn、canonical 边界及上下文续写尾部保护 - 补充连续自动压缩和上下文满后强制压缩的完整工具循环回归测试
- 接入确定性拒绝的 WAL 回滚与 journal 恢复,接受内部响应后清除发送歧义 - 统一利用错误 code/type 分类,只有明确媒体错误才触发媒体清理重试 - 二次拒绝丢弃失败 turn,保留历史媒体清理边界及跨 identity 重建语义 - 修复 continuation 原始/发送窗口差异,以及连续 context 拒绝后的再次压缩 - 补充恢复与协议回归测试,保持连续压缩修复并同步核心行为文档
- 手动压缩前收束残留拒绝恢复,避免下次输入覆盖新摘要 - 三类 adapter 在续写前保存独立响应快照与恢复游标 - 非流式 fallback 正文写入 journal,续写失败仍保留已接受内容 - 增加跨 adapter、WAL 重建和 journal checkpoint 回归测试
- 保留工具参数恢复、Finalizing resume 与拒绝恢复两侧逻辑 - 解决协议与测试冲突,补齐 Chat 拒绝字段测试初始化 - 合并结果通过 2878 项 Rust 测试、静态检查及终端回归
- 上下文窗口拒绝只取决于请求内容,不再被更早的发送歧义降级为 TerminalFailure,仍进入压缩重试 - 拒绝恢复 sidecar 在对应 turn 写下终态后只删除记录,不再重放回滚覆盖之后的 compaction 写入 - 删除 provider_compaction_before_turn 的死兜底分支 - 补齐 Provider 确定性拒绝恢复 PRD 与核心行为文档,新增两条回归测试
- 仅依据明确的结构化图片错误码触发附件剥离,移除错误正文推断逻辑 - 将 unsupported_media_type 保留为普通请求拒绝,避免误删历史附件 - 补齐 HTTP、SSE 和 WebSocket 分类回归,保持 413 与 WS 1009 恢复行为 - 使用状态等待和就绪信号稳定 Maintainer、MCP 与后台进程测试 - 同步 PRD;通过全量测试、九组 TUI 及 resume 验收和 P0/P1 复审
- 展示上游错误原因,限制无消息时的正文兜底长度,保持恢复分类边界不变 - 集中维护错误码白名单,保留各协议既有的重试与拒绝识别范围 - 移除 TUI 失败兜底中的通用编辑提示,同步 PRD 已完成事项与日志边界 - 补充分类和展示回归测试,验证真实模型压缩及错误场景恢复
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.
概要
修复会话恢复、失败请求压缩和 Provider 确定性拒绝恢复,并完善上游错误展示。
会话恢复与压缩
/compact同时考虑 canonical 历史、turn journal 与失败 Provider WAL,使用与 turn 内压缩一致的 planner;连续失败保留恢复基线,压缩后的后续 turn 可继续压缩。Provider 拒绝恢复
invalid_image、invalid_image_url、image_too_large、unsupported_image。unsupported_media_type及仅正文提到图片的普通错误不会触发附件剥离。错误展示与维护性
message;缺少非空消息时显示正文,按 UTF-8 边界截断至 1000 字节并附省略号。结构化消息不受该兜底长度限制。Edit the prompt, retry, or /exit to finalize,保留 Attention 标题、虚线框和启动失败提示。验证
deepseek-v4-flash、关闭 WS、reasoningmax,覆盖工具调用、退出、resume 与后续对话。验收说明:
working_note当前只保存在进程内存,跨进程 resume 后列表为空;未把此列表的持久化作为本 PR 实现内容。历史信息在压缩后可继续用于对话,已单独验证。后续范围
fix/provider-history-recovery的修复已整合到本 PR,无需再次单独合并。