feat(llm): configure GPT-5.6 reasoning defaults
This commit is contained in:
@@ -44,10 +44,12 @@ RSpec.describe 'Api::V1::Accounts::Captain::Preferences', type: :request do
|
||||
expect(json_response).to have_key(:providers)
|
||||
expect(json_response).to have_key(:models)
|
||||
expect(json_response).to have_key(:features)
|
||||
expect(json_response[:models].keys).to include(:'gpt-5.6-luna', :'gpt-5.6-terra', :'gpt-5.6-sol')
|
||||
expect(json_response.dig(:features, :assistant, :models).pluck(:id)).to include('gpt-5.6-luna', 'gpt-5.6-terra', 'gpt-5.6-sol')
|
||||
end
|
||||
|
||||
it 'returns effective model provider and source for each feature' do
|
||||
account.update!(captain_models: { 'editor' => 'gpt-4.1' })
|
||||
account.update!(captain_models: { 'editor' => 'gpt-5.6-terra' })
|
||||
|
||||
get "/api/v1/accounts/#{account.id}/captain/preferences",
|
||||
headers: admin.create_new_auth_token,
|
||||
@@ -55,15 +57,17 @@ RSpec.describe 'Api::V1::Accounts::Captain::Preferences', type: :request do
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
expect(json_response.dig(:features, :editor)).to include(
|
||||
model: 'gpt-4.1',
|
||||
selected: 'gpt-4.1',
|
||||
model: 'gpt-5.6-terra',
|
||||
selected: 'gpt-5.6-terra',
|
||||
provider: 'openai',
|
||||
reasoning_effort: 'low',
|
||||
source: 'account_override'
|
||||
)
|
||||
expect(json_response.dig(:features, :label_suggestion)).to include(
|
||||
model: Llm::Models.default_model_for('label_suggestion'),
|
||||
selected: Llm::Models.default_model_for('label_suggestion'),
|
||||
provider: 'openai',
|
||||
reasoning_effort: 'low',
|
||||
source: 'default'
|
||||
)
|
||||
end
|
||||
@@ -81,7 +85,7 @@ RSpec.describe 'Api::V1::Accounts::Captain::Preferences', type: :request do
|
||||
)
|
||||
end
|
||||
|
||||
it 'returns GPT-5.2 as the assistant default for V2 accounts' do
|
||||
it 'returns the Captain V2 assistant default for V2 accounts' do
|
||||
account.enable_features!('captain_integration_v2')
|
||||
|
||||
get "/api/v1/accounts/#{account.id}/captain/preferences",
|
||||
|
||||
@@ -258,7 +258,7 @@ RSpec.describe Account, type: :model do
|
||||
|
||||
expect(account).to be_feature_enabled('captain_integration')
|
||||
expect(account).to be_feature_enabled('captain_integration_v2')
|
||||
expect(account.captain_preferences[:models]['assistant']).to eq('gpt-5.2')
|
||||
expect(account.captain_preferences[:models]['assistant']).to eq(Llm::FeatureRouter::CAPTAIN_V2_ASSISTANT_MODEL)
|
||||
expect(account.captain_models).to be_nil
|
||||
end
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ RSpec.describe Concerns::Agentable do
|
||||
create(:installation_config, name: 'CAPTAIN_OPEN_AI_MODEL', value: 'gpt-4.1-nano')
|
||||
account.enable_features!('captain_integration_v2')
|
||||
|
||||
expect(dummy_instance.send(:agent_model)).to eq('gpt-5.2')
|
||||
expect(dummy_instance.send(:agent_model)).to eq(Llm::FeatureRouter::CAPTAIN_V2_ASSISTANT_MODEL)
|
||||
expect(account.reload.captain_models).to be_nil
|
||||
end
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ RSpec.describe Llm::BaseAiService do
|
||||
create(:installation_config, name: 'CAPTAIN_OPEN_AI_MODEL', value: 'gpt-4.1-nano')
|
||||
account.enable_features!('captain_integration_v2')
|
||||
|
||||
expect(described_class.new(feature: 'assistant', account: account).model).to eq('gpt-5.2')
|
||||
expect(described_class.new(feature: 'assistant', account: account).model).to eq(Llm::FeatureRouter::CAPTAIN_V2_ASSISTANT_MODEL)
|
||||
expect(account.reload.captain_models).to be_nil
|
||||
end
|
||||
|
||||
|
||||
@@ -12,25 +12,27 @@ RSpec.describe Llm::FeatureRouter do
|
||||
expect(resolved).to eq(
|
||||
feature: 'editor',
|
||||
provider: 'openai',
|
||||
model: 'gpt-4.1-mini',
|
||||
model: 'gpt-5.6-luna',
|
||||
reasoning_effort: 'low',
|
||||
source: :default
|
||||
)
|
||||
end
|
||||
|
||||
it 'uses a valid account model override' do
|
||||
account.update!(captain_models: { 'editor' => 'gpt-4.1' })
|
||||
account.update!(captain_models: { 'editor' => 'gpt-5.6-terra' })
|
||||
|
||||
resolved = described_class.resolve(feature: 'editor', account: account)
|
||||
|
||||
expect(resolved).to include(
|
||||
feature: 'editor',
|
||||
provider: 'openai',
|
||||
model: 'gpt-4.1',
|
||||
model: 'gpt-5.6-terra',
|
||||
reasoning_effort: 'low',
|
||||
source: :account_override
|
||||
)
|
||||
end
|
||||
|
||||
it 'resolves GPT-5.2 as the assistant default when Captain V2 is enabled without storing an account override' do
|
||||
it 'resolves the Captain V2 assistant default without storing an account override' do
|
||||
account.enable_features!('captain_integration_v2')
|
||||
|
||||
resolved = described_class.resolve(feature: 'assistant', account: account)
|
||||
@@ -38,7 +40,8 @@ RSpec.describe Llm::FeatureRouter do
|
||||
expect(resolved).to include(
|
||||
feature: 'assistant',
|
||||
provider: 'openai',
|
||||
model: 'gpt-5.2',
|
||||
model: described_class::CAPTAIN_V2_ASSISTANT_MODEL,
|
||||
reasoning_effort: 'medium',
|
||||
source: :default
|
||||
)
|
||||
expect(account.reload.captain_models).to be_nil
|
||||
@@ -62,7 +65,8 @@ RSpec.describe Llm::FeatureRouter do
|
||||
resolved = described_class.resolve(feature: 'editor', account: account)
|
||||
|
||||
expect(resolved).to include(
|
||||
model: 'gpt-4.1-mini',
|
||||
model: 'gpt-5.6-luna',
|
||||
reasoning_effort: 'low',
|
||||
source: :default
|
||||
)
|
||||
end
|
||||
@@ -73,7 +77,8 @@ RSpec.describe Llm::FeatureRouter do
|
||||
resolved = described_class.resolve(feature: 'editor', account: account)
|
||||
|
||||
expect(resolved).to include(
|
||||
model: 'gpt-4.1-mini',
|
||||
model: 'gpt-5.6-luna',
|
||||
reasoning_effort: 'low',
|
||||
source: :default
|
||||
)
|
||||
end
|
||||
|
||||
@@ -27,12 +27,33 @@ RSpec.describe Llm::Models do
|
||||
end
|
||||
|
||||
it 'routes document and conversation FAQ generation independently' do
|
||||
expect(described_class.default_model_for('document_faq_generation')).to eq('gpt-4.1-mini')
|
||||
expect(described_class.default_model_for('conversation_faq_generation')).to eq('gpt-5.2')
|
||||
expect(described_class.default_model_for('document_faq_generation')).to eq('gpt-5.6-terra')
|
||||
expect(described_class.default_model_for('conversation_faq_generation')).to eq('gpt-5.6-terra')
|
||||
end
|
||||
|
||||
it 'sets reasoning effort for every text generation feature' do
|
||||
features_without_reasoning = %w[audio_transcription help_center_search]
|
||||
|
||||
described_class.features.each_key do |feature_key|
|
||||
if features_without_reasoning.include?(feature_key)
|
||||
expect(described_class.reasoning_effort_for(feature_key)).to be_nil
|
||||
else
|
||||
expect(described_class.reasoning_effort_for(feature_key)).to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'exposes GPT-5.6 models for Captain V2 workflows without changing the legacy PDF path' do
|
||||
expect(described_class.models_for('assistant')).to include('gpt-5.6-luna', 'gpt-5.6-terra', 'gpt-5.6-sol')
|
||||
expect(described_class.models_for('pdf_faq_generation')).not_to include('gpt-5.6-luna', 'gpt-5.6-terra', 'gpt-5.6-sol')
|
||||
end
|
||||
end
|
||||
|
||||
describe '.models' do
|
||||
it 'includes the GPT-5.6 model family' do
|
||||
expect(described_class.models.keys).to include('gpt-5.6-luna', 'gpt-5.6-terra', 'gpt-5.6-sol')
|
||||
end
|
||||
|
||||
it 'references existing providers from every model' do
|
||||
missing_providers = described_class.models.filter_map do |model_name, config|
|
||||
provider = config['provider']
|
||||
@@ -49,7 +70,9 @@ RSpec.describe Llm::Models do
|
||||
it 'returns model metadata for a feature' do
|
||||
config = described_class.feature_config('editor')
|
||||
|
||||
expect(config[:default]).to eq('gpt-4.1-mini')
|
||||
expect(config[:default]).to eq('gpt-5.6-luna')
|
||||
expect(config[:reasoning_effort]).to eq('low')
|
||||
expect(config[:models].pluck(:id)).to include('gpt-5.6-luna', 'gpt-5.6-terra')
|
||||
expect(config[:models].first).to include(
|
||||
id: 'gpt-4.1-mini',
|
||||
display_name: 'GPT-4.1 Mini',
|
||||
|
||||
@@ -393,10 +393,10 @@ RSpec.describe Account do
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns GPT-5.2 for assistant when Captain V2 is enabled' do
|
||||
it 'returns the Captain V2 default for assistant when Captain V2 is enabled' do
|
||||
account.enable_features!('captain_integration_v2')
|
||||
|
||||
expect(account.captain_preferences[:models]['assistant']).to eq('gpt-5.2')
|
||||
expect(account.captain_preferences[:models]['assistant']).to eq(Llm::FeatureRouter::CAPTAIN_V2_ASSISTANT_MODEL)
|
||||
expect(account.reload.captain_models).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user