Skip to content

Commit 5b52fed

Browse files
committed
fix(seer): Populate referrer field in agent_handoff analytics from launch path
The agent_handoff event recorded in launch_coding_agents_for_run was hardcoding referrer=None, making existing BigQuery queries that filter on referrer silently miss these events. Pass a meaningful referrer from each caller. Agent transcript: https://claudescope.sentry.dev/share/IIXyFpJBudWIkdVKN1r9Zuex_oc_9hN1nUxhAi-tgF0
1 parent 5ab68e5 commit 5b52fed

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/sentry/integrations/api/endpoints/organization_coding_agents.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def post(self, request: Request, organization: Organization) -> Response:
154154
instruction=instruction,
155155
user_id=request.user.id,
156156
initiator="user",
157+
referrer="api.organization_coding_agents",
157158
)
158159

159160
successes = results["successes"]

src/sentry/seer/autofix/coding_agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ def launch_coding_agents_for_run(
421421
instruction: str | None = None,
422422
user_id: int | None = None,
423423
initiator: str | None = None,
424+
referrer: str | None = None,
424425
) -> dict[str, list]:
425426
"""
426427
Launch coding agents for an autofix run.
@@ -521,7 +522,7 @@ def launch_coding_agents_for_run(
521522
organization_id=organization.id,
522523
project_id=autofix_state.request.project_id,
523524
group_id=autofix_state.request.issue["id"],
524-
referrer=None,
525+
referrer=referrer,
525526
coding_agent=coding_agent_name,
526527
initiator=initiator,
527528
)

src/sentry/seer/endpoints/seer_rpc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ def trigger_coding_agent_launch(
602602
run_id=run_id,
603603
trigger_source=AutofixTriggerSource(trigger_source),
604604
initiator="seer_agent",
605+
referrer="seer_rpc.trigger_coding_agent_launch",
605606
)
606607
return {"success": True}
607608
except IntegrationNotFound:

0 commit comments

Comments
 (0)