feat: add review_code tool handler

This commit is contained in:
2026-06-12 09:20:09 +01:00
parent 4c3776e2ce
commit 8e95ea0e5f
5 changed files with 506 additions and 9 deletions
+15
View File
@@ -342,6 +342,21 @@ Create `src/tools/review-code.js` and `test/tools/review-code.test.js`.
- OpenAI errors pass through `String(err)` unchanged (no wrapping/reformatting).
- Mirror 4.1 and 4.2 structure: ~28 orchestration-only tests covering the same test categories.
Status: ✅ Complete
### Task 4.4 - debug_issue tool handler (NEXT)
Create `src/tools/debug-issue.js` and `test/tools/debug-issue.test.js`.
**Requirements:**
- Export `handleDebugIssue(input, deps)` as standalone dependency-injected function.
- Execution order: validateToolInput → loadConfig → checkContextBudget → buildDebugIssuePrompt → createOpenAIClient → sendOpenAIResponse.
- Inject only 3 external deps: `loadConfig`, `createOpenAIClient`, `sendOpenAIResponse`. Internal utilities imported directly.
- If budget check fails (`ok: false`), immediately return that result — do not call buildDebugIssuePrompt or create client.
- All paths return structured `{ ok, answer|error, warnings }` — never throws to caller.
- OpenAI errors pass through `String(err)` unchanged (no wrapping/reformatting).
- Mirror 4.1/4.2/4.3 structure: ~28 orchestration-only tests covering the same test categories.
Status: ⬜ Pending
---