iachat/app/models/concerns
Aakash Bakhle a90ffe6264
feat: Add force legacy auto-resolve flag (#13804)
# Pull Request Template

## Description

Add account setting and store_accessor for
`captain_force_legacy_auto_resolve`.
Enterprise job now skips LLM evaluation when this flag is true and falls
back to legacy time-based resolution. Add spec to cover the fallback.


## Type of change

We recently rolled out Captain deciding if a conversation is resolved or
not. While it is an improvement for majority of customers, some still
prefer the old way of auto-resolving based on inactivity. This PR adds a
check.

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration.

legacy_auto_resolve = true

<img width="1282" height="848" alt="CleanShot 2026-03-13 at 19 55 55@2x"
src="https://github.com/user-attachments/assets/dfdcc5d5-6d21-462b-87a6-a5e1b1290a8b"
/>


legacy_auto_resolve = false
<img width="1268" height="864" alt="CleanShot 2026-03-13 at 20 00 50@2x"
src="https://github.com/user-attachments/assets/f4719ec6-922a-4c3b-bc45-7b29eaced565"
/>



## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream
modules
2026-03-13 15:04:58 -07:00
..
.keep Initial Commit 2019-08-14 15:18:44 +05:30
access_tokenable.rb Chore: Replaced dependent destroy with dependent destroy_async in all models (#3249) 2021-11-18 10:32:29 +05:30
account_cache_revalidator.rb feat: expiry for cache keys [CW-3038] (#8793) 2024-01-29 15:27:26 +05:30
account_captain_auto_resolve.rb feat: Add force legacy auto-resolve flag (#13804) 2026-03-13 15:04:58 -07:00
account_email_rate_limitable.rb fix: disable email transcript for free plans (#13509) 2026-02-11 21:21:36 +05:30
activity_message_handler.rb feat: show assignment policy name in auto-assignment activity messages (#13598) 2026-02-24 13:32:54 +05:30
assignee_activity_message_handler.rb feat: show assignment policy name in auto-assignment activity messages (#13598) 2026-02-24 13:32:54 +05:30
assignment_handler.rb feat: Add support for multi-language support for Captain (#11068) 2025-03-19 18:25:33 -07:00
auto_assignment_handler.rb fix: Enforce team boundaries to prevent cross-team assignments (#13353) 2026-02-16 14:39:20 +05:30
availability_statusable.rb chore: Move agent availability to Account level (#3074) 2021-10-07 13:21:46 +05:30
avatarable.rb chore: Upgrade to Rails 7 (#6719) 2023-05-06 10:44:52 +05:30
cache_keys.rb feat: expiry for cache keys [CW-3038] (#8793) 2024-01-29 15:27:26 +05:30
captain_featurable.rb feat: add global config for captain settings (#13141) 2026-01-12 19:54:19 +05:30
channelable.rb chore: Centralize outgoing message reply restrictions for all the channels (#11279) 2025-04-12 08:52:12 +05:30
content_attribute_validator.rb chore: Upgrade rails and ruby versions (#2400) 2021-08-03 20:11:52 +05:30
conversation_mute_helpers.rb fix: prevent NoMethodError in mute helpers when contact is nil (#13277) 2026-01-15 22:00:09 -08:00
featurable.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
inbox_agent_availability.rb feat: Assignment service (v2) (#12320) 2025-11-17 10:08:25 +05:30
json_schema_validator.rb feat: Add support for minutes in auto resolve feature (#11269) 2025-05-07 00:36:15 -07:00
label_activity_message_handler.rb feat: add activity message for SLA (#9100) 2024-03-13 20:05:34 +05:30
labelable.rb feat: Add support for labels in automations (#11658) 2025-09-18 14:17:54 +05:30
liquidable.rb feat: Add liquid template support for WhatsApp template parameters (#12227) 2025-08-21 16:44:51 +05:30
llm_formattable.rb chore: Update LLM formatter classes to include additional details (#11491) 2025-05-15 17:47:37 -07:00
message_filter_helpers.rb fix: Skip notifications for private notes (#13617) 2026-02-23 15:40:54 +04:00
out_of_offisable.rb Fix: add option to choose 24 hour working slot (#4018) 2022-02-22 01:28:49 -08:00
priority_activity_message_handler.rb chore(i18n): Improvements in automation and macros (#11231) 2025-04-02 15:48:42 -07:00
pubsubable.rb chore: Rotate pubsub token on password change (#7194) 2023-05-27 13:24:31 +05:30
push_data_helper.rb feat: UI to show the SLA threshold in chat screen (#9146) 2024-04-04 15:46:46 +05:30
reauthorizable.rb fix: call authorization_error! on IMAP auth failures (#13560) (revert) (#13671) 2026-02-26 18:45:18 -08:00
reportable.rb Chore: clean up Reporting Events (#4044) 2022-02-28 18:16:12 +05:30
sla_activity_message_handler.rb feat: add activity message for SLA (#9100) 2024-03-13 20:05:34 +05:30
sort_handler.rb feat: Add a priority + created at sort for conversations (#13658) 2026-02-25 18:22:41 -08:00
sso_authenticatable.rb feat: Prevent saving preferences and status when impersonating (#11164) 2025-05-20 17:34:30 -07:00
team_activity_message_handler.rb feat: add activity message for SLA (#9100) 2024-03-13 20:05:34 +05:30
user_attribute_helpers.rb chore: Account switching issue in newly added accounts (#12403) 2025-09-10 14:12:22 +05:30