Skip to content

fix(ai): address PR review comments and add unit tests

6c2a9c1
Select commit
Loading
Failed to load commit list.
Open

feat(ai): upgrade to OpenAI Responses API and enhance template generation #183

fix(ai): address PR review comments and add unit tests
6c2a9c1
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Correctness Check completed Mar 20, 2026 in 6m 2s

1 issue identified (86 code objects reviewed).

• Merge Base: 9175c72
• Head: 6c2a9c1

Details

File Path Comments Posted
.gitignore
backend/docker-compose.yml
docker-compose.src.yml 0
frontend/docker-compose.yml 0
backend/src/ai/migrations/0004_add_model_choices_and_template_target.py
backend/src/processes/tests/test_services/test_templates/test_ai/test_base_ai_service.py 0
backend/src/processes/tests/test_services/test_templates/test_ai/test_anon_open_ai_service.py 0
backend/src/processes/services/templates/ai.py 1
backend/src/processes/tests/test_services/test_templates/test_ai/test_open_ai_service.py 0

Filtered Issues Details

backend/src/processes/services/templates/ai.py
  • line 260: The model name 'gpt-4.1-mini' on line 260 appears to be a typo. OpenAI does not have a model called gpt-4.1-mini. The intended model was likely 'gpt-4o-mini' or similar. When prompt is None, API calls will fail with an invalid model error. [ Out of scope (triage) ]
backend/src/processes/tests/test_services/test_templates/test_ai/test_anon_open_ai_service.py
  • line 638: The test will fail because the mock JSON response doesn't include api_name in the tasks, but the production code get_short_template_data does task['api_name'] directly (not .get()), which will raise KeyError. The test expects task_1['api_name'] to be truthy (line 687), but the service will raise an exception before returning any data. [ Cross-file consolidated ]