Skip to content

Commit fa91915

Browse files
committed
fix: clarify semantic question prompts to output only structured JSON
Changed final answer instructions from 'When you have enough evidence (STRUCTURED OUTPUT):' to 'When you have enough evidence, respond with ONLY this JSON (no reasoning, tool_call, or is_final fields):' Prevents LLM from outputting both wrapper format and structured format. Applied consistently across all 4 tiers (TERSE, BALANCED, DETAILED, EXPLORATORY). Expected output: {"analysis": "...", "evidence": [...], "related_components": [...], "confidence": 0.95} Not: {"reasoning": "...", "is_final": true} {"analysis": "...", ...}
1 parent 048b91d commit fa91915

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/codegraph-mcp/src/semantic_question_prompts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RESPONSE FORMAT (JSON):
3333
"is_final": false
3434
}
3535
36-
When you have enough evidence to answer (STRUCTURED OUTPUT):
36+
When you have enough evidence to answer, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
3737
{
3838
"analysis": "Direct answer to the question based on graph evidence gathered. Cite specific node IDs and relationships found.",
3939
"evidence": [
@@ -118,7 +118,7 @@ RESPONSE FORMAT (JSON):
118118
"is_final": false
119119
}
120120
121-
Final answer format (STRUCTURED OUTPUT):
121+
When you have enough evidence to answer, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
122122
{
123123
"analysis": "Comprehensive answer based on graph evidence. Structure: 1) Direct answer 2) Supporting evidence from tools 3) Specific node IDs and relationships found 4) Confidence level and any limitations",
124124
"evidence": [
@@ -239,7 +239,7 @@ RESPONSE FORMAT (JSON):
239239
"is_final": false
240240
}
241241
242-
Final answer format (STRUCTURED OUTPUT):
242+
When you have enough evidence to answer, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
243243
{
244244
"analysis": "COMPREHENSIVE ANSWER with structure:
245245
@@ -437,7 +437,7 @@ RESPONSE FORMAT (JSON):
437437
"is_final": false
438438
}
439439
440-
Final answer format (STRUCTURED OUTPUT):
440+
When you have enough evidence to answer, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
441441
{
442442
"analysis": "EXHAUSTIVE MULTI-DIMENSIONAL ANSWER:
443443

0 commit comments

Comments
 (0)