Skip to content

Fix backend logic bugs: 13 findings#15

Merged
JMRussas merged 2 commits intomainfrom
fix/backend-logic-bugs
Mar 5, 2026
Merged

Fix backend logic bugs: 13 findings#15
JMRussas merged 2 commits intomainfrom
fix/backend-logic-bugs

Conversation

@JMRussas
Copy link
Owner

@JMRussas JMRussas commented Mar 4, 2026

Summary

  • 13 findings from the codebase evaluation, covering 3 HIGH and 10 MEDIUM/LOW severity issues
  • Extract shared JSON utilities (_extract_json_object, _strip_trailing_commas) to backend/utils/json_utils.py for reuse across planner, verifier, and knowledge extractor
  • Fix quadratic token growth in Claude agent by pruning conversation history to last N rounds (configurable max_history_rounds)
  • Fix context forwarding race condition by wrapping per-dependent read-modify-write in DB transaction
  • Fix budget leak on plan parse failure — API spend is now recorded even when JSON parsing fails
  • Fix verification feedback cap: proper sliding window instead of remove-all-then-append
  • Include RUNNING tasks in cancel_project so in-flight work gets cancelled
  • Add retry limit check to review_task retry action (was uncapped)
  • Switch to paragraph-based requirement numbering for multi-line requirements
  • Skip budget check for Ollama-only projects (free tasks shouldn't pause on budget exhaustion)
  • Add API timeout to verifier and knowledge extractor calls (were missing)
  • Skip verification/extraction when budget is exhausted (log warning, don't block)
  • Truncate long output before sending to verifier (cap at 8000 chars)
  • Add _reset_warned_models() with autouse test fixture to prevent state leak
  • Make HTTP client timeout configurable (execution.http_client_timeout)

Test plan

  • 22 new tests in tests/unit/test_backend_logic.py covering all findings
  • Updated 2 existing test files for paragraph-based requirements format
  • Full suite: 701 passed, 0 failed
  • Lint: all checks passed

Generated by Claude Code · Claude Opus 4.6

JMRussas and others added 2 commits March 4, 2026 03:31
…nd more

- Extract shared JSON utilities to backend/utils/json_utils.py (#37)
- Fix quadratic token growth in Claude agent via message pruning (#8)
- Fix context forwarding race with per-dep transaction (#9)
- Fix budget leak on plan parse failure by recording spend before re-raise (#11)
- Fix verification feedback cap with proper sliding window (#17)
- Include RUNNING tasks in cancel_project (#18)
- Add retry limit check to review_task retry action (#19)
- Switch to paragraph-based requirement numbering (#21)
- Skip budget check for Ollama-only projects (#23)
- Make HTTP client timeout configurable (#35)
- Add timeout + budget skip to verifier and knowledge extractor (#36)
- Truncate long output before sending to verifier (#38)
- Add _reset_warned_models() with autouse fixture (#44)
- 22 new tests covering all findings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JMRussas JMRussas merged commit ae71df7 into main Mar 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant