Skip to content

goal: crash-recovery re-evaluation inflates turns_used and duplicates continuations (F3) #285

Description

@LeXwDeX

发现(goal-loop 静默面审计,GOAL-FP-01-17 后续)

进程崩溃后重启时,GoalLoop 的启动扫描可能对崩溃前已评估过的边界再次评估,导致:

  • turns_used 被多计一次(轮数通胀)
  • 多发一次续派(continuation)

根因

evaluatedRevisionssrc/goal/loop.ts:225 附近)是进程本地 Map,随进程死亡丢失。重启后:

  • D-4 门(boot 快照 revision 比较)与新的 evaluatedRevisions 门对「崩溃前已判定的边界»都放行
  • 扫描触发的评估重跑 judge → updateAfterJudgematchesExpected 因 revision 已 bump 而通过 → turns_used +1 且再次续派

触发窗口:崩溃发生在「continue 提交之后、续派的首条 assistant 消息之前」。预存在问题(非 GOAL-FP-01-17 引入的回归)。

修复方向(待设计,勿直接实施)

在 durable goal 行记录「最后已判定的 assistant 消息 id / 边界」,扫描时跳过 last-assistant 不晚于该边界的会话;或等价地持久化 evaluated 边界。

影响

预算统计失真 + 重复续派;不造成功能卡死,故本次止血发布不含此修复。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions