Repository navigation
fix(sdk): don't send children of a traceable run that isn't sent - #118
Open
Caio Theodoro (caiotheodoro) wants to merge 1 commit into
Open
Caio Theodoro (caiotheodoro) wants to merge 1 commit into
Caio Theodoro (caiotheodoro) wants to merge 1 commit into
Conversation
With LANGSMITH_TRACING unset, a @Traceable called with langsmith_extra={"parent": ...} builds its run but does not send it. The run is still the current run inside the call, so nested traceables take tracing_is_enabled() as true and send themselves with a parent_run_id that never reaches LangSmith. When a run is not sent and the context does not set tracing, store the answer the run got in its context so its children get the same one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #117
When
_setup_rundoesn't send a run and the context has no tracing flag, it now stores the answer it got in the run's context. Nested runs then get the same answer and aren't sent under a parent that never arrives. The run itself behaves as before.I went with skipping the children because
test_client_not_passed_when_traceable_parentalready pins the parent as not sent. Happy to flip it if sending both is the intended behaviour.The new
test_children_not_sent_when_traceable_parent[run_tree|headers]fails on main (assert 1 == 0, from the child's POST).scripts/test(3775 passed) andscripts/lintare green.Drafted with Devin (Claude Opus 5.5, SWE-2).