)]}'
{
  "commit": "ed17fdf0b3ea6c0b8a8f96125ccc785c5587bb9c",
  "tree": "d6463e625085f73143798b50c9fb2eb30b9c04ab",
  "parents": [
    "160fb06bb7c8df956daecd4d3bdb3f94d8a93406"
  ],
  "author": {
    "name": "Josh Bleecher Snyder",
    "email": "josharian@gmail.com",
    "time": "Fri May 23 17:26:07 2025 +0000"
  },
  "committer": {
    "name": "Josh Bleecher Snyder",
    "email": "josharian@gmail.com",
    "time": "Fri May 23 11:46:11 2025 -0700"
  },
  "message": "loop: fix data race in Agent.CurrentStateName()\n\nThe CurrentStateName() method was directly accessing the stateMachine\u0027s\ncurrentState field without proper synchronization, causing data races\nwith TransitionWithEvent() which writes to the same field while holding\na write lock.\n\nThe StateMachine struct already provides a thread-safe CurrentState()\nmethod that properly acquires a read lock before accessing currentState.\n\nThis fix changes CurrentStateName() from:\n  return a.stateMachine.currentState.String()\nto:\n  return a.stateMachine.CurrentState().String()\n\nThis eliminates the race condition between HTTP handler goroutines\nreading state for SSE streams and the agent loop goroutine writing\nstate during transitions.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: sadf9961b9f084fa7\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "909700ea388b359c29157b82b6b5c66184f62815",
      "old_mode": 33188,
      "old_path": "loop/agent.go",
      "new_id": "c8891cd6e99fcc7579d69d30aa66a213e7a54b6d",
      "new_mode": 33188,
      "new_path": "loop/agent.go"
    }
  ]
}
