Skip to content

Commit 88df285

Browse files
author
Jacob Mages-Haskins
committed
AIML-244 Update agent model defaults and config logging if using Contrast LLM
1 parent e2ec6ce commit 88df285

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self, env: Dict[str, str] = os.environ, testing: bool = False):
7070

7171
default_agent_model = ""
7272
if is_smartfix_coding_agent:
73-
default_agent_model = "bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0"
73+
default_agent_model = "bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0"
7474
self.AGENT_MODEL = self._get_env_var("AGENT_MODEL", required=False, default=default_agent_model)
7575

7676
# --- Build and Formatting Configuration ---
@@ -120,6 +120,12 @@ def __init__(self, env: Dict[str, str] = os.environ, testing: bool = False):
120120
self.ENABLE_FULL_TELEMETRY = self._get_bool_env("ENABLE_FULL_TELEMETRY", default=True)
121121
self.USE_CONTRAST_LLM = self._get_bool_env("USE_CONTRAST_LLM", default=True)
122122

123+
# Update agent model for Contrast LLM if no explicit model was set
124+
if (is_smartfix_coding_agent
125+
and self.USE_CONTRAST_LLM
126+
and self._get_env_var("AGENT_MODEL", required=False) is None):
127+
self.AGENT_MODEL = "contrast/claude-sonnet-4-5"
128+
123129
# --- Vulnerability Configuration ---
124130
self.VULNERABILITY_SEVERITIES = self._parse_and_validate_severities(
125131
self._get_env_var("VULNERABILITY_SEVERITIES", required=False, default='["CRITICAL", "HIGH"]')
@@ -213,7 +219,8 @@ def _log_initial_settings(self):
213219
_log_config_message(f"Debug Mode: {self.DEBUG_MODE}")
214220
_log_config_message(f"Base Branch: {self.BASE_BRANCH}")
215221
_log_config_message(f"Run Task: {self.RUN_TASK}")
216-
_log_config_message(f"Agent Model: {self.AGENT_MODEL}")
222+
if not self.USE_CONTRAST_LLM:
223+
_log_config_message(f"Agent Model: {self.AGENT_MODEL}")
217224
_log_config_message(f"Coding Agent: {self.CODING_AGENT}")
218225
_log_config_message(f"Skip Writing Security Test: {self.SKIP_WRITING_SECURITY_TEST}")
219226
_log_config_message(f"Skip QA Review: {self.SKIP_QA_REVIEW}")

test/test_config_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def test_coding_agent_smartfix_with_contrast_llm(self):
7474
# Should have SMARTFIX agent with Contrast LLM enabled
7575
self.assertEqual(config.CODING_AGENT, 'SMARTFIX')
7676
self.assertTrue(config.USE_CONTRAST_LLM)
77-
# Default agent model should still be set for fallback
78-
self.assertEqual(config.AGENT_MODEL, 'bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0')
77+
# Default agent model should use Contrast LLM constant
78+
self.assertEqual(config.AGENT_MODEL, 'contrast/claude-sonnet-4-5')
7979

8080
def test_coding_agent_smartfix_with_byollm(self):
8181
"""Test that SMARTFIX coding agent works with USE_CONTRAST_LLM=False (BYOLLM)."""

0 commit comments

Comments
 (0)