Skip to content

fix(stepcode): 暂时写入失败时自动恢复已确认的候选 - #84

Closed
imxyanua wants to merge 7 commits into
EvoMap:mainfrom
imxyanua:codex/step-candidate-retry
Closed

imxyanua wants to merge 7 commits into
EvoMap:mainfrom
imxyanua:codex/step-candidate-retry

Conversation

@imxyanua

@imxyanua imxyanua commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

依赖 #83,先保持 Draft。 当前分支包含 #83 的 evidence 完整性、顺序和 processing-error recovery;请先合并 #83,再缩减本 PR 的 base/diff。本 PR 只补 Step Code 的自动 terminal retry 及相关 report delivery,不请求合并或发布。

Step Code 在 candidate 写入失败后没有 native terminal reader,原 adapter 又立即忘掉已确认的 answer/model,因此即使共享 runtime 归还了 evidence,也不会自动恢复 candidate。

native agent_settled
- 吞掉 processing 错误并立即清空 frame
+ 使用现有 onError,暂时 IO/lock 错误最多尝试 3 次
+ 保留同一 terminal verdict、turn、answer 和 model/account descriptor
+ 新 prompt / shutdown 等待正在保存的 completion
+ retry 没有新 report 时,也唤醒已入队并确认的旧 report delivery

JSON/shape 损坏不自动重试、不覆盖旧 bytes。持续失败显示本地状态提示;每次 state write 的原有锁等待预算不变。取消在 native completion gate 之前仍不生成 report/candidate;gate 已接受的 verdict 不因之后的旧 signal 改写。

Evidence

  • Before: Windows 原生 Step Code 0.1.7 RPC,实际 node --test exit 0;单次 candidate replacement EIO 后 candidate 为 0。首个 packed regression 同样超时,未主动重发 terminal,也未调用 /evolver-distill。
  • After: 同一 native RPC + 脚本化 loopback model/Proxy:写入前失败、写入成功后抛错、持续失败三次、完成后 abort,以及 retry 中提交新 prompt 五种情形通过。可恢复情形只有 1 个 candidate、2 个 Recipe-step reports,不重复执行 model/tools;新 prompt 情形多出的 model request 仅属于新 prompt。持续失败达到 3 次即停止,并确实发出 notice。测试进程已退出,临时 profile 已清理。
  • 7 个新增 packed-host regression:原始 proof 自动恢复、已落盘后失败不重复 candidate/retention/report、持续失败 cap、JSON 损坏保留 bytes、完成后晚到 abort 的两种写入时序,以及新 prompt 与 account 切换并发到达。
  • 另加共享 runtime 回归:candidate retry 在本次 reports=[] 时,仍调度首次 attempt 已确认 report 的 delivery,后续 drain 不重复发送。
  • 最终 Windows Node 22 / 26:Step Code suite 各 44/44;root/agent/app/runtime 各 654 pass,14 platform skips(668 total);全部 host pack 均通过。未放宽 timeout、assertion、workload 或 CI gate。
  • 官方 Test and release 已在最终 HEAD f28f2d2e7a97207d99a722486731ea63726c4e75 上 6/6 测试 job 通过:Linux 全量测试、Windows MiniMax/ZCode/Step/Kimi suites,以及 Linux/Windows Node 22 / 26 的全部 host pack;publish job 按条件跳过。Sentinel 正在分片审核,尚无最终结论,不能视为 review 已通过。
  • 上述 native proof 使用真正 Step Code Windows runtime,但 model 与 Proxy 后端是 loopback fixture,不代表 Grok、真实 Proxy/Hub 或 macOS 验收。

Merge Danger

Door: two-way

Blast Radius: Step Code completion

Step 回调在短 backoff 和现有 file-lock 预算内等待同一完成操作;总时长并非固定 100 ms。共享变化只为本 turn 已确认过的 reports 补 DRAIN,不给所有空 turn 新建 delivery worker。

这是 live-process 有界恢复。若三次尝试后文件系统仍不可用,会提示人工处理;Step 进程退出后的自动重放仍没有 durable terminal reader 保证。没有增加 journal、切换 provider/account、发布资产、合并 PR 或发版。

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。

另有 5 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。

审核覆盖提示: 6 个 hunk/条目缺少完整输入;它们不作为 bug 报告。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=84、head_sha="f28f2d2e7a97207d99a722486731ea63726c4e75",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 f28f2d2e7a97

@evomap-aiqa-bot

Copy link
Copy Markdown

Sentinel 保留了 5 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
开发 agent:请 review 以下 advisory,并逐条给出“已验证无风险 / 已修复 / 转为后续事项”的结论;不要只做整体确认。

  • [P1] notes 提交成功、edits 提交失败时会永久丢失 turn notes — 当前按顺序提交两个独立 lease。第一个 notes.commit() 会删除 notes claim;若第二个 edits.commit(...(truncated) · lib/app/turn-end.js·advisory_a65500e50e2c59364a7fa631`
  • [P3] legacy race mock 对同一次 rename 执行了两次移动 — mock 在匹配 source-to-.taking 时先执行 rename(from, legacy),但随后无条件执行 return rename(from, t...(truncated) · ``test/runtime/file-stores.test.js`` · advisory_f06defb6507c8c792d377500`
  • [P3] 并发测试在真正建立 claim 前暂停,B 进程可能先成功获取证据 — 当前 PR 在 A 的 renameSync mock 中先写入 A-paused 并等待 A-resume,实际 claim 文件尚未完成重�...(truncated) · test/runtime/file-stores.test.js · advisory_df4a139aa17cb779aa1226b1
  • [P3] 短暂锁超过 100ms 后会永久放弃回合完成记录 — takeStateLines(..., { requireComplete: true }) 遇到非 stale claim 会返回 ELOCKED,但 finish 只进行三��...(truncated) · hosts/stepcode/dist/plugin.mjs · advisory_04e859519fe73d33052d30bf
  • [P3] 普通无报告 turn 会继承上一 turn 的 labelable 状态 — 新条件将所有 queued.length === 0 的调用都视为需要保留 session.labelable。这能覆盖“同一 turn...(truncated) · lib/app/turn-end.js · advisory_429bc6d7f8a4bb7be5bf2b5a

需要完整证据时,可用行末 finding_key 查询 Sentinel PR review context。

由 Sentinel 审核 · 目标提交 f28f2d2e7a97

forrestlinfeng pushed a commit that referenced this pull request Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forrestlinfeng pushed a commit that referenced this pull request Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forrestlinfeng pushed a commit that referenced this pull request Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forrestlinfeng pushed a commit that referenced this pull request Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forrestlinfeng added a commit that referenced this pull request Nov 16, 2026
fix(stepcode): recover confirmed candidates after a transient write failure (#84 on reviewed #83)
@forrestlinfeng

Copy link
Copy Markdown
Contributor

Landed via #86, which carries this PR's two commits (7da1ba7, 24dce2e) unchanged on top of the reviewed #83, plus a maintainer commit (434141b) naming the recovered-turn delivery condition and the Step notice constant. While landing it we also fixed the Step fixture test's race with the off-path ledger thread (#87, #88). Thanks!

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.

2 participants