Skip to content

feat(orchestration): typed ConcurrencyLimit error, edge-case tests, cancel token#1606

Merged
bug-ops merged 4 commits intomainfrom
orchestration-cancel-typed-errors
Mar 13, 2026
Merged

feat(orchestration): typed ConcurrencyLimit error, edge-case tests, cancel token#1606
bug-ops merged 4 commits intomainfrom
orchestration-cancel-typed-errors

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

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

Summary

Test plan

  • All 3 new edge-case tests pass (test_concurrency_deferral_does_not_affect_running_task, test_max_concurrent_zero_no_infinite_loop, test_all_tasks_deferred_graph_stays_running)
  • 6 updated existing tests pass with typed error variants
  • cargo clippy --workspace --features full -- -D warnings: 0 warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins: 5139/5139 passed

Closes #1515
Closes #1516
Closes #1457

bug-ops added 3 commits March 13, 2026 14:00
…ancel token (#1515 #1516 #1457)

#1515: Add SubAgentError::ConcurrencyLimit { active, max } to replace
fragile string matching in record_spawn_failure(). Both spawn() and
resume() in SubAgentManager emit the typed variant. DagScheduler's
record_spawn_failure now accepts &SubAgentError and uses matches!.

#1516: Add three DagScheduler edge-case tests for concurrency deferral:
- test_concurrency_deferral_does_not_affect_running_task
- test_max_concurrent_zero_no_infinite_loop
- test_all_tasks_deferred_graph_stays_running

#1457: Add plan_cancel_token: Option<CancellationToken> to Agent.
run_scheduler_loop gains a tokio::select! on the token at wait_event()
and around RunInline execution. handle_plan_cancel fires the token for
in-flight plans. Token always cleared on both Ok and Err paths (CRIT-07).
Known limitation: delivery path requires agent loop restructure (SEC-M34-002).
…#1599 changelog

- REV-01: Fix stale doc comments in spawn() and resume() that still
  referenced SubAgentError::Spawn for concurrency limit; now reference
  SubAgentError::ConcurrencyLimit
- REV-02: Create follow-up GitHub issue #1603 (SEC-M34-002) for
  restructuring the agent message loop to enable /plan cancel delivery
  during run_scheduler_loop; update all code comments with the issue number
- REV-CHANGELOG: Restore accidentally removed #1599 entry (scheduler not
  initialized in ACP mode) from the Fixed section
- REV-03: Add TODO comment at inline cancel TaskOutcome referencing #1603
- REV-04: Add biased; to wait_event tokio::select! to make cancel priority
  over task completion events explicit
@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate size/L Large PR (201-500 lines) and removed enhancement New feature or request labels Mar 13, 2026
@github-actions github-actions bot added the enhancement New feature or request label Mar 13, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 13, 2026 13:44
@bug-ops bug-ops merged commit b0bb3d1 into main Mar 13, 2026
15 checks passed
@bug-ops bug-ops deleted the orchestration-cancel-typed-errors branch March 13, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

1 participant