Skip to content

Fix false first_reply_time breaches when an agent replies before Zendesk delays the clock (v1.9.1) - #287

Closed
fivetran-catfritz wants to merge 2 commits into
mainfrom
bug/early-agent-reply-before-delayed-sla-start
Closed

fivetran-catfritz wants to merge 2 commits into
mainfrom
bug/early-agent-reply-before-delayed-sla-start

Conversation

@fivetran-catfritz

Copy link
Copy Markdown
Contributor

Context

A reopened customer complaint surfaced 4 tickets still showing false first_reply_time breaches after v1.9.0. All 4 share the same pattern: an agent already replied publicly, but Zendesk hadn't started the first_reply_time clock yet because the customer's own first public comment hadn't happened (the delayed-start behavior #278 correctly started reading directly from Zendesk). Once the clock did start, the model searched forward for the agent's next reply instead of recognizing the earlier one, producing a false breach.

This is a regression introduced by #278, not a pre-existing issue — confirmed directly: ticket.created_at for all 4 tickets exactly matches their first (private) comment, which is what sla_applied_at used before #278. The agent's early public reply landed between that old anchor and the new (correctly delayed) one, so these tickets resolved met before #278 and breach after.

Fix

sla_applied_at for first_reply_time now anchors at ticket creation whenever a public agent/admin reply already exists before the logged instance. This replaces the #279 fix's "earliest logged instance" check with a simpler, more precisely scoped "earliest already-given reply" check — covering both this case and #279's re-application case through the same mechanism, since what's actually evidenced is that Zendesk marks the metric met once a reply has already happened, not simply whichever instance was logged first.

Single file changed: int_zendesk__sla_policy_applied.sql.

Verification

Release

Patch (v1.9.1): this corrects a defect in the just-shipped v1.9.0 behavior rather than changing long-stable behavior.

🤖 Generated with Claude Code

fivetran-catfritz and others added 2 commits October 21, 2026 10:14
…tes it (v1.9.1)

#278 correctly delayed sla_applied_at to Zendesk's logged clock start,
but an agent can reply publicly before that point (Zendesk delays the
clock until the customer's own first public comment, not the agent's).
That early reply was being ignored, and the model would wait for the
agent's *next* reply, producing a false breach.

sla_applied_at for first_reply_time now anchors at ticket creation
whenever a public agent/admin reply already exists before the logged
instance, which covers both this case and the #279 re-application
case through the same mechanism. Replaces the #279 fix's "earliest
logged instance" check with a simpler, more precisely scoped "earliest
already-given reply" check, since that's what's actually evidenced:
Zendesk marks the metric met once a reply has already happened, not
simply whichever instance was logged first.

Verified against 4 real tickets reported in a reopened customer
complaint (420358, 407147, 360783, 331197) — all now resolve to met.
Checked the broader population in digital-arbor-400.zendesk_new:
714 tickets flip from falsely breached to met, zero regressions in
the other direction (the fix can only move a ticket toward met).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fivetran-catfritz
fivetran-catfritz deleted the bug/early-agent-reply-before-delayed-sla-start branch October 21, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant