feat: include Sentry event ID in all error responses#307
Merged
Conversation
Every turn failure now captures a Sentry exception and includes the event ID in the user-facing error message. Changes: - logging.ts: ErrorReference now requires eventId (traceId optional), resolveErrorReference requires an eventId string, added buildErrorResponseMessage as the canonical error message builder - reply-executor.ts: provider_error and execution_failure paths now capture the logException return value and rewrite reply.text with the canonical error message containing the event ID - slack-runtime.ts: buildFailureMessage delegates to the canonical buildErrorResponseMessage; types tightened throughout - slack/output.ts: empty-normalization path now throws instead of returning a hardcoded fallback, so the runtime catch handler captures and includes the event ID Closes #305 Co-Authored-By: Claude (anthropic/claude-opus-4.6) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Addresses advisor review feedback: - Replace dynamic buildErrorResponseMessage with static template buildTurnFailureResponse(eventId) — one format, no conditional parts - Remove buildExecutionFailureMessage (dead code after executor rewrite) - Remove ErrorReference/getErrorReference from slack-runtime deps (no longer needed for user-facing error path) - Remove if (eventId) guards in reply-executor — unconditional rewrite - Remove buildFailureMessage wrapper in slack-runtime - turn-result.ts uses empty placeholder; executor owns final text Co-Authored-By: Claude (anthropic/claude-opus-4.6) <noreply@anthropic.com>
Consolidate failed-turn response finalization so live and resumed Slack turns capture a Sentry exception before user-visible delivery. Remove legacy resume fallback text and fail closed when capture does not return an event ID. Fixes #305 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Run resume failure callbacks before enforcing that Sentry returned an event ID. This keeps failure state persisted even when capture is unavailable. Keep the user-visible response contract fail-closed with no fallback event ID. Share the event-ID guard with normal turn failure finalization. Refs #305 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Limit reaction-only text suppression to successful turns. Failed turns with rejected model text now keep thread delivery enabled. Failure finalization still owns the visible event-ID response. Refs #305 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
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.
Reviewed by Cursor Bugbot for commit 2fa9d64. Configure here.
Do not schedule thread text for successful side-effect-only channel posts. Failed turns still keep thread delivery so finalization can replace the text. Refs #305 Co-Authored-By: GPT-5 Codex <noreply@openai.com>
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.

Failed Slack turns now have one failure-response contract: capture a Sentry exception, require the returned event ID, and post the static
event_id={eventId}message. This removes no-reference and legacy resume fallback messages so live turns, OAuth/MCP resumes, and timeout resumes all expose a real Sentry event when they fail.Failure Finalization
finalizeFailedTurnReplyowns failed reply capture and text replacement before Slack planning. It fails closed if Sentry does not return an event ID instead of renderingevent_id=unknown.Resume Delivery
Resume-level failures now post the same canonical event-ID response after capture. Failure state persists before enforcing that captured event ID so Sentry outages do not leave turn state inconsistent.
Slack Planning
Provider-error replies are no longer decorated with interruption markers after being replaced by the canonical failure response. Failed turns whose model text is rejected as escaped/raw payload keep thread delivery enabled so failure finalization owns the visible response, while successful side-effect-only turns no longer schedule empty thread posts.
Fixes #305