zizi ffd22f22c2 feat(tier2): C1 trace 中间件接 with_studio(开 Studio 即旁路推 OTLP span)
C1 此前建了 observability.with_studio + studio_sink(OTLP→Studio),但没 wire 进真正跑的
Tier2TraceMiddleware(它在 worker/middleware.py、C1 没动)。本提交把中间件新建 adapter 的路径从
TraceAdapter(...) 换成 with_studio(...):drop-in——TIER2_STUDIO_URL/infra_config[studio] 取不到时
studio sink 自动 no-op,行为与原 TraceAdapter 完全一致(CLI/服务两线不开 Studio 即无感);取到地址则
每步在原 sink 外旁路推一份 OTLP span 给 AgentScope Studio(observe-only,best-effort,不阻塞主链)。
存 _studio_sink 句柄供收口 flush。配合 mini-desktop 起 Studio(创始人:now)即得真跑可视化。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 11:49:03 +00:00
..