Conversation
The `IM slack send failed: invalid_thread_ts` issue (ODE-DEAMON-7) only captured channel_id, platform and op — not the thread id the adapter tried to post into. That made the root cause (a malformed / synthetic thread id reaching Slack) impossible to diagnose from Sentry alone. Thread the `threadId` through `deliveryStats.recordFailure` for Slack threaded sends and surface it as both a tag and delivery-context field in the Sentry event. Top-level channel sends and update/delete ops leave it undefined (they don't target a thread). No behavior change — purely observability.
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.
Summary
senddelivery failures with the targetthreadIdso Sentry events likeODE-DEAMON-7(IM slack send failed: invalid_thread_ts) are diagnosable without having to correlate with local logs.Context
ODE-DEAMON-7only capturedchannel_id,platform,op— the offending thread id (Slack complained the value was9223372036854775807, a value never produced by us directly) was lost.thread_idappears as both a Sentry tag and under thedeliverycontext, so the next occurrence tells us exactly which thread id was passed in.Changes
FailureRecord.threadIdadded;deliveryStats.recordFailure()accepts an optionalthreadId.sendMessagenow passes the thread id on failure (other ops / other adapters unchanged — update/delete target amessageTs, not a thread).captureDeliveryFailuresurfacesthread_idas a tag plus delivery-context field.Testing
bun test packages/ims/shared/delivery-stats.test.ts→ 11 passbun test packages/core/observability/sentry.test.ts→ 6 passbunx tsc --noEmit→ no new errors (pre-existing web-ui missing-module warnings only)