From d46d388fba568beec3e02a1378a8e554c15cf1d2 Mon Sep 17 00:00:00 2001 From: Aakash Bakhle <48802744+aakashb95@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:29:52 +0530 Subject: [PATCH] feat: accept future Captain response payloads (#15212) This is phase one of a rolling deployment for Captain burst handling. The job now accepts an optional third argument named `responding_to_message_id`. The job does not use the argument yet, and no enqueue call changes in this PR. The change lets old workers accept the future three argument payload while versions overlap during deployment. There is no behavior change. This is a pre-requisite for https://github.com/chatwoot/chatwoot/pull/15133 because if we introduce another argument, and post deployment, older jobs will fail with argument error and result in no captain replies ## Validation * `bundle exec rspec spec/enterprise/jobs/captain/conversation/response_builder_job_spec.rb` * `bundle exec rubocop enterprise/app/jobs/captain/conversation/response_builder_job.rb` --- .../app/jobs/captain/conversation/response_builder_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enterprise/app/jobs/captain/conversation/response_builder_job.rb b/enterprise/app/jobs/captain/conversation/response_builder_job.rb index fb0e72721..68367f532 100644 --- a/enterprise/app/jobs/captain/conversation/response_builder_job.rb +++ b/enterprise/app/jobs/captain/conversation/response_builder_job.rb @@ -7,7 +7,7 @@ class Captain::Conversation::ResponseBuilderJob < ApplicationJob retry_on ActiveStorage::FileNotFoundError, attempts: 3, wait: 2.seconds retry_on Faraday::BadRequestError, attempts: 3, wait: 2.seconds - def perform(conversation, assistant) + def perform(conversation, assistant, responding_to_message_id = nil) # rubocop:disable Lint/UnusedMethodArgument @conversation = conversation @inbox = conversation.inbox @assistant = assistant