coach: accept rules_context in build_user_prompt (every Coach request failed)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Er49soaMyG7Yburq57PeB
This commit is contained in:
fez5587andClaude Sonnet 5.5 committed 2026-10-26 23:01:48 -05:00
1 parent a09eb5b21a
commit 7d92387bb8
1 file changed
+15
+15
View File
@@ -546,6 +546,21 @@ def build_quick_system_prompt(report: DeckReport,
def build_user_prompt(report: DeckReport,
candidates: Dict[str, List[dict]] = None,
rag_cards: List[dict] = None,
rules_context: List[dict] = None) -> str: # FARMHOUSE_RULES_CONTEXT
text = _farmhouse_build_user_prompt(report, candidates, rag_cards)
rules = []
for item in (rules_context or [])[:3]:
body = (item.get('text') or item.get('document') or item.get('content')) if isinstance(item, dict) else str(item)
if body:
rules.append('- ' + str(body).strip()[:700])
if rules:
text += '\n\n## Relevant rules (for grounding; do not quote them back)\n' + '\n'.join(rules)
return text
def _farmhouse_build_user_prompt(report: DeckReport,
candidates: Dict[str, List[dict]] = None,
rag_cards: List[dict] = None) -> str:
"""Build the user prompt with full deck report data.