Skip to content

[bug] agent-framework: duplicated messages, missing system prompt, and double-encoded tool arguments #3912

Description

@jimbobbennett

Describe the bug

AgentFrameworkToOpenInferenceProcessor produces incorrect message attributes on LLM and agent spans:

  • Every input and output message appears twice in Phoenix and Arize AX. The processor emits both a JSON-string llm.input_messages / llm.output_messages attribute and the flattened llm.input_messages.N.* keys, and backends merge the two.
  • The system prompt is missing. Agent Framework records it in gen_ai.system_instructions, which the processor doesn't map to a message.
  • Tool-call arguments are JSON-encoded twice, for example "\"{\\\"location\\\":\\\"Amsterdam\\\"}\"".
  • On a tool-calling turn, the LLM span's output.value has empty content and no tool calls.

To Reproduce

  1. Install openinference-instrumentation-agent-framework==0.1.11 and agent-framework-openai (core 1.19.0).
  2. Register the processor ahead of an OTLP exporter that sends to Phoenix or Arize AX.
  3. Run an agent that has instructions and a tool, and ask it something that calls the tool.
  4. Open the trace and look at the chat spans.

Expected behavior

Each message appears once, the system prompt is the first input message, tool-call arguments are a single JSON string, and the output.value of a tool-calling turn includes the tool calls.

Additional context

Tested with Phoenix 20.16.0 and Arize AX, on Agent Framework 1.0.0 and 1.19.0. Agent Framework 1.0.0 also puts the system prompt in gen_ai.input.messages, so a fix must not add it a second time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglanguage: pythonRelated to the Python packages under python/triageIssues that require triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions