Commit fc6e3b6
bcode
feat(bcode-laminar): wire LMNR_PARENT_SPAN_CONTEXT env into startTurnSpan
When LMNR_PARENT_SPAN_CONTEXT is set in the process env, every 'turn' span
the plugin opens is parented under the given Laminar span context (via the
parentSpanContext arg startTurnSpan already accepts).
Used by external evaluation harnesses that spawn bcode as a subprocess and
want the agent's traces to nest under their own evaluation span — one trace
per task, judge + agent siblings — instead of producing a separate root
trace per bcode process.
Format is the JSON serialization of a LaminarSpanContext (the lmnr Python
SDK exposes Laminar.serialize_span_context() which returns exactly this
shape; the JS-side parseLaminarSpanContext in span.ts already accepts
snake_case and camelCase keys).
Default behavior (env unset) is unchanged: bcode opens a fresh root turn
span per chat.message event as before.
Read once at plugin init via closure; one process is one parent for our
intended use case (eval harness spawns bcode per task).1 parent dc2c603 commit fc6e3b6
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
| |||
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| |||
0 commit comments