fix: read system_instruction from _settings instead of removed attribute

Replace adapter-based extraction in traced_llm with direct reads from
_settings.system_instruction (priority) and context messages (fallback).
The old approach had three bugs: signature mismatch with Anthropic
adapter, key name inconsistency, and unnecessary overhead from full
message/tools conversion.

Also deduplicate the system instruction in spans -- it was appearing as
both "system" and "param.system_instruction".
This commit is contained in:
Mark Backman
2026-03-20 13:12:40 -04:00
parent 112d1bd375
commit 991fbb82da
2 changed files with 27 additions and 17 deletions

View File

@@ -1 +1 @@
- Fixed telemetry record correct system_instruction in span for LLM services
- Fixed stale `system_instruction` in LLM tracing spans by reading from `_settings.system_instruction` instead of the removed `_system_instruction` attribute.