feat(mcp): emit council preset and consensus data from parse_mode (#1300)#1307
Merged
Conversation
) Integrate CouncilPresetService into ModeHandler so PLAN/EVAL mode responses include deterministic council participant data. Add councilPreset and councilSummary optional fields to ParseModeResult for backward-compatible API extension. - Extend ParseModeResult with councilPreset (CouncilPreset) and councilSummary (CouncilSummary) optional fields - Inject CouncilPresetService into ModeHandler and resolve preset for PLAN/EVAL modes (null → undefined for ACT/AUTO) - Add 6 handler-level tests covering PLAN, EVAL, ACT, AUTO modes and serialization round-trip - Update all ModeHandler constructor call sites in test files Closes #1300
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…-preset.service Extract CouncilPreset interface and CouncilMode type to a dedicated council-preset.types.ts file that has no imports from keyword module. Both keyword.types.ts and council-preset.service.ts now import from the shared types file, eliminating the cycle. - keyword.types.ts → council-preset.types.ts (no cycle) - council-preset.service.ts → council-preset.types.ts (no cycle) - council-preset.service.ts re-exports CouncilPreset for API compat
JeremyDev87
commented
Apr 4, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
Review: ✅ APPROVE
CI Status: ALL PASS (26/26 including circular-check)
Code Quality:
- Circular dep fix: Extracted
CouncilPreset/CouncilModetocouncil-preset.types.ts— clean break - ParseModeResult extended:
councilPreset?andcouncilSummary?with@apiPropertyJSDoc - ModeHandler:
CouncilPresetServiceinjected, emits preset for PLAN/EVAL only - Tests: 5 new tests — PLAN/EVAL have preset, ACT/AUTO don't, no summary without specialist results, JSON round-trip
- Backward compatible: All new fields optional
Checklist:
- CI ALL PASS (circular-check now passes)
- No unused imports
- No
anytypes - Proper DI injection pattern
- All 3 spec files updated (mode.handler, abstract-handler, mcp.service)
✅ Council preset integration complete — deterministic council participants emitted in parse_mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParseModeResultwith optionalcouncilPresetandcouncilSummaryfields for backward-compatible API additionCouncilPresetServiceintoModeHandlerto emit deterministic council participants in PLAN/EVAL mode responsesChanged Files
apps/mcp-server/src/keyword/keyword.types.ts— addcouncilPresetandcouncilSummaryfields toParseModeResultapps/mcp-server/src/mcp/handlers/mode.handler.ts— injectCouncilPresetService, resolve preset, include in responseapps/mcp-server/src/mcp/handlers/mode.handler.spec.ts— 6 new council integration testsapps/mcp-server/src/mcp/handlers/abstract-handler.integration.spec.ts— update constructor callapps/mcp-server/src/mcp/mcp.service.spec.ts— update constructor callTest plan
councilPresetwithmode: "PLAN",primary: "technical-planner", and 4 specialistscouncilPresetwithmode: "EVAL",primary: "code-reviewer", and 3 specialistscouncilPresetcouncilPresetcouncilSummaryis undefined when no specialist results existcouncilPresetis JSON-serializable (round-trip test)--noEmitCloses #1300