feat: support nested traces under external Weave parent ops - #38
Merged
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
aajais
force-pushed
the
aayush/nested-traces
branch
from
April 9, 2026 18:52
5ab40b9 to
3b6530c
Compare
chance-wnb
suggested changes
Apr 9, 2026
|
|
||
| # Inject parent Weave call context so the daemon can nest this session | ||
| # under an external @weave.op (values are UUIDs — safe for literal embedding). | ||
| EXTRA="" |
Contributor
There was a problem hiding this comment.
-
I think JSON handling in the form of string manipulation is fragile. can we avoid it if we can?
-
I think the daemon is capable of reading the same env vars, why don't you just have the daemon process read it directly instead of getting passed over?
Contributor
|
Also @aajais could you please sign the CLA? |
aajais
force-pushed
the
aayush/nested-traces
branch
from
April 13, 2026 21:30
3b6530c to
91862db
Compare
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
chance-wnb
approved these changes
Apr 13, 2026
chance-wnb
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks for your contribution!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
WEAVE_PARENT_CALL_IDandWEAVE_TRACE_IDenvironment variables from the hook handler into the daemon event payload, enabling Claude Code sessions invoked inside a@weave.opto be recorded as child calls.parent_idon the session call to form a proper parent-child hierarchy in Weave.Changes
hooks/hook-handler.shWEAVE_PARENT_CALL_IDandWEAVE_TRACE_IDfrom the environment and injects them into the JSON event payload before sending to the daemon socket.src/daemon.tsparentCallIdto theSessionStateinterface.weave_parent_call_idandweave_trace_idfrom the incoming event payload.parent_idon theclaude_code.sessioncall to the parent call ID (instead ofnull), nesting the session under the external op.Test plan
WEAVE_PARENT_CALL_ID/WEAVE_TRACE_IDset.@weave.op)