feat: support nested traces under external Weave parent ops#38
feat: support nested traces under external Weave parent ops#38
Conversation
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
5ab40b9 to
3b6530c
Compare
|
|
||
| # 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="" |
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?
|
Also @aajais could you please sign the CLA? |
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)