Skip to content

fix(orchestration): drain secret requests after tick loop exits on instant completion#1475

Merged
bug-ops merged 3 commits intomainfrom
secret-bridge-timing
Mar 9, 2026
Merged

fix(orchestration): drain secret requests after tick loop exits on instant completion#1475
bug-ops merged 3 commits intomainfrom
secret-bridge-timing

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 9, 2026

Summary

Fixes #1454.

In the DagScheduler tick loop, process_pending_secret_requests() was only called at the bottom of each iteration. When a single-task plan emitted Done on the first tick (instant completion), both break 'tick status paths exited the loop before the drain, silently dropping any pending secret requests from sub-agents.

  • Add a final self.process_pending_secret_requests().await call immediately after the 'tick loop exits, ensuring the drain always runs before the scheduler returns
  • Add regression test test_secret_drain_after_instant_completion: pre-loads a SecretRequest, uses a pre-completed graph that emits Done on the first tick, asserts drain was executed

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace --features full -- -D warnings — 0 warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 4918 passed, 0 failed

bug-ops added 2 commits March 9, 2026 19:28
…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
@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 9, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 9, 2026 18:35
@bug-ops bug-ops merged commit 5a21c6e into main Mar 9, 2026
18 checks passed
@bug-ops bug-ops deleted the secret-bridge-timing branch March 9, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(orchestration): secret bridge timing for single-task plans with instant completion

1 participant