feat(prompts): add optional instruction variable to semantic summary templates#1840
feat(prompts): add optional instruction variable to semantic summary templates#1840yeyitech wants to merge 5 commits intovolcengine:mainfrom
Conversation
…teError (volcengine#1758) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…volcengine#1737) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h embedded credentials (volcengine#1734) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mary customization (volcengine#578) Thread a new `summary_instruction` parameter from the CLI option `--summary-instruction` through the full pipeline: CLI command → BaseClient/HTTPClient/LocalClient → HTTP router → ResourceService → ResourceProcessor → TreeBuilder → SemanticMsg.instruction, so SemanticProcessor can use it when generating per-file abstracts and directory overviews via VLM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…templates (volcengine#578) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Summary
instructionvariable tosemantic.code_summary,semantic.document_summary,semantic.file_summary, andsemantic.overview_generationprompt templatesinstructionis non-empty, it is injected into the prompt before the output requirements section, allowing domain-specific guidance (e.g. "Focus on API endpoints and return types" for SDK docs)instructionfield throughSemanticMsg→SemanticProcessor._process_single_directory→_generate_file_summaries→_generate_single_file_summaryand_generate_overviewinstructionthroughSemanticDagExecutor(the recursive DAG path) so both recursive and non-recursive processing honour the custom instructioninstructiondefaults to""and the conditional block is a no-op when emptyCloses #578
Test plan
render_prompt("semantic.code_summary", {"file_name": "api.py", "content": "...", "instruction": ""})— instruction block absent from outputrender_prompt("semantic.code_summary", {"file_name": "api.py", "content": "...", "instruction": "Focus on public API surface"})— instruction block presentSemanticMsg("viking://x", "resource", instruction="test").instruction == "test"passes🤖 Generated with Claude Code