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
Retried Agent cleanup can miss workflow-tool workspaces #46657
Invoke that Agent as a workflow tool from a workflow in App B. The generated workspace is recorded with the App B workflow run, while the persisted workflow-tool ownership points to App A.
Remove the Agent's final workflow owner so WorkflowAgentRetirementService.retire_unowned retires the Agent and its resources.
If publishing the resource-collection task fails after the database transaction commits, retry retirement and inspect the workspace IDs submitted for collection.
On current main (ce26dd6c9868990df2380ed52751be83f7af2f33), a focused regression test reproduces the retry omission: the second collection request contains the Agent's own workspace but not the retired cross-app workflow-tool workspace.
✔️ Expected Behavior
Retrying retirement should enqueue every retired workspace owned by the orphaned Agent, including workflow-tool workspaces stored under another App. A failed first task publication must not make that workspace undiscoverable on retry.
❌ Actual Behavior
The first retirement discovers the workflow-tool workspace through its persisted root-App ownership and marks it retired. On retry, retire_unowned reloads already-retired workspace IDs using only AgentWorkspace.app_id == backing_app_id. The workflow-tool workspace is stored under App B, so it is omitted from the collection retry and its backend resource may be left without a cleanup task.
One additional implication: this appears to affect the first collection payload too, not just retries. retire_all_for_app() discovers cross-app workflow-tool workspaces and returns their retired IDs, but retire_unowned() discards that return value and builds workspace_ids using only AgentWorkspace.app_id == backing_app_id. So even without a publication failure, that cross-app workspace appears absent from this collector request. This is a static-code finding, not a test result. [1][2]
The existing retry regression covers a conversation workspace whose app_id matches the hidden App, so it does not exercise this ownership mismatch. A useful extension would assert the cross-app workspace ID in both an ordinary successful publication and a retry after publication failure, while excluding unrelated and other-tenant workspaces. The collector processes explicit workspace IDs rather than rediscovering omitted workspaces. [3][4]
Activity
dosubot commentedon Nov 18, 2026
One additional implication: this appears to affect the first collection payload too, not just retries.
retire_all_for_app()discovers cross-app workflow-tool workspaces and returns their retired IDs, butretire_unowned()discards that return value and buildsworkspace_idsusing onlyAgentWorkspace.app_id == backing_app_id. So even without a publication failure, that cross-app workspace appears absent from this collector request. This is a static-code finding, not a test result. [1] [2]The existing retry regression covers a conversation workspace whose
app_idmatches the hidden App, so it does not exercise this ownership mismatch. A useful extension would assert the cross-app workspace ID in both an ordinary successful publication and a retry after publication failure, while excluding unrelated and other-tenant workspaces. The collector processes explicit workspace IDs rather than rediscovering omitted workspaces. [3] [4]To reply, just mention @dosu.
Docs are dead. Just use Dosu.