fix: workflow step losing its completion tool on automatic retry - #48
Open
pmateusz wants to merge 1 commit into
Open
fix: workflow step losing its completion tool on automatic retry#48pmateusz wants to merge 1 commit into
pmateusz wants to merge 1 commit into
Conversation
Kimchi Code ReviewA review is being prepared and will be posted shortly.
What to expectKimchi will analyze the changes in this pull request and post:
The review typically completes within a few minutes. This comment will be updated once the review is ready. Interact with Kimchi
ConfigurationReviews are configured by your organization admin. Powered by Kimchi — AI-powered code review by CAST AI |
pmateusz
force-pushed
the
fix/step-tools-across-auto-retry
branch
2 times, most recently
from
September 4, 2026 15:48
8f3df9e to
2eb2d23
Compare
PI fires agent_end when an agent loop ends, including a failed attempt that an automatic retry is about to continue. The in-session bridge resolved the turn there, so a retryable transport failure condemned the step: the engine tore the session down and dispose() restored the baseline tool set, stripping workflow_submit_result while the retried request was still streaming and leaving the model no way to submit. agent_end now only records the attempt's messages, stamped with the in-flight turn's token; the turn resolves on agent_settled, which PI fires only after no automatic retry, compaction, or queued continuation will run. A turn whose run settles without its own agent_end resolves with empty messages rather than a previous turn's conversation, preserving the cross-talk guard. Add a regression test scripting the failed attempt, the retry, and the settle, and extend the existing PI fakes to emit agent_settled in the real lifecycle order. Co-Authored-By: Kimchi <noreply@kimchi.dev>
pmateusz
force-pushed
the
fix/step-tools-across-auto-retry
branch
from
September 4, 2026 15:52
2eb2d23 to
4eed2a6
Compare
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.
The in-session bridge resolved a turn on agent_end, which PI also fires for a failed attempt that is about to be retried automatically. The engine then condemned the step and dispose() restored the baseline tools, stripping workflow_submit_result while the retried request was still streaming, so the model could no longer submit its result.
agent_end now only records the attempt's messages; the turn resolves on agent_settled, which PI fires only after no automatic retry, compaction, or queued continuation will run. A turn settling without its own agent_end gets empty messages rather than a previous turn's conversation, preserving the cross-talk guard.