feat(trace): plumb parentRunId from cloud_run and replay entry points - #2874
Merged
esokullu merged 2 commits intoAug 21, 2026
Merged
Conversation
|
@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
_startTraceRun forwards parentRunId/parentSessionId from runOptions so derived runs can name their origin. The two fork points now produce real lineage data: the cloud run controller passes the active browser run on the tab (Chrome-only module, mirrored by platform boundary), and replaySavedWorkflow links the current run and its conversation. Root runs keep null/0 as before; a missing parent falls back to null without a new failure path. Mirrored to Firefox. Closes webbrain-one#2871
esokullu
force-pushed
the
feat/trace-parent-plumbing
branch
from
August 21, 2026 07:13
07b29a0 to
3118ce1
Compare
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.
Summary
_startTraceRunnow forwardsparentRunId/parentSessionIdfromrunOptionsintotrace.startRun, giving derived runs a way to name their origin.replaySavedWorkflowlinks the current run and its conversation.null/0 exactly as before; a missing parent falls back tonullwith no new failure path.Motivation
Closes #2871.
The lineage fields from the recorder-side PR (parentRunId/parentSessionId/delegationDepth) had no producers: without call sites passing parent info, the fields would stay empty for every run and the attribution capability would be dead weight. Cloud runs (
cloud-runs.js) and workflow replays (replaySavedWorkflow) are the two entry points with clear fork semantics, so they are the first to propagate parent run info.Design
_startTraceRunreadsrunOptions.parentRunId/runOptions.parentSessionId(optional-chained,|| null) and passes them intotrace.startRun. Call sites that don't provide them are unchanged — the recorder storesnull/0 as before.cloud-runs.js) threadsagent.currentRunId?.get?.(tabId)andagent.conversationIds?.get?.(tabId)as parent — i.e. a cloud run launched while a browser trace run is active on that tab is recorded as that run's child. Cloud runs launched standalone (e.g. from the scheduler) record as roots.replaySavedWorkflowpasses the tab's activecurrentRunIdand conversation id the same way.Testing
node test/run.js— passed, 1955 tests (3 new):runOptionshanded toagent.processMessage);_startTraceRunand replay plumbing present in both builds; Firefox cloud-runs absence asserted as the platform boundary.node --checkon every touched file — passedSkipped: unpacked-browser manual verification (no browser session available in this environment); the cloud-run path is exercised through the existing mocked-controller harness instead.
Compatibility and risks
Scope
Deliberately deferred: scheduler entry points (no parent/child semantics today — evaluated later), planner (its events already live inside the same run, no fork).