Repository navigation
feat(agno): add cancellation stage to metadata - #822
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 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".
| cancellation_stage = getattr(cancellation_stage, "value", cancellation_stage) | ||
| if isinstance(cancellation_stage, str) and cancellation_stage: | ||
| metadata["cancellation_stage"] = cancellation_stage |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
cancellation_stagevalues to Agent and Team span metadata.Verification
mise exec -- nox -s 'test_agno(latest)' -- -k test_agno_agent_cancellation_stage_metadata— passed.cancellation_stage.Linear: SDK-436