Repository navigation
Conversation
run-batches-pending! empties ::batch-pending* before running the round. An entity resumed by one batch can then miss a nested input that depends on another batch of the same round, and fail with "Required attributes missing": - the other batch hasn't run yet, so it isn't pending any more, or - it has run and merged into the root data, but the resumed entity still has its own stale copy of the nested entity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the round's batches in ::batch-pending* until all of them have run (remove-ran-batches-keeping-new-batch-items!), so a nested input waits for them. run-batches-waiting! then resets the entity from the root data. Done for the serial and async runners. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danieroux
force-pushed
the
nested-input-batch-wait
branch
from
October 9, 2026 16:14
d743906 to
f80212e
Compare
This branch has not been deployed
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.
Nested inputs wait for every batch of the current round
Repro
Expected:
{:entity {:entity/result "nested-value-of-entity and sibling-value-of-entity"}}On
main:The error message is misleading:
entity->nesteddid provide:entity/nested. What was missing was:nested/valueinside it.What happens
nested-batch(inside:entity/nested) andsibling-batch(on:entity) both hold in the same round.run-batches-pending!empties::batch-pending*, then runs the round's batches one after the other. Each batch resumes its entities as soon as it finishes:nested-batchruns and merges:nested/valueinto the root data.sibling-batchruns and resumes:entity. But:entitystill has its own copy of:entity/nested, without:nested/value.missing-maybe-in-pending-batch?finds nothing pending, soneeds-nested-and-siblingfails instead of waiting.If the batches run in the other order,
:entityis resumed beforenested-batchruns. That batch is already out of::batch-pending*, so the result is the same.It only happens for a non-root entity (here
:entitysits under a join). At the root there's no separate copy to go stale.The fix
Keep the round's batches in
::batch-pending*until all of them have run, then remove them (remove-ran-batches-keeping-new-batch-items!). Batch items added during the round are kept for the next round. A nested input on any batch of the round now waits, andrun-batches-waiting!resets the entity from the root data before running it again.Done for the serial and async runners. The parallel runner passes the new tests unchanged.
Tests
The first commit adds a test that fails on
mainwith two cases, one per batch order, on the serial and async runners. The second commit is the fix. The full suite passes.