Commit 6122e82
feat(tracing): auto-apply sgp-obs @business_trace to ACP handlers
Every agent's message/send and task/create handler is now wrapped with sgp-obs
`business_trace(business_trace_id=lambda p: p.task.id)` at registration, so an
agent gets the full business<->obs correlation edge — the turn anchor plus the
process-local correlation context the openai-agents bridge and auto-egress read
for their reverse tag — with NO per-agent code. Proven manually on analyst-agent
(trace 9ad202d0b0bbdc0a78d8e5719c830811); this bakes it into the base server so
no agent has to decorate.
The decorator preserves the handler's shape (sync / async / async-generator), so
streaming message/send handlers keep streaming.
Fail-open + version-tolerant: `_with_business_trace` no-ops when the installed
sgp-obs predates `business_trace` (defensive import, same stance as init_tracing),
so this is inert until the sgp-obs pin is bumped to the release that ships it
(0.5.0) — no code change needed here at that point.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0f72af4 commit 6122e82
2 files changed
Lines changed: 90 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
363 | 386 | | |
364 | 387 | | |
365 | 388 | | |
| 389 | + | |
366 | 390 | | |
367 | 391 | | |
368 | 392 | | |
| |||
417 | 441 | | |
418 | 442 | | |
419 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
420 | 447 | | |
421 | 448 | | |
422 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments