Repository navigation
fix(agent): clarify background Shell refs and running Cell cancellation - #6939
Conversation
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
There was a problem hiding this comment.
I reviewed all five changed files at e507b77810ab458d39502993fc2cb9dcf0a04184. I found no verified P0–P2 issue in this change.
The production change adds cancellation instructions, rather than a new cancellation mechanism. In plugins/agent/tools/src/cell/session.rs:1058, only the model-facing running summary gains cancel_with: {cell_id, terminate: true}; the typed observation retained in CellReply is still serialized before that summary is constructed. The supplied arguments match WaitInput in plugins/agent/tools/src/cell.rs:229. I followed the existing wait route through observe and observe_cell: it reads the Cell from the current session's persistence before requesting cancellation, and a cancellation request does not itself mark cleanup complete. The process-control change still rejects a malformed managed process reference before reading or stopping a process; its new error explains the separate Cell cancellation route.
I also checked the tool-catalog descriptions and the changes in products/maka/cli/tests/codemode_reopen.rs: the decoder accepts older running summaries without this optional field, rejects cancellation arguments pointing to another Cell, and the JavaScript restart scenario now asserts the arguments actually seen by the provider. No database migration or transport-schema change is introduced. A static merge with rust-preview@5d3711abdac95982c56ab3978ce727dd1fd90754 succeeds.
Validation limits: this is source and integration-path review. This machine has no Rust toolchain; I did not run the Rust suites, a real foreground/background process cancellation, or Host restart recovery. The four tool tests, three reopening tests, and loopback-provider cancellation exercise in the PR description are the author's results. I have not independently reproduced the reported Python cold-restart timeout or its baseline control. CI follow-up: run 43736836081 completed successfully for the same PR head. I checked the original native job logs: macOS desktop 33/33 and Windows desktop 31/31 passed, both checking out the CI merge commit e80f46b01f1de2280c6b53d952120fa0e24e81de. This hosted result does not add a local foreground/background cancellation or restart exercise to the review above.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
Keep process resource ref validation and tool descriptions independent of Code Mode, clarify Cell cancellation in both JS and Python Code Mode definitions, and drop the redundant cancel_with payload from running Cell summaries. Generated-by: Antigravity
Summary
A foreground
Shellcommand can still be running when Code Mode returns a Cell ID. If the model passes that ID toProcessStop, it receives an invalid-reference error and the command can keep running.Expose
cancel_within running Cell responses so the model can pass the Cell ID andterminate: truedirectly towait. Document the managedrefreturned by backgroundShelland explain both cancellation paths whenProcessStoprejects a reference.Verification
maka-toolsunit tests passed, and the affected Rust files passed formatting checks.wait, checked the guidance for a Cell ID passed toProcessStop, and stopped a background command with its returnedref. The Host confirmed cleanup and the Session finished.codemode_reopentests passed, including JavaScript recovery and its new assertion on the cancellation arguments seen by the model. The Python cold-restart case timed out waiting fordraftReadyon both this branch and cleanrust-previewate52c87cc3.AI use
OpenAI Codex prepared the tool guidance, running Cell response change, and regression coverage.
Checklist
Does this PR entail a change in behavior?
中文
前台
Shell命令仍在运行时,Code Mode 会返回 Cell ID。模型有时会将它传给ProcessStop。工具随后报引用无效,命令可能仍在运行。本次在运行中的 Cell 响应里提供
cancel_with,模型可直接将 Cell ID 和terminate: true传给wait。后台命令可用Shell返回的ref调用ProcessStop。引用无效时,错误消息会说明两种用法。4 项工具单测通过。用本地模型桩在临时普通 Session 里验证了前台取消、误传 Cell ID 时的提示和后台停止,Host 确认清理,会话正常结束。CLI 回归通过 3 项,其中包括 JavaScript 恢复以及模型收到取消参数的断言。Python 冷启动恢复用例在本分支和干净的
rust-preview@e52c87cc3上都等待draftReady超时。