feat(agent): add bounded implementation retry loop - #79
Merged
NianJiuZst merged 1 commit intoJun 26, 2026
Conversation
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.
Summary
Related to #76
这个 PR 为 agent implementation 阶段增加了一个有边界的重试 loop,让 OpenMeta 在第一次 implementation draft 返回
needs_review时,不会立刻收口为 artifact-only,而是先保守地补充少量相邻上下文,再重试生成 concrete patch。之前的行为更像:
needs_reviewchanged files: none这在一些“其实已经很接近可改,只是还差几个邻近文件”的场景里会过早放弃。
这次改动的目标不是放宽安全门,也不是引入无限 agent loop,而是给 implementation 一个小范围、可控、保守的二次推进空间。
What changed
implementationAttemptsimplementationStopReasonimplementationContextFilesAddedDesign goals
changed files的概率Scope
这个 PR 有意保持最小改动:
目标是以尽量低的 upstream conflict 风险,提高 implementation 阶段的跟进能力。
Validation
bun run typecheckbun run checkbun run buildbun testNotes
这个 PR 不保证每个 issue 最终都会产出 patch。
它主要解决的是这样一类情况:第一次 implementation draft 已经接近可用,但还缺少少量局部上下文,导致 agent 过早停止。
Summary
This PR adds a bounded implementation retry loop to the agent flow so OpenMeta can conservatively expand local context before falling back to artifact-only / review mode.
Previously, the flow often behaved like this:
needs_reviewchanged files: noneThat can be too eager to give up in cases where the model is already close and only needs a few adjacent files to produce a safe patch.
The goal here is not to relax safety gates or introduce an open-ended autonomous loop, but to give implementation a small, controlled, conservative retry window.
What changed
implementationAttemptsimplementationStopReasonimplementationContextFilesAddedDesign goals
changed fileswhen the first implementation attempt is only slightly under-contextualizedScope
This PR intentionally keeps the change small:
The goal is to improve implementation follow-through with minimal upstream conflict risk.
Validation
bun run typecheckbun run checkbun run buildbun testNotes
This PR does not guarantee that every issue will end with a patch.
It specifically improves the case where the first implementation draft is close, but still needs a small amount of additional local context before a safe patch can be generated.