Repository navigation
Router 0.12.0: snoozed kinds keep their owner - #176
Merged
Merged
Conversation
Snooze answered kinds before assigning their confident owner so Chatwoot keeps the cleared customer wait. Apply routed topic rules, preserve resolved behavior, and document retry semantics. Co-Authored-By: Codex <noreply@openai.com>
Apply a canned-response snooze only after this routing attempt sends and confirms its reply. Route historical-reply follow-ups normally while preserving snoozed kinds without canned responses and resolved behavior. Co-Authored-By: Codex <noreply@openai.com>
Warn with conversation identifiers when status, inbox, or bot ownership changes before the owner assignment. Co-Authored-By: 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.
Summary
Auto-answered kinds currently hand pending bot conversations to people after the canned reply. Chatwoot clears
waiting_sincefor the reply, then re-arms it on pending assignment or bot handoff, so an answered customer still appears to be waiting for a human.Snoozed kinds now send the guarded reply, complete the before-handoff hook, snooze as the account bot, and assign the confident owner. This preserves the cleared wait and puts the owner in place before the customer's next message reopens the ticket directly to open. Snoozed kinds use the same confidence, account-agent validation, and topic-label rules as routed tickets. Resolved kinds still set tickets aside without assigning an owner. Configuration remains backward compatible; the package and lockfile move to 0.12.0.
For a snoozed kind with
cannedResponse, only a reply sent and confirmed by the current routing attempt permits snoozing. When the once-per-ticket guard finds an earlier reply, route normally to the owner or hand off so an unanswered follow-up stays open for people. Snoozed kinds without a canned response retain their configured status behavior. A changed status, inbox, or bot ownership after snoozing is logged before deferring the assignment.Chatwoot v4.19.0 source checked for this change:
Verification
Node 24.21.0 / npm 12.1.0:
npm run lint— passed.npm run typecheck— passed across the repository.npm test -w packages/chatwoot-router— 198 tests passed in 5 files. Covers reply → hook → snooze → assignment order, no open/handoff mutation, no confident owner, resolved behavior, account-agent validation, takeovers after snooze, assignment errors/lost responses, a five-page turn plus hook within the 45-request budget, unanswered follow-ups with historical replies, and unchanged snoozing without a canned response.Existing retry limitation: if assignment fails after snoozing, the next run releases the still-owned bot and leaves the conversation snoozed without an owner; it does not repeat the reply, hook, or status change. If Chatwoot committed the assignment but its response was lost, retry preserves the owner. These behaviors are documented and tested without adding an effects ledger.
Checklist
CHANGELOG.mdfor the requested 0.12.0 release.