Repository navigation
fix(seer): Keep one failed Seer Agent reply edit from blocking the rest - #128808
Merged
Merged
Conversation
joseph-sentry
force-pushed
the
joey--slack-agent-reply-edit-errors
branch
from
October 26, 2026 19:26
78ecc5e to
ed6e16e
Compare
Contributor
|
bugbot run |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ed6e16e. Configure here.
billyvg
reviewed
Oct 26, 2026
billyvg
reviewed
Nov 3, 2026
Editing a posted Seer Agent answer now goes through its own lifecycle, like send_thread_update. Halt-category Slack errors and a deleted message (message_not_found) are recorded as halts instead of being raised for task retries. Other edit failures no longer stop the loop: the remaining answers are still edited and cached, then the first error is raised so the refresh retries only what failed. A reply that didn't post now logs its run and reply key. Refs CW-2180
…ng it Adding it to SLACK_SDK_HALT_ERROR_CATEGORIES makes translate_slack_api_error raise IntegrationConfigurationError, so edit_thread_message's existing halt branch covers deleted messages without an inline import or message comparison. Refs CW-2180
…replies Only a missing message or channel ends a Seer Agent reply edit. Slack's update_message now raises IntegrationResourceNotFoundError for message_not_found, channel_not_found and is_archived, and on_agent_update caches the new hash so later refreshes skip the reply. Other halt categories, like ratelimited, are still recorded as halts but raised so refresh_agent_run retries the edit. message_not_found is no longer in the shared halt list. Refs CW-2180
Replace the three edit-error tests with one test that runs refreshes until nothing is left to edit. A rate-limited edit doesn't block the next answer and is retried, and a deleted reply halts once and isn't edited again. The reply_not_posted log no longer has its own test.
send_thread_update swallows halts, so refresh_agent_run isn't retried and the reply only posts if Seer sends another completion hook. Refs CW-2180
Master replaced SlackApiError with TypedSlackApiError in this test file under strict mypy, so the merged test lost its SlackApiError import.
sentry-junior
Bot
force-pushed
the
joey--slack-agent-reply-edit-errors
branch
from
November 3, 2026 16:49
0baa0d9 to
88ff054
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.
Follows up on @billyvg's review of #127881.
Before this change,
edit_thread_messagecalledchat.updatewithout a lifecycle or error handling. So when one answer's edit failed (for example,message_not_foundafter someone deleted the message), the error left the loop before the later answers were edited. That answer'spr_status_hashwas never updated, so every later refresh failed on the same edit, and the latest answer's footer could stay on "Creating a PR in …".What changed:
edit_thread_messagenow runs inside its ownSlackEntrypointEventLifecycleMetric(edit_thread_message).message_not_found,channel_not_found,is_archived) ends the edit.SlackIntegration.update_messageraisesIntegrationResourceNotFoundErrorfor these,edit_thread_messagerecords a halt and returns, andon_agent_updatecaches the new hash so later refreshes don't callchat.updateon that reply again.refresh_agent_runretries the edit. Halt categories that can clear, likeratelimitedorinternal_error, are recorded as halts and raised. Other errors are recorded as failures and raised. A timeout is raised asIntegrationError.on_agent_updatecatches edit errors one message at a time. It still edits and caches the remaining answers, then raises the first error so the refresh retries only the edits that failed.send_thread_updatereturns nomessage_ts. In practice that's a halt, which its lifecycle already records, but the record didn't say which run it was for.on_agent_updatenow logsseer.entrypoint.slack.agent_update.reply_not_postedwith the run id and reply key. A halted post isn't retried:send_thread_updatedoesn't raise, so the reply waits for the run's next Seer completion hook. Retrying transient post halts would changesend_thread_update, whichprocess_thread_updateandon_trigger_agent_erroralso use, so it's left out of this PR.The shared
SLACK_SDK_HALT_ERROR_CATEGORIESlist is unchanged.message_not_foundis now a recognized category, and onlyupdate_messagetreats it, along with the channel errors, as not found. Its other callers catchIntegrationError, whichIntegrationResourceNotFoundErrorsubclasses, so they still record a halt.One test runs refreshes until nothing is left to edit. It covers a rate-limited edit that's retried without blocking the next answer, and a deleted message that halts once and isn't edited again. The
reply_not_postedlog has no test.--
View Session [Sentry]