diff --git a/lib/captain/summary_service.rb b/lib/captain/summary_service.rb index eb5309cb6..0c043f825 100644 --- a/lib/captain/summary_service.rb +++ b/lib/captain/summary_service.rb @@ -71,7 +71,7 @@ class Captain::SummaryService < Captain::BaseTaskService def account_context_fields [ ("Account industry: #{account.custom_attributes['industry']}" if account.custom_attributes&.dig('industry').present?), - ("Account language: #{account.locale}" if account.locale.present?) + ("Summary language: #{account.locale}" if account.locale.present?) ] end diff --git a/lib/integrations/openai/openai_prompts/summary.liquid b/lib/integrations/openai/openai_prompts/summary.liquid index 9b8778070..7cb361d02 100644 --- a/lib/integrations/openai/openai_prompts/summary.liquid +++ b/lib/integrations/openai/openai_prompts/summary.liquid @@ -23,7 +23,8 @@ Do not prefix bullets with labels like "Next step:" or "Issue:" — ordering alone conveys structure. - If an agent locale is provided in the context, write the summary in that language. + ALWAYS write the summary in the language specified by "Summary language" in the conversation context. This overrides the conversation language. + If no summary language is provided, match the primary language used in the conversation. true @@ -90,7 +91,7 @@ No bullet contains inferred/derived info. No two bullets repeat the same meaning. Last bullet is an actionable next step. - Summary language matches agent locale (if provided) or conversation language. + Summary language matches "Summary language" from context (if provided), otherwise matches conversation language. Bullet count respects the scaling rules for the message count. true