getsentry / getsentry/sentry-python
Instrument `Agent.iter()` with `invoke_agent` span
未关闭
Improvement
Python
Spans
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 669
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 213
描述
`Agent.iter()` is a public API for step-by-step agent iteration that does NOT call `Agent.run()`, so currently no `invoke_agent` span is created. Inner model calls still get `gen_ai.chat` spans via the `ModelRequestNode` patch, but without the parent agent span.
This should be patched similarly to `Agent.run_stream()` — wrapping the async context manager to create an `invoke_agent` span and push/pop the agent context.
贡献指南
评估
这个 Issue 还没有评估数据。