fix(orchestration): drain secret requests after tick loop exits on instant completion#1475
Merged
fix(orchestration): drain secret requests after tick loop exits on instant completion#1475
Conversation
…stant completion In the DagScheduler tick loop, `process_pending_secret_requests()` was only called at the end of each iteration. When a single-task plan emitted `Done` on the first tick (instant completion), both break paths exited the loop before the drain, silently dropping any pending secret requests. Add a final drain call after the loop exits to ensure secret requests are always processed before the scheduler returns, regardless of how the loop terminated. Add regression test `test_secret_drain_after_instant_completion` that pre-loads a SecretRequest, uses a graph that emits Done on the first tick, and asserts the drain was executed. Fixes #1454
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.
Summary
Fixes #1454.
In the
DagSchedulertick loop,process_pending_secret_requests()was only called at the bottom of each iteration. When a single-task plan emittedDoneon the first tick (instant completion), bothbreak 'tick statuspaths exited the loop before the drain, silently dropping any pending secret requests from sub-agents.self.process_pending_secret_requests().awaitcall immediately after the'tickloop exits, ensuring the drain always runs before the scheduler returnstest_secret_drain_after_instant_completion: pre-loads aSecretRequest, uses a pre-completed graph that emitsDoneon the first tick, asserts drain was executedTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— 0 warningscargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 4918 passed, 0 failed