ref(coding integration): switch to event based polling for claude integration#110260
Merged
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Missing error handling for API call breaks multi-agent polling
- Added try/except Exception block around poll_claude_agent call to prevent one agent's failure from stopping others, matching the GitHub Copilot pattern.
- ✅ Fixed: Redundant
result = Noneimmediately overwritten- Removed redundant result=None assignment on line 656 that was immediately overwritten by the tuple assignment.
Or push these changes by commenting:
@cursor push bf27c9eb7d
Preview (bf27c9eb7d)
diff --git a/src/sentry/seer/autofix/coding_agent.py b/src/sentry/seer/autofix/coding_agent.py
--- a/src/sentry/seer/autofix/coding_agent.py
+++ b/src/sentry/seer/autofix/coding_agent.py
@@ -628,7 +628,13 @@
return
for agent_id, agent_state in agents.items():
- poll_claude_agent(clients, agent_id, org_id, agent_state)
+ try:
+ poll_claude_agent(clients, agent_id, org_id, agent_state)
+ except Exception:
+ logger.exception(
+ "coding_agent.claude_code.poll_error",
+ extra={"agent_id": agent_id},
+ )
def poll_claude_agent(clients, agent_id, org_id, agent_state: CodingAgentState) -> None:
@@ -653,7 +659,6 @@
if last_event_type == "status_idle":
new_status = CodingAgentStatus.COMPLETED
- result = None
result, new_status = build_result_from_events(
all_events, client, agent_id, agent_state.name, new_status
)
JoshFerge
reviewed
Mar 10, 2026
JoshFerge
reviewed
Mar 10, 2026
JoshFerge
reviewed
Mar 10, 2026
JoshFerge
reviewed
Mar 10, 2026
JoshFerge
approved these changes
Mar 10, 2026
Member
JoshFerge
left a comment
There was a problem hiding this comment.
overall makes sense, added some small comments. can fix + ship!
…0291) Updated anthropic api for claude integration requires new agent definitions. This PR follows the getsentry api changes. Changes: - add agent id and version to metadata - persist agent values with environment ones - update tests to match
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Using status of session was unreliable in production due to syncing issues. Better to wait for idle_status event which always happens when expected.