feat: add graphKey support to tracker events and resumption tokens#10
Open
mattrmc1 wants to merge 1 commit into
Open
feat: add graphKey support to tracker events and resumption tokens#10mattrmc1 wants to merge 1 commit into
mattrmc1 wants to merge 1 commit into
Conversation
jsonbailey
approved these changes
Jul 9, 2026
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
Extends
Trackerwith an optionalgraphKeyparameter. When non-empty,graphKeyis included in every event'strackDataand in the resumption token. When empty, it is omitted entirely. This is the foundation for agent-graph node trackers (Task 06), where each node's tracker carries the containing graph's key.Tracker construction
newTrackerandnewTrackerWithStopwatchgain agraphKey stringparameter (last positional arg). ThegraphKeyis stored on theTrackerstruct and conditionally added totrackData:All existing call sites in
client.go(returnDefaultandevaluateConfig) pass"", so current behavior is unchanged.Resumption token
resumptionPayloadgains aGraphKeyfield withjson:"graphKey,omitempty":TrackerFromResumptionTokenreadsgraphKeyfrom the decoded payload and passes it through to the reconstructed tracker.Test plan
go test -race ./...passesgraphKey="my-graph"— every emitted event (success, duration, tokens, etc.) includes"graphKey":"my-graph"in datagraphKey=""—graphKeykey absent from trackData entirely (not present as empty string)"graphKey":"my-graph"graphKeykey absent from JSONTrackerFromResumptionTokenwith graphKey — reconstructed tracker emits events with graphKey and produces an identical resumption tokenClient.CreateTrackerround-trip with graphKey — token survives client-level reconstruction, events include graphKey""everywhere)Note
Low Risk
Additive optional metadata on existing tracker APIs; default call sites unchanged and covered by tests for token round-trip and event payloads.
Overview
Adds an optional
graphKeyon internalTrackerconstruction so agent-graph node runs can tag analytics with the parent graph. When set,graphKeyis included in sharedtrackDatafor all metric events and inResumptionTokenJSON (omitempty); when empty, the field is omitted entirely.TrackerFromResumptionTokenandClient.CreateTrackerround-trips preservegraphKey. Config-driven tracker factories inclient.gostill pass"", so completion/judge configs behave as before until graph node code supplies a key.Reviewed by Cursor Bugbot for commit 3ed63d3. Bugbot is set up for automated code reviews on this repo. Configure here.