You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[agentserver-core] Fix steering future leaks and acknowledgment misrouting - #49233
Fix request-owned steering acknowledgments for resilient multi-turn tasks. Rejected queue appends previously left unreturned futures registered, so repeated SteeringQueueFull responses could grow per-chain memory without a durable queue slot.
The fix persists opaque acknowledgment IDs alongside durable queue slots and binds append, drain, cancellation, and result delivery by ID rather than list position. Append and drain retries reconcile only the exact transition whose conditional PATCH may have committed before returning a conflict. A later drain cannot redispatch stale active state or consume the next queue head.
Turn completion now acts as a persistence barrier: return, failure, and cancellation are acknowledged, and queued successors are dispatched, only after the terminal task-state PATCH succeeds. If persistence fails, the current caller receives that persistence error, local queued handles receive TaskConflictError(current_status="in_progress"), and durable state remains available for recovery. Waiter-aware write-lock reclamation also prevents rejected remote steers from retaining per-task locks.
The branch is rebased onto the current Core 2.3.0b2 preview line. It no longer creates a stable 2.2.1 release entry; a Chronus fix change records the work for the next preview release.
Tests use the real local file provider and deterministic failure injection for queue saturation, pre/post-commit append failures, committed drain conflicts, failed Phase-3 cleanup plus failed terminal persistence, duplicate inputs/public IDs, legacy/remote backlogs, attachment drains, cancellation, return/raise paths, and waiter-safe lock cleanup. The full TaskManager suite passes (740 tests on Python 3.11), focused fault regressions pass on Python 3.10 and 3.14, and pylint, mypy, pyright, and CI-equivalent cspell pass.
Title of the pull request is clear and informative.
There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
Azure Pipelines:
Successfully started running 1 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
Eduard van Valkenburg (eavanvalkenburg)
changed the title
[agentserver-core] Prevent steering future leaks on failed queue appends
[agentserver-core] Fix steering future leaks and acknowledgment misrouting
Sep 28, 2026
The final-user path reclaims the remote task's lock but clears its etag only when _active_tasks_pop() previously marked cleanup pending. A rejected remote steer has no local active entry, while the initial _provider_get_tracked() still caches its etag, so the new 20-task regression empties _task_write_locks but leaves 20 entries in _task_etag_cache; repeated distinct remote IDs still grow manager memory indefinitely. Clear the etag whenever this path removes a no-longer-active lock, and extend the regression to assert the cache is empty.
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
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.
Description
Fix request-owned steering acknowledgments for resilient multi-turn tasks. Rejected queue appends previously left unreturned futures registered, so repeated
SteeringQueueFullresponses could grow per-chain memory without a durable queue slot.The fix persists opaque acknowledgment IDs alongside durable queue slots and binds append, drain, cancellation, and result delivery by ID rather than list position. Append and drain retries reconcile only the exact transition whose conditional PATCH may have committed before returning a conflict. A later drain cannot redispatch stale active state or consume the next queue head.
Turn completion now acts as a persistence barrier: return, failure, and cancellation are acknowledged, and queued successors are dispatched, only after the terminal task-state PATCH succeeds. If persistence fails, the current caller receives that persistence error, local queued handles receive
TaskConflictError(current_status="in_progress"), and durable state remains available for recovery. Waiter-aware write-lock reclamation also prevents rejected remote steers from retaining per-task locks.The branch is rebased onto the current Core
2.3.0b2preview line. It no longer creates a stable2.2.1release entry; a Chronusfixchange records the work for the next preview release.Tests use the real local file provider and deterministic failure injection for queue saturation, pre/post-commit append failures, committed drain conflicts, failed Phase-3 cleanup plus failed terminal persistence, duplicate inputs/public IDs, legacy/remote backlogs, attachment drains, cancellation, return/raise paths, and waiter-safe lock cleanup. The full TaskManager suite passes (740 tests on Python 3.11), focused fault regressions pass on Python 3.10 and 3.14, and pylint, mypy, pyright, and CI-equivalent cspell pass.
Downstream dependency: microsoft/agent-framework#8794; steering review thread. The downstream dependency floor must not change until a patched AgentServer core release is officially published and verified.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines