refactor(core): remove redundant step closeout flags - #46937
Open
kitlangton wants to merge 1 commit into
Open
Conversation
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.
Why
The step publisher tracks whether closeout events have already been emitted, even though its owner invokes each closeout operation at most once. These flags duplicate the physical attempt's control flow rather than protecting a reachable second publication.
What Changes
stepStreamedandstepFailed, including their guard/assignment pairs.stepFailure, which records the first observed failure, and the check that there is a failure to publish.Each
SessionStep.attemptcreates a fresh publisher. It callsstreamed()once after provider-stream exit when applicable, andpublishStepFailure()once during final settlement when a failure was recorded. Provider callbacks, tool fibers, and finalizers do not call either closeout operation. Subsequent physical attempts create another publisher.Scope
Two files: the publisher and its existing step test. Durable events, publication timing, first-failure selection, and cancellation-safe settlement are unchanged; no changes to retry or coordinator policy.
Verification
212 tests passed across three files. Core typechecking and formatting passed. Scoped lint reported zero errors and 19 warnings in existing publisher code. The pre-push workspace typecheck passed all 33 tasks, with 24 cache hits. No live provider calls.