Skip to content

fix: terminate final-acceptance loop when completion gate is blocked#448

Merged
phantom5099 merged 1 commit into1024XEngineer:mainfrom
Cai-Tang-www:fix/final-acceptance-no-progress-breaker
Apr 24, 2026
Merged

fix: terminate final-acceptance loop when completion gate is blocked#448
phantom5099 merged 1 commit into1024XEngineer:mainfrom
Cai-Tang-www:fix/final-acceptance-no-progress-breaker

Conversation

@Cai-Tang-www
Copy link
Copy Markdown
Collaborator

背景

当 completion gate 未通过时,acceptance engine 会立即返回 continue,导致后续 no-progress/max-turn/retry 收敛逻辑失效,运行可能长期空转(持续注入 continue reminder)。

变更

  • 调整 internal/runtime/acceptance/engine.go
    • 取消 completion gate 未通过时的早返回。
    • 先生成 continue 决策,再统一进入 no-progress / max-turn / retry_exhausted 收敛分支。
    • 保持 completion gate 通过时原有 verifier + hook 行为不变。
  • 新增/补强回归测试:
    • internal/runtime/acceptance/engine_test.go
      • completion gate=false + no_progress_exceeded => incomplete
      • completion gate=false + max_turns_reached => incomplete
      • completion gate=false + retry_exhausted => failed
    • internal/runtime/final_acceptance_test.go
      • beforeAcceptFinal 在 completion gate=false 且 no progress 超阈值时返回 incomplete

验证

  • go test ./internal/runtime/acceptance ./internal/runtime -run "TestEngineEvaluateFinal|TestBeforeAcceptFinalDecisionPaths"
  • go test ./... ⚠️ 当前仓库存在与本改动无关的既有失败:
    • internal/gateway/launcher(绝对路径断言)
    • internal/tui/core/app(TempDir 清理)

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown

@fennoai fennoai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已完成四轮审查(代码质量、性能、安全、文档一致性)。本次变更范围内未发现需要修改的显著问题。

@@ -24,66 +24,66 @@ func NewEngine(policy AcceptancePolicy) *Engine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已逐项检查该处及相关分支流转,当前实现与测试覆盖能够支撑本次修复目标,暂无可行动问题。

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 89.74359% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/runtime/acceptance/engine.go 89.74% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@phantom5099 phantom5099 merged commit ffa598a into 1024XEngineer:main Apr 24, 2026
3 checks passed
@Cai-Tang-www Cai-Tang-www deleted the fix/final-acceptance-no-progress-breaker branch April 28, 2026 11:39
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