Skip to content

Read a tool call as its arguments in AI agent conversations - #14174

Merged
wu-sheng merged 1 commit into
masterfrom
ai-agent-tool-call-text
Oct 28, 2026
Merged

wu-sheng merged 1 commit into
masterfrom
ai-agent-tool-call-text

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Read a tool call as its arguments in AI agent conversations

  • If this is non-trivial feature, paste the links/URLs to the design doc.
  • Update the documentation to include this new feature.
  • Tests(including UT, IT, E2E) are added to verify the new feature.
  • If it's UI related, attach the screenshots below.

This follows apache/skywalking-ai-sessionizer#94, which changes the text of a step that stands on one part of a record.
The OAP mirrors the document the Sessionizer defines in
The asz.view document.

  • The rule. A step on a part that holds data reads that part alone: the prompt inside it when it is a
    queued_command envelope, and otherwise the data as the part holds it. A tool call that shares a record with the
    agent's text reads as its arguments, never as that text.
  • Before. ConversationViewBuilder.fill took the readable text of the whole record whenever it differed from the
    part's data. So a tool call beside the agent's text read as that text, and a queued command beside other text read as
    that other text.
  • How often. On a local Sessionizer root, 10 of 25 LangChain tool calls shared a record with text, and 3 of 109,397
    Claude Code ones.

Tests.

  • RecordReadingTest.aStepOnAPartReadsThatPart mirrors the Sessionizer's own test: a tool call beside the agent's text
    reads as its arguments, and a queued command beside unrelated text reads as its own prompt. fill is now
    package-private so the test can call it.
  • Each half was proven by reverting it and seeing the test fail: with the old rule the call read as the agent's text,
    and with the prompt taken from the whole record the queued command read as the unrelated text.
  • No fixture holds a record with text beside a call or a queued command, so every document the tests compare with the
    Sessionizer's is unchanged. All 186 tests of the module pass.

The Horizon UI needs no change: it draws the text the document carries.

A step on one part of a record reads that part alone, as the AI
Sessionizer does since apache/skywalking-ai-sessionizer#94. The document
read a tool call that shares a record with the agent's text as that
text, and a queued command kept as data beside other text as that text
too. Now a tool call reads as its arguments, and a queued command as the
prompt inside its own data.

On a local Sessionizer root, 10 of 25 LangChain tool calls shared a
record with text, and 3 of 109,397 Claude Code ones. No test fixture
holds such a record, so the documents the tests compare with the
Sessionizer's are unchanged.
@wu-sheng wu-sheng added this to the 11.1.0 milestone Oct 28, 2026
@wu-sheng wu-sheng added bug Something isn't working and you are sure it's a bug! backend OAP backend related. labels Oct 28, 2026
@wu-sheng
wu-sheng merged commit 4c831c7 into master Oct 28, 2026
709 of 723 checks passed
@wu-sheng
wu-sheng deleted the ai-agent-tool-call-text branch October 28, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. bug Something isn't working and you are sure it's a bug!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants