feat: add review_plan tool handler
This commit is contained in:
+17
-2
@@ -7,7 +7,7 @@ ChatGPT MCP Server
|
||||
## Status
|
||||
|
||||
Planning complete.
|
||||
Phase 0 complete. Phase 1 complete. Phase 2 complete. Phase 3 complete. Task 4.1 complete.
|
||||
Phase 0 complete. Phase 1 complete. Phase 2 complete. Phase 3 complete. Task 4.1 complete. Task 4.2 complete.
|
||||
|
||||
## Current Phase
|
||||
|
||||
@@ -69,6 +69,21 @@ Implemented `src/tools/ask-chatgpt.js` with dependency-injected handler and 27 o
|
||||
- Every path returns structured `{ ok, answer|error, warnings }` — never throws to caller
|
||||
- 27 tests covering: success path, validation failure, config failure, budget failure, client creation failure, OpenAI failure, dependency call order, error handling for null/string throws, warning propagation, result shape, and short-circuit behavior
|
||||
|
||||
### Task 4.2 — review_plan MCP Tool Handler ✅
|
||||
|
||||
Implemented `src/tools/review-plan.js` with dependency-injected handler and 28 orchestration-only tests in `test/tools/review-plan.test.js`.
|
||||
|
||||
**Key design decisions:**
|
||||
- Execution order: validate → loadConfig → checkContextBudget → buildReviewPlanPrompt → createOpenAIClient → sendOpenAIResponse
|
||||
- All external deps injected (loadConfig, createOpenAIClient, sendOpenAIResponse); internal utilities imported directly
|
||||
- OpenAI errors pass through `String(err)` unchanged — no wrapping or reformatting
|
||||
- Budget check short-circuits before prompt building or client creation
|
||||
- Every path returns structured `{ ok, answer|error, warnings }` — never throws to caller
|
||||
- 28 tests mirroring 4.1 structure with one additional test verifying buildReviewPlanPrompt is called with budget.input
|
||||
|
||||
**Next pending task:**
|
||||
- Task 4.3 — review_code tool handler (`src/tools/review-code.js`, `test/tools/review-code.test.js`)
|
||||
|
||||
**Not done yet (Phase 4):**
|
||||
- No MCP tool registration
|
||||
- Other tool handlers (review_plan, review_code, debug_issue, architecture_review)
|
||||
- Other tool handlers (review_code, debug_issue, architecture_review)
|
||||
|
||||
Reference in New Issue
Block a user