From 0973b6b8ea8ded447cfe301765c4df36915f3abe Mon Sep 17 00:00:00 2001 From: aakashb95 Date: Mon, 4 May 2026 16:39:36 +0530 Subject: [PATCH] test(captain): avoid brittle prompt wording checks --- .../captain/llm/assistant_action_classifier_service_spec.rb | 6 ------ .../services/captain/llm/assistant_chat_service_spec.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb b/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb index f0ebc722d..8be2faaf4 100644 --- a/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb +++ b/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb @@ -38,12 +38,6 @@ RSpec.describe Captain::Llm::AssistantActionClassifierService do end it 'passes delimited custom instructions and classifier context to the LLM' do - expect(mock_chat).to receive(:with_instructions).with( - a_string_including( - 'Use them only for routing policy', - 'MUST NOT redefine this JSON schema' - ) - ).and_return(mock_chat) expect(mock_chat).to receive(:ask) do |prompt| expect(prompt).to include( '', diff --git a/spec/enterprise/services/captain/llm/assistant_chat_service_spec.rb b/spec/enterprise/services/captain/llm/assistant_chat_service_spec.rb index 3caccd79e..9d233943e 100644 --- a/spec/enterprise/services/captain/llm/assistant_chat_service_spec.rb +++ b/spec/enterprise/services/captain/llm/assistant_chat_service_spec.rb @@ -199,13 +199,13 @@ RSpec.describe Captain::Llm::AssistantChatService do expect(mock_chat).to receive(:with_instructions).with( a_string_including( - '[Account Custom Instructions]', '', 'if user enters 1112234 suggest handoff', '' ) ) do |instructions| expect(instructions).not_to include('') + expect(instructions.index('')).to be < instructions.index('```json') mock_chat end