Repository navigation
feat(langchain): Add capture controls - #2763
Conversation
Luca Forstner (lforst)
commented
Nov 9, 2026
- Add separate controls for chain inputs, chain outputs, model inputs, model outputs, and token usage in LangChain and LangGraph traces. Capture remains enabled by default.
- Skip disabled payloads before copying them, while keeping the trace structure, timing, errors, and metadata. This avoids copying large graph state or recording model data already captured by provider instrumentation.
- Support these options in manual callback handlers and automatic instrumentation:
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Abhijeet Prasad (AbhiPrasad)
left a comment
There was a problem hiding this comment.
Why do we need to add all these options? Is there no way to avoid redudant serialization without them?
Abhijeet Prasad (@AbhiPrasad) a user asked for these options. Additionally, the serialization is technically not redundant. What's happening is that we are capturing input/output via the langchain instrumentation, and also via the provider instrumentation, however at the time of capturing the outer, you don't know yet whether there is gonna be an inner, so we need to rely on configuration. I think in most cases payloads aren't gonna be large enough for this to be a problem but in some cases you may need this as an escape hatch. |