fix: consistent instrumentation with conversation.display_id (#13194)

This commit is contained in:
Aakash Bakhle
2026-01-08 12:27:44 +05:30
committed by GitHub
parent 7ba7bf842e
commit dcc72ee63c
4 changed files with 4 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ class Captain::Conversation::ResponseBuilderJob < ApplicationJob
delegate :account, :inbox, to: :@conversation
def generate_and_process_response
@response = Captain::Llm::AssistantChatService.new(assistant: @assistant, conversation_id: @conversation.id).generate_response(
@response = Captain::Llm::AssistantChatService.new(assistant: @assistant, conversation_id: @conversation.display_id).generate_response(
message_history: collect_previous_messages
)
process_response

View File

@@ -37,6 +37,7 @@ class Captain::Llm::ContactNotesService < Llm::BaseAiService
model: @model,
temperature: @temperature,
account_id: @conversation.account_id,
conversation_id: @conversation.display_id,
feature_name: 'contact_notes',
messages: [
{ role: 'system', content: system_prompt },

View File

@@ -100,7 +100,7 @@ class Captain::Llm::ConversationFaqService < Llm::BaseAiService
model: @model,
temperature: @temperature,
account_id: @conversation.account_id,
conversation_id: @conversation.id,
conversation_id: @conversation.display_id,
feature_name: 'conversation_faq',
messages: [
{ role: 'system', content: system_prompt },

View File

@@ -28,7 +28,7 @@ RSpec.describe Captain::Conversation::ResponseBuilderJob, type: :job do
end
it 'uses Captain::Llm::AssistantChatService' do
expect(Captain::Llm::AssistantChatService).to receive(:new).with(assistant: assistant, conversation_id: conversation.id)
expect(Captain::Llm::AssistantChatService).to receive(:new).with(assistant: assistant, conversation_id: conversation.display_id)
expect(Captain::Assistant::AgentRunnerService).not_to receive(:new)
described_class.perform_now(conversation, assistant)