Skip to content

Commit 0bab364

Browse files
fix: Update test badge and fix Agent Orchestration Wizard
- Update TestsBadge to show accurate count (2,211 tests passing) - Remove coverage percentage from badge - Fix Agent Orchestration Wizard to work with text input - Add _parse_agents_from_text() for demo mode 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ec63761 commit 0bab364

2 files changed

Lines changed: 68 additions & 8 deletions

File tree

empathy_software_plugin/wizards/agent_orchestration_wizard.py

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,86 @@ def __init__(self):
4040
)
4141

4242
def get_required_context(self) -> list[str]:
43-
"""Required context for analysis"""
43+
"""Required context for analysis (optional in demo mode)"""
4444
return [
4545
"agent_definitions", # Agent classes/configs
4646
"orchestration_code", # Code that coordinates agents
4747
"project_path", # Project root
4848
]
4949

50+
def _parse_agents_from_text(self, text: str) -> list[dict]:
51+
"""Parse agent definitions from natural language text input."""
52+
import re
53+
54+
agents = []
55+
56+
# Look for patterns like "5 agents", "agents: X, Y, Z", numbered lists
57+
# Pattern 1: "N agents" or "N specialized agents"
58+
count_match = re.search(r"(\d+)\s+(?:specialized\s+)?agents?", text.lower())
59+
if count_match:
60+
count = int(count_match.group(1))
61+
# Try to extract agent names from the text
62+
# Look for colon-separated list: "agents: ingestion, validation, ..."
63+
list_match = re.search(r":\s*([^.]+)", text)
64+
if list_match:
65+
names = [n.strip() for n in list_match.group(1).split(",")]
66+
for name in names[:count]:
67+
agents.append({"name": name, "type": "specialized"})
68+
else:
69+
# Generate generic agent names
70+
for i in range(count):
71+
agents.append({"name": f"Agent_{i+1}", "type": "specialized"})
72+
73+
# Pattern 2: Look for specific agent-like words
74+
agent_keywords = [
75+
"ingestion",
76+
"validation",
77+
"transformation",
78+
"analysis",
79+
"reporting",
80+
"extraction",
81+
"processing",
82+
"routing",
83+
"aggregation",
84+
"monitoring",
85+
"scheduler",
86+
"executor",
87+
"coordinator",
88+
"supervisor",
89+
"worker",
90+
]
91+
for kw in agent_keywords:
92+
if kw in text.lower() and not any(a["name"].lower() == kw for a in agents):
93+
agents.append({"name": kw.title(), "type": "specialized"})
94+
95+
# Ensure at least 1 agent for demo
96+
if not agents:
97+
agents = [{"name": "DefaultAgent", "type": "generic"}]
98+
99+
return agents
100+
50101
async def analyze(self, context: dict[str, Any]) -> dict[str, Any]:
51102
"""
52103
Analyze agent orchestration patterns and predict coordination issues.
53104
54105
In our experience: Multi-agent complexity sneaks up fast.
55106
By agent #7-10, you need formal orchestration or face refactoring.
107+
108+
Supports two modes:
109+
- Structured: Pass agent_definitions, orchestration_code, project_path
110+
- Demo/Text: Pass user_input with natural language description
56111
"""
57-
self.validate_context(context)
112+
# Support text input mode (from web demo) or structured mode
113+
user_input = context.get("user_input", "")
58114

59-
agents = context["agent_definitions"]
60-
orchestration = context["orchestration_code"]
115+
if "agent_definitions" not in context:
116+
# Parse agents from text input for demo mode
117+
agents = self._parse_agents_from_text(user_input)
118+
orchestration = [] # No file analysis in demo mode
119+
else:
120+
self.validate_context(context)
121+
agents = context["agent_definitions"]
122+
orchestration = context["orchestration_code"]
61123

62124
# Current issues
63125
issues = await self._analyze_orchestration_patterns(agents, orchestration)

website/components/TestsBadge.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
interface TestsBadgeProps {
22
tests?: number;
3-
coverage?: number;
43
}
54

65
export default function TestsBadge({
7-
tests = 1954,
8-
coverage = 90.12
6+
tests = 2211
97
}: TestsBadgeProps) {
108
return (
119
<span className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium bg-[#10B981] text-white">
@@ -24,7 +22,7 @@ export default function TestsBadge({
2422
<polyline points="20 6 9 17 4 12" />
2523
</svg>
2624
<span>
27-
{tests.toLocaleString()} tests | {coverage.toFixed(0)}% coverage
25+
{tests.toLocaleString()} tests passing
2826
</span>
2927
</span>
3028
);

0 commit comments

Comments
 (0)