You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/09/21 04:10:01 UTC
[PR] Land what each LangChain model call was sent, beside the conversation [skywalking-ai-sessionizer]
wu-sheng opened a new pull request, #29:
URL: https://github.com/apache/skywalking-ai-sessionizer/pull/29
The one thing deliberately left out of #28. A call's record keeps what the model said; this
lands what it was told, beside the conversation, as a provider body cut against what the session
already holds — the same `pkg/providerbody` mechanism Claude Code's bodies use.
## What it is for
- The **continuity check** between calls in a stream, which is what `auxiliary` exists for.
- A **nested agent's own prompt**: a child's talk can now show what it was asked.
- Telling **compaction written as a tool** from a plain summarise call: does the next prompt
continue the history or start from the summary.
## What was measured
Every call's inputs and outputs, through `providerbody.Session`, on the captured corpus:
| Capture | On the wire | Conversation | Bodies | Together |
| --- | --- | --- | --- | --- |
| long-conversation, 20 turns | 1.63 MB | 7.7% | 5.3% | 13.0% |
| large-content | 1.34 MB | 7.2% | 7.9% | 15.2% |
| subagent | 179 KB | 22.7% | 13.4% | 36.0% |
| all nine captures | 3.75 MB | 10.1% | 7.7% | 17.8% |
Cutting pays on a long conversation and costs on a short one, where a body's rebuild note is
larger than what it saves. Both are on the adapter page. The page had estimated "twelve times"
for landing bodies whole; the measurement replaces the estimate.
## The rule, and one change to placement
A request is landed from the first arrival of a run that carries inputs; a response only from the
arrival carrying the run's end; a repeat is a repeat. A body joins the way the assembler already
joins one: a response by its call, a request by the prompt of its stream and the request before
it there.
That exposed a collision: every stream of one trace shared the trace as its prompt, so the first
call of the caller and the first call of a nested agent carried one key and neither could join.
A nested stream's records now name the tool they ran inside as their prompt. With that, every
call in every stream of the subagent capture carries its request and its response.
On this wire a body is the framework's view of what it sent — LangChain's serialized messages —
not the bytes the provider received. The manifest says so.
`provider_bodies: true` on `langsmith-ingest`, on by default.
## Verification
`make check` passes. `TestEveryModelCallCarriesWhatItWasSent` holds on three captures including
the nested agent's first call; `TestARunSentTwiceLandsItsBodiesOnce` covers a run posted open and
patched closed; `TestProviderBodiesCanBeTurnedOff` covers the switch. The measurement test prints
the table above. Verified live: each call on the page carries `request` and `response`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Land what each LangChain model call was sent, beside the conversation [skywalking-ai-sessionizer]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #29:
URL: https://github.com/apache/skywalking-ai-sessionizer/pull/29
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org