Repository navigation
fix(auto-reply): record reply_operation_aborted as skipped, not completed - #245
Closed
jerhinesmith wants to merge 1 commit into
Closed
jerhinesmith wants to merge 1 commit into
jerhinesmith wants to merge 1 commit into
Conversation
…eted
finishReplyOperationAbortedDispatch logged outcome:"completed" for a
turn that never produced a delivered reply - dropped before dispatch,
or aborted mid-flight because the reply operation it was piggybacking
on was force-resolved as aborted. This misreports a dropped/aborted
turn as a successful one in the message.processed diagnostic log/event
that Loki, dashboards, and the diagnostics-otel counters read verbatim.
Nothing downstream corrects it.
finishReplyOperationBusyDispatch, right above this function, already
uses "skipped" for the analogous non-delivery case ("reply-operation-
active") - this brings the aborted-dispatch sibling in line with that
existing pattern.
Root-caused from a live incident on customer tanco (thread-9434):
inbound messages arriving while a session was wedged behind a stalled
turn were dispatched into this path and logged outcome=completed with
zero content ever delivered, hiding a real drop from on-call triage.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/auto-reply/reply/dispatch-from-config.ts">
<violation number="1" location="src/auto-reply/reply/dispatch-from-config.ts:2079">
P3: This eight-line comment repeats telemetry and PR context instead of documenting the invariant. Condense it to 1–3 lines explaining that aborted turns must not be counted as successful.
(Based on your team's feedback about concise source comments and removing PR-specific narrative.)</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| }): DispatchFromConfigResult => { | ||
| commitInboundDedupeIfClaimed(); | ||
| recordProcessed("completed", { reason: "reply_operation_aborted" }); | ||
| // This turn never produced a delivered reply - it was dropped before dispatch |
There was a problem hiding this comment.
P3: This eight-line comment repeats telemetry and PR context instead of documenting the invariant. Condense it to 1–3 lines explaining that aborted turns must not be counted as successful.
(Based on your team's feedback about concise source comments and removing PR-specific narrative.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/auto-reply/reply/dispatch-from-config.ts, line 2079:
<comment>This eight-line comment repeats telemetry and PR context instead of documenting the invariant. Condense it to 1–3 lines explaining that aborted turns must not be counted as successful.
(Based on your team's feedback about concise source comments and removing PR-specific narrative.) </comment>
<file context>
@@ -2076,7 +2076,15 @@ export async function dispatchReplyFromConfig(
}): DispatchFromConfigResult => {
commitInboundDedupeIfClaimed();
- recordProcessed("completed", { reason: "reply_operation_aborted" });
+ // This turn never produced a delivered reply - it was dropped before dispatch
+ // or aborted mid-flight (the underlying reply operation it was piggybacking on
+ // was force-resolved as aborted). "completed" here misreports a dropped/aborted
</file context>
Author
|
Closing — too stale (8 weeks unmerged). If the reply_operation_aborted mislabeling were still causing customer-visible impact, it would have been re-reported by now. ENG-20495 is already marked Done. |
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
finishReplyOperationAbortedDispatch(src/auto-reply/reply/dispatch-from-config.ts:2075) loggedoutcome:"completed"for a turn that never produced a delivered reply — dropped before dispatch, or aborted mid-flight because the reply operation it was piggybacking on was force-resolved as aborted. This misreports a dropped/aborted turn as a successful one in themessage.processeddiagnostic log/event that Loki, dashboards, and thediagnostics-otelcounters read verbatim. Nothing downstream corrects it on this branch.finishReplyOperationBusyDispatch, the sibling function right above this one, already uses"skipped"for the analogous non-delivery case ("reply-operation-active") — this brings the aborted-dispatch path in line with that existing pattern.outcome=completedwith zero content ever delivered, hiding a real drop from on-call triage. Full RCA + timeline: ENG-20495.(Supersedes #244, which was built off a stale pre-fork
maininstead ofboonand showed a bogus ~35k-file diff as a result — same fix, correct base this time.)Test plan
dispatch-from-config.acp-abort.test.ts(the two tests pinning the oldoutcome:"completed"behavior, updated to"skipped"): 16/16 passdispatch-from-config.test.ts,dispatch-from-config.acp-abort.test.ts,src/gateway/server-methods/: 115 files / 2525 tests, all passNot in scope (flagged for follow-up in ENG-20495)
🤖 Generated with Claude Code
Summary by cubic
Fixes the auto-reply
message.processeddiagnostic log so turns that never produced a delivered reply are recorded asskippedinstead ofcompleted. Turns dropped before dispatch, or aborted mid-flight because the reply operation they piggybacked on was force-resolved as aborted, were previously logged as successful — hiding real message drops from Loki, dashboards, and on-call triage (root-caused from incident ENG-20495 on customer tanco).Brings
finishReplyOperationAbortedDispatchin line withfinishReplyOperationBusyDispatch, which already recordsskippedfor the analogous non-delivery path (reply-operation-active).Written for commit b2668fb. Summary will update on new commits.