Skip to content

fix: harden compaction, questions and session lifecycle - #55

Merged
kylinmac merged 5 commits into
mainfrom
codex/question-timeout-approval
Oct 29, 2026
Merged

kylinmac merged 5 commits into
mainfrom
codex/question-timeout-approval

Conversation

@kylinmac

@kylinmac kylinmac commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

改动

优化长会话压缩,并修复自动化会话在提问、审批和配置切换中的等待与状态误导;同时修复项目数据与运行生命周期问题。需求和验收分别记录为 R19 / V58、R20 / V59,缺陷记录 B-018–B-034。

  • 可选提问超时继续默认关闭,开启后可配置 10–300 秒,默认 30 秒。仅明确可选且推荐项有效的问题继续;重要决策、权限与计划审批仍等待用户。工具结果说明采用的假设,历史卡保留补选,回复进入原会话正常队列。
  • 摘要改为任务交接,预算允许时 4K–8K tokens 为软目标,小模型收到具体生成预算并优先完成关键交接。保留目标、约束与授权边界、关键决策、未完成工作、必要定位和验证结果,合并重复已完成事项;不为达标截断摘要或新增删除历史消息的规则。被模型输出上限截断的摘要不作为成功检查点保存。
  • 摘要继续使用会话模型,优先选择不高于 medium 的受支持推理等级;保留用户更低等级及省略推理的意图,只有更高等级可用时使用最低支持级别。正常任务的努力程度不变,Codex 请求不添加未经支持确认的输出参数。
  • 摘要请求复用流式静默保护,默认 180 秒无事件时先取消旧请求再有限重试。Stop、重试等待和完成竞态及时收尾;持续生成不被错误的 744 秒 RPC 总时限提前判失败。失败沿用手动报错、自动保留近期上下文的恢复语义。
  • 压缩显示等待模型、生成摘要、重试和独立耗时。运行中改模型/努力程度显示本轮结束后生效;配置串行应用,刷新和旧响应不覆盖新选择,失败明确显示未生效,显式调用仍抛错。
  • Auto guard 不再将 Docker --rm、普通搜索文本误报为破坏操作;未知下游执行器、真正危险命令仍保守询问。
  • 修复数据迁移和资源目录重命名后项目记忆、项目组及创作素材、存储配置、结果、脚本路径失联;并发 Remember 使用 Rust 锁内快照检查、重读合并及有限重试。
  • 修复晚到启动确认复活已结束任务、headless sidecar 崩溃未收尾、计划调度器销毁后仍启动;项目表单失败丢草稿、创作聊天漏显示提问及补选串会话。
  • 修复并发设置覆盖、无关设置误停语音、Hermes NUL 前缀消息截断,以及 TLS 握手取消导致未捕获 socket 异常。

复用既有队列、权限、恢复和流式保护;无新依赖、数据库迁移或权限放宽。详细位置与边界见 docs/mc-agent/project-review-2026-10-30.md、docs/mc-agent/compaction-performance.md。

更新说明(用户可见)

  • 优化:长会话摘要更聚焦后续工作,保留关键约束、决策、待办和验证结果,避免不断累积已完成事项。
  • 修复:压缩长时间无响应时会取消并有限重试;停止可及时结束等待,持续生成不会提前报 RPC 超时。
  • 优化:压缩显示生成阶段和独立耗时;模型与努力程度修改显示待生效、应用中或未生效,窄分栏也能看到。
  • 新功能:非关键提问可开启等待超时,Agent 按推荐方向继续,之后仍能补选。
  • 修复:全自动模式下普通命令误报、迁移后项目与创作文件失联、并发记忆与设置覆盖。
  • 修复:任务结束与进程崩溃后的假运行状态、表单丢草稿、创作提问不可见或补选串会话。
  • 修复:无关设置中断语音、Hermes 结构化消息漏导入、取消元数据请求触发连接异常。

刻意未改

不自动安装更新,不改写历史会话或扩大工具权限;不进行大范围重构。摘要篇幅是软目标,Codex 路径不添加未经支持确认的输出参数。

验证

  • 本轮完整 agent-runtime:1528 项通过;shared:1369 项通过。
  • 小预算补充回归:3 个文件、38 项通过,新增 1024-token 模型用例先失败再修复;类型与文档检查复跑通过。
  • 本轮桌面完整回归:4663 通过、0 失败、0 取消、4 跳过(4 并发);修正旧源码顺序断言后整套重跑通过。
  • 隔离 Electron:真实模型菜单/努力程度交互、待生效/应用中/失败、压缩等待/生成/重试及独立计时;使用临时 profile 与本地假服务。
  • 摘要回归覆盖输入与旧摘要保留、软目标不裁剪、推理映射与 omit、截断结果手动不落盘/自动恢复;流式回归覆盖静默、持续输出、重试耗尽、Stop、取消竞态及资源释放。
  • 本轮 TypeScript、i18n 31 项、Biome 148 个配置范围文件、样式 token、644 页文档与 diff 检查通过;9 种语言键完整,相对链接已核对。
  • 本 PR 前轮:Rust 1148 通过、1 忽略,fmt / Clippy 通过(既有警告);AgentHost 68、host-runtime 131 通过;隔离 Electron 项目编辑与提问路径通过。

未调用真实付费模型、生产服务,未修改或升级正在运行的安装版。真实模型的摘要语义保真与实际加速幅度尚未验证;失败恢复不是完整原文回放。未进行大范围重构,复杂 shell 的既有保守审批保留。

macheng added 3 commits October 30, 2026 00:14
Keep nonessential choices from blocking unattended work while preserving explicit permission and plan approvals. Retain timed-out cards for later answers and reject stale recovery snapshots so completed questions cannot reopen.
The Auto guard mistook Docker --rm and shutdown search patterns for host deletion and shutdown. Exclude only known text arguments and the Docker flag while retaining conservative checks for indirect execution, substitutions and real destructive commands.
Keep relocated project memory and creative assets reachable, and prevent concurrent memory or settings writes from discarding newer changes.

Preserve terminal turn states, clean up crashes and disposed plan dispatchers, and keep project drafts and creative questions bound to their session. Retain conservative pipeline approval checks, preserve Hermes structured messages, and avoid unhandled TLS cancellation errors.

Add regression coverage and document the project-wide review. Desktop tests pass with 4658 passed and 4 skipped; host-core has 1148 passed and 1 ignored.
@kylinmac kylinmac changed the title fix: reduce Auto approval false positives and add optional-question timeouts fix: harden question handling, project data and runtime lifecycle Oct 29, 2026
Long sessions accumulated oversized summaries and inherited expensive reasoning while summary streams bypassed idle protection. Preserve essential handoff context with a soft size target, bounded effort, cancellable streams and truthful progress.

Keep pending model settings visible and ordered until they take effect, preserving failure propagation for callers. Cover cancellation, truncated summaries, configuration races and narrow layouts with offline regressions.
@kylinmac kylinmac changed the title fix: harden question handling, project data and runtime lifecycle fix: harden compaction, questions and session lifecycle Oct 29, 2026
Tell summarizers the existing generation budget so small-output models prioritize a complete handoff instead of aiming beyond their limit. Preserve the original input and output cap, and cover the 1024-token case.
@kylinmac
kylinmac merged commit a3acdd8 into main Oct 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant