Repository navigation
Keep flag 2 out of runs that use flag 4 - #2194
Merged
Merged
Conversation
VegetarianOrc
force-pushed
the
alexmazzeo/sdk-606-flag-4-keep-flag-2-out-of-runs-whose
branch
2 times, most recently
from
December 3, 2026 00:13
6027b7f to
99546d5
Compare
The worker checked flag 2 before flag 4. A worker with flag 2 as a default then recorded flag 2 on a run whose history holds flag 4, and the run changed to flag 2 behavior. Check flag 4 first when history does not hold flag 2, and check flag 2 last. A new run on a worker with both flags as defaults now records flag 4. Refs SDK-606. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Address review findings on the flag precedence tests: - Start the handler wait on the second worker, so the result shows which flag the run uses. - Compare the full set of recorded flags. - Set both flags explicitly on each worker. - Remove cases that run the same code path. Refs SDK-606. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VegetarianOrc
force-pushed
the
alexmazzeo/sdk-606-flag-4-keep-flag-2-out-of-runs-whose
branch
from
December 3, 2026 00:22
99546d5 to
bfae0e5
Compare
Base automatically changed from
alexmazzeo/sdk-605-flag-4-add-the-missing-behavior-changes
to
main
December 3, 2026 00:37
VegetarianOrc
changed the base branch from
main
to
amazzeo/workflow-wait-condition-cancellation
December 3, 2026 00:37
VegetarianOrc
deleted the
alexmazzeo/sdk-606-flag-4-keep-flag-2-out-of-runs-whose
branch
December 3, 2026 00:47
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.
What was changed
_activatenow checks flag 4 first, unless history holds flag 2, and checks flag 2 last:Why?
Before, the worker checked flag 2 first. A worker with flag 2 as a default recorded flag 2 on a run whose history held flag 4, and the run changed to flag 2 behavior. Replay stayed deterministic, and only the private test hook can make flag 2 a default today, so this change is defensive.
Checklist
Refs SDK-606. Stacked on Add activation batching flag with task-local cancellation #2149.
How was this tested:
test_workflow_logic_flag_kept_after_worker_flags_change(renamed in Add missing flag 4 tests #2195): the first task records flag 4 or flag 2, and later tasks run on a worker with both flags. With the old order, the flag 4 case returns the wrong result and records both flags.test_workflow_shielded_wait_condition_after_cancelnow compares the full set of recorded flags.poe lintpassed.Any docs updates needed? No. Users cannot see the change in this release.
🤖 Generated with Claude Code