Batch: Fix initial bugs found during review #1

Merged
SaschaFuksa merged 1 commit from batch/fix-initial-bugs into master 2026-04-27 13:18:30 +00:00
Owner

Fixes

Fixes all bugs found during code review:

  1. Import errors: LLMSettings, ScraperSettings, SearchSourceConfig imported from correct module
  2. AsyncSession type mismatch: Repositories now use correct sqlmodel.ext.asyncio.AsyncSession
  3. desc() on column: Changed to SQLAlchemy desc() function
  4. Missing wait_for_timeout: Replaced with direct asyncio.sleep()
  5. Dead code removal: Removed add_routes(), add_cors_middleware import, unused repo variable
  6. Cleanup: Unused imports, Optional| None style, trailing newlines

Files changed

  • src/agent/llm_client.py
  • src/agent/orchestrator.py
  • src/agent/parser.py
  • src/agent/scraper.py
  • src/api/routes.py
  • src/api/schemas.py
  • src/core/exceptions.py
  • src/core/models.py
  • src/core/settings.py
  • src/db/connection.py
  • src/db/repository.py
  • src/main.py
## Fixes Fixes all bugs found during code review: 1. **Import errors**: `LLMSettings`, `ScraperSettings`, `SearchSourceConfig` imported from correct module 2. **AsyncSession type mismatch**: Repositories now use correct `sqlmodel.ext.asyncio.AsyncSession` 3. **desc() on column**: Changed to SQLAlchemy `desc()` function 4. **Missing wait_for_timeout**: Replaced with direct `asyncio.sleep()` 5. **Dead code removal**: Removed `add_routes()`, `add_cors_middleware` import, unused `repo` variable 6. **Cleanup**: Unused imports, `Optional` → `| None` style, trailing newlines ## Files changed - src/agent/llm_client.py - src/agent/orchestrator.py - src/agent/parser.py - src/agent/scraper.py - src/api/routes.py - src/api/schemas.py - src/core/exceptions.py - src/core/models.py - src/core/settings.py - src/db/connection.py - src/db/repository.py - src/main.py
Fix initial bugs found during review
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
ee6bea0a0f
Import and type fixes:
- Fix LLMSettings/ScraperSettings/SearchSourceConfig imports (were in wrong module)
- Fix 'AsyncSession' undefined in repository (use sqlmodel AsyncSession)
- Fix desc() usage in repository (use function from sqlalchemy not column method)
- Fix orchestrator calling non-existent wait_for_timeout method
- Remove unused add_routes() function from routes.py
- Remove non-existent add_cors_middleware import
- Fix 'repo' variable assigned but never used in trigger_scan
- Remove unused imports across multiple files

Ruff auto-fixes applied for:
- Optional -> | None style
- Unused imports cleanup
- Line-length fixes
- Trailing newlines

Remaining (intentional):
- DTZ003 datetime.utcnow() deprecation - existing code pattern
- B008 Depends() in defaults - FastAPI standard pattern
- E501 line lengths in parser.py (fallback template string)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Tasch/try-it-for-free!1
No description provided.