Files
Jack Chen 0cf3d66cb2 fix(core): record tool input/output on v2 spans under an explicit capture policy (#561)
The v2 sink path dropped tool arguments and results that the legacy `onTrace`
callback still delivered, so migrating to `observability.sinks` (and from there
to any OpenTelemetry backend) silently lost data the old callback provided.
`TraceCapturePolicy` already declared `toolInput`/`toolOutput`, and
`SensitiveDataProcessor` already filtered on them, but no instrumentation site
produced the attributes, leaving both switches inert.

`AgentRunner` now attaches `oma.tool.input` and `oma.tool.output` to the
`execute_tool` span when the policy opts in. `TraceRuntime.capturesToolIO`
carries that decision so the serialization is skipped entirely by default,
keeping unopted runs byte-for-byte unchanged. Values are redacted at the
instrumentation site as well as in the processor, so a runtime constructed
outside the orchestrator does not bypass redaction.

`@open-multi-agent/otel` gains `contentCapture: { mode: 'upstream-policy' }`,
which forwards those two attributes and nothing else. It is the separately
reviewed upstream policy the package's reserved extension point was waiting
for: the adapter setting exports nothing on its own, because without the core
policy the attributes are never recorded. Prompt, completion, raw payload,
credential, and reasoning content stay excluded under every mode.

Docs now state which capture fields have producers, since `prompt` and
`completion` remain filters over attributes no v2 site emits, and record that
`service.name` comes from the application's own TracerProvider Resource rather
than from adapter metadata.
2026-08-31 16:43:13 +08:00
..