Add terminating tool results and defineTool helper#832
Add terminating tool results and defineTool helper#832HabibPro1999 wants to merge 3 commits intocan1357:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 887b4f4f58
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (shouldTerminateTurn) { | ||
| break; | ||
| } |
There was a problem hiding this comment.
Keep follow-up queue processing after terminate batches
Breaking out of the outer loop here skips the getFollowUpMessages() check entirely when all tool results in a tool-use batch have terminate: true. That regresses the Agent.followUp() contract (“processed after the agent finishes”): follow-up messages queued while streaming can remain stuck in the queue with no automatic delivery, because the run ends before the follow-up dequeue path is reached. This shows up when a terminating deterministic tool finishes and the user (or session code) has already queued follow-up input during that same run.
Useful? React with 👍 / 👎.
|
Addressed the Codex follow-up review in Terminating tool batches now suppress only the automatic model continuation; they still fall through to the normal follow-up dequeue path so queued Added regression coverage for a follow-up queued during a terminating tool execution. Verification:
|
4c0f8ab to
e6dc98e
Compare
What
terminate?: booleansupport to tool results/messages.Agent.followUp()handling after terminating tool batches.defineTool()identity helper.Why
This ports two small Pi runtime-harness improvements to OMP:
Part of the Pi runtime/agentic harness migration stack.
Testing
bun test packages/agent/test/agent.test.ts packages/coding-agent/test/extensions-runner.test.tsbunx biome checkon all files changed by this PRbun run check:tsandPATH="$HOME/.cargo/bin:$PATH" bun run checkKnown caveat after rebasing onto latest
main: fullbun run check:tsis currently blocked by unrelated Biome formatting/import-order issues already present inorigin/mainfiles not touched by this PR (line-hash.ts,tools/renderers.ts,tools.test.ts,tools/search-renderer.test.ts).bun checkpasses (blocked after latestmainrebase by unrelated upstream Biome issues listed above)