Repository navigation
Conversation
After a successful FinishTurn, keep Cell notifications in history without treating them as pending delivery. Continue requiring Cell execution, child effects and final result acceptance to settle before the Run can close. Generated-by: OpenAI Codex
…x-agent-finish-cell-notices
6 of 8 tasks
This branch has not been deployed
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
A successful
FinishTurnstops the Agent from starting another model step. If a Code Mode cell finishes during shutdown, its final notification can still be queued for the next model step. The completion check treated that notification as unfinished work, so the run stayed active after the cell had settled.This happened during a proactive discovery run.
DiscoveryCompletesaved the report, but the scheduler was still waiting for the worker to finish. The report never reached the Bot, and subsequent investigations could not start.This change lets a run finish with undelivered notifications preserved in its records. The Agent still waits for the cells and their child tools to settle and accepts the final cell results before completing the run.
Verification
run has pending Cell obligationsbefore the fix. It now passes and verifies that an active cell still blocks completion.maka-agent-factsandmaka-agent-statesuites passed all 40 tests. The Agent Engine compile check andcargo fmt --all -- --checkalso passed.Verification is scoped to the checks above. The full workspace test suite is pending.
AI use
OpenAI Codex assisted with root cause analysis, implementation, and regression testing. The commit includes
Generated-by: OpenAI Codex.Checklist
Does this PR entail a change in behavior?
简体中文
摘要
FinishTurn成功后,Agent 会停止发起新的模型请求。如果 Code Mode 后台任务在收尾时结束,它的最终通知仍可能进入队列,等待下一次模型请求。旧的结束校验把这条通知当成未完成的工作,导致后台任务已经收尾,整轮运行却仍处于活跃状态。实际遇到这个问题的是一轮主动发现。
DiscoveryComplete已保存报告,但调度器仍在等待 Worker 结束,导致报告无法交给 Bot,后续调查也无法启动。修复后,未交付的通知会保留在本轮记录中,轮次可以正常结束。Agent 仍会等待后台任务及其子工具完成收尾,并接收后台任务的最终结果。
验证
run has pending Cell obligations。修复后通过,并验证了仍在运行的后台任务会继续阻止轮次结束。maka-agent-facts和maka-agent-state共 40 项测试通过。Agent Engine 编译检查和cargo fmt --all -- --check也通过。本次验证覆盖上述检查,全仓测试尚待运行。
AI 使用
OpenAI Codex 协助了根因分析、修复实现和回归测试。提交包含
Generated-by: OpenAI Codex。