Skip to content

feat(agno): add cancellation stage to metadata - #822

Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/sdk-436-add-agno-cancellation-stage-to-metadata
Sep 29, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/sdk-436-add-agno-cancellation-stage-to-metadata

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

Summary

  • Add Agno cancellation_stage values to Agent and Team span metadata.
  • Add VCR-backed regression coverage for cancellation with Agno 3.0.11.

Verification

  • mise exec -- nox -s 'test_agno(latest)' -- -k test_agno_agent_cancellation_stage_metadata — passed.
  • The focused test skips on Agno 2.4.0 and 2.1.0 because those versions lack cancellation_stage.
  • Commit hooks passed, including Ruff, codespell, and stale cassette checks.

Linear: SDK-436

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T20:39:52.547916Z c80effc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77add49eed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment on lines +328 to +330
cancellation_stage = getattr(cancellation_stage, "value", cancellation_stage)
if isinstance(cancellation_stage, str) and cancellation_stage:
metadata["cancellation_stage"] = cancellation_stage

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Capture cancellation stage when streaming finishes

For stream=True Agent or Team runs, this helper does not result in the final cancellation stage being logged: _StreamState.record and the private stream wrappers call _session_metadata only for the first chunk, before a later cancellation can be represented, while _aggregate_agent_chunks drops cancellation_stage and the completion log supplies no metadata. Consequently, cancelled streaming runs still omit the new field; inspect the final event or mutated run response and log its session metadata when the stream finishes.

Useful? React with 👍 / 👎.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit fd25702 into main Sep 29, 2026
83 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/sdk-436-add-agno-cancellation-stage-to-metadata branch September 29, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants