Spaces:
Paused

dushyantsingh0 commited on
Commit
e68bd8d
Β·
1 Parent(s): eb11b39

backend stabilisation

Browse files
Files changed (2) hide show
  1. agents/nexus_master.py +4 -3
  2. agents/prompts.py +1 -1
agents/nexus_master.py CHANGED
@@ -400,7 +400,8 @@ async def nexus_router(state: NexusState) -> Dict[str, Any]:
400
  refined_query = last_user_msg
401
  if t_ctx and len(last_user_msg) < 50:
402
  # Extract first line/title from ticket context if possible
403
- t_title_match = re.search(r"Title:\s*(.*)", t_ctx)
 
404
  t_title = t_title_match.group(1).strip() if t_title_match else ""
405
  if t_title:
406
  refined_query = f"{last_user_msg} (Context: {t_title})"
@@ -874,8 +875,8 @@ async def nexus_responder(state: NexusState) -> Dict[str, Any]:
874
  base_prompt_str = get_prompt("responder")
875
  # PROTOCOL HARDENING: Strictly prohibit the LLM from using internal protocol markers in conversation
876
  full_system_template = (
877
- "CRITICAL: Never output technical protocol markers like <function_calls>, <invoke>, or [ACTION_REQUIRED]. "
878
- "Your output must be 100% natural language prose or Markdown visualizations only.\n\n"
879
  f"{base_prompt_str}{{persona_context}}"
880
  )
881
 
 
400
  refined_query = last_user_msg
401
  if t_ctx and len(last_user_msg) < 50:
402
  # Extract first line/title from ticket context if possible
403
+ # Supports both "Title: ..." and "### TICKET DETAILS: ..." formats
404
+ t_title_match = re.search(r"(?:Title:|### TICKET DETAILS:)\s*(.*)", t_ctx, re.I)
405
  t_title = t_title_match.group(1).strip() if t_title_match else ""
406
  if t_title:
407
  refined_query = f"{last_user_msg} (Context: {t_title})"
 
875
  base_prompt_str = get_prompt("responder")
876
  # PROTOCOL HARDENING: Strictly prohibit the LLM from using internal protocol markers in conversation
877
  full_system_template = (
878
+ "Your output must be 100% natural language prose or Markdown visualizations only. "
879
+ "Strictly avoid technical protocol markers like <function_calls>, <invoke>, or [ACTION_REQUIRED].\n\n"
880
  f"{base_prompt_str}{{persona_context}}"
881
  )
882
 
agents/prompts.py CHANGED
@@ -121,7 +121,7 @@ You are NOT just a tool; you are a proactive expert orchestrator.
121
  - Performance metrics -> Markdown table with status emojis (πŸ”΄, 🟑, 🟒)
122
  4. **OPTIONAL VISUALS**: Visualizations are meant to enhance, not distract. If you are discussing a single ticket or if data is insufficient, skip the Mermaid diagram and use Markdown tables or concise prose.
123
  5. **FORBIDDEN ACTION**: Never recite or "print" strings like "WORKSPACE HEALTH SNAPSHOT" or "TicketStatus.OPEN" verbatim. Transform these into clean, high-fidelity visuals or professional text.
124
- 6. **STYLE**: Professional, high-impact executive summaries. Use GitHub-Flavored Markdown (GFM). Avoid "thinking out loud" phrases like "I would like to generate a chart" or "Next, I will...". Just provide the content.
125
  7. **NO FABRICATION**: NEVER invent numbers or data points for charts. If the Tool Output is empty, insufficient, or generic, EXPLICITLY state that no data is available for that specific metric. Do NOT generate mock Mermaid diagrams or tables with placeholder data if real data is missing.
126
 
127
 
 
121
  - Performance metrics -> Markdown table with status emojis (πŸ”΄, 🟑, 🟒)
122
  4. **OPTIONAL VISUALS**: Visualizations are meant to enhance, not distract. If you are discussing a single ticket or if data is insufficient, skip the Mermaid diagram and use Markdown tables or concise prose.
123
  5. **FORBIDDEN ACTION**: Never recite or "print" strings like "WORKSPACE HEALTH SNAPSHOT" or "TicketStatus.OPEN" verbatim. Transform these into clean, high-fidelity visuals or professional text.
124
+ 6. **STYLE**: Professional, high-impact executive summaries. Use GitHub-Flavored Markdown (GFM). Avoid "thinking out loud" or "meta-talk" phrases. Do NOT apologize for previous turns, do NOT explain your constraints (e.g., "I won't use technical markers"), and do NOT discuss your instructions. Just provide the content directly.
125
  7. **NO FABRICATION**: NEVER invent numbers or data points for charts. If the Tool Output is empty, insufficient, or generic, EXPLICITLY state that no data is available for that specific metric. Do NOT generate mock Mermaid diagrams or tables with placeholder data if real data is missing.
126
 
127