Conversation
📝 WalkthroughWalkthroughThis PR introduces a complete QA Engineer Agent template featuring a graph-based workflow with four orchestrated nodes (planning, execution, UI testing, reporting) that automate test execution and report generation, supported by configuration files and MCP server definitions for tool integration. Changes
Sequence DiagramsequenceDiagram
participant User as User/Main
participant Agent as QaEngineerAgent
participant Runtime as GraphRuntime
participant Planning as Planning Node
participant Execution as Execution Node
participant UiTest as UI Testing Subagent
participant Reporting as Reporting Node
participant LLM as LLM Provider
User->>Agent: run(context)
Agent->>Agent: start()
Agent->>Runtime: create_agent_runtime()
activate Runtime
User->>Runtime: trigger(default entry point)
Runtime->>Planning: execute
activate Planning
Planning->>LLM: analyze request, create test plan
LLM-->>Planning: test plan
Planning-->>Runtime: success
deactivate Planning
Runtime->>Execution: execute (on_success)
activate Execution
Execution->>LLM: run planned tests
LLM-->>Execution: test results
Execution->>UiTest: delegate UI testing (sub_agents)
activate UiTest
UiTest->>LLM: exploratory UI verification
LLM-->>UiTest: UI findings
UiTest-->>Execution: UI results
deactivate UiTest
Execution-->>Runtime: success
deactivate Execution
Runtime->>Reporting: execute (on_success)
activate Reporting
Reporting->>LLM: compile results + UI findings
LLM-->>Reporting: final QA report
Reporting-->>Runtime: success
deactivate Reporting
Runtime-->>Agent: ExecutionResult
deactivate Runtime
Agent->>Agent: stop()
Agent-->>User: result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
examples/templates/qa_engineer_agent/agent.py (2)
176-182: Consider adding timeout configuration.The
runmethod callstrigger_and_waitwithout an explicit timeout. If the execution hangs, this could block indefinitely. Consider making the timeout configurable.Suggested enhancement
- async def run(self, context: dict, mock_mode=False, session_state=None) -> ExecutionResult: + async def run(self, context: dict, mock_mode=False, session_state=None, timeout: float | None = None) -> ExecutionResult: await self.start(mock_mode=mock_mode) try: - result = await self._agent_runtime.trigger_and_wait("default", context, session_state=session_state) + result = await self._agent_runtime.trigger_and_wait("default", context, session_state=session_state, timeout=timeout) return result or ExecutionResult(success=False, error="Execution timeout") finally: await self.stop()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/templates/qa_engineer_agent/agent.py` around lines 176 - 182, Add a configurable timeout to the run method so trigger_and_wait cannot hang indefinitely: update the async def run(self, context: dict, mock_mode=False, session_state=None) -> ExecutionResult signature to accept a timeout parameter (e.g. timeout: Optional[float] = DEFAULT_TIMEOUT), validate or default it, then pass that timeout into self._agent_runtime.trigger_and_wait("default", context, session_state=session_state, timeout=timeout). Ensure you handle a timeout result or timeout exception by returning ExecutionResult(success=False, error="Execution timeout") and still call await self.stop() in the finally block; reference run, _agent_runtime.trigger_and_wait, ExecutionResult and stop when making the changes.
75-82: Consider Python-idiomatic comparison in condition expression.The condition expression uses
needs_more_testing == True. While this is a string that may be evaluated by the framework, the more Pythonic pattern would beneeds_more_testing is Trueor simplyneeds_more_testing.Suggested change
EdgeSpec( id="report-to-plan", source="reporting", target="planning", condition=EdgeCondition.CONDITIONAL, - condition_expr="needs_more_testing == True", + condition_expr="needs_more_testing", priority=1, ),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/templates/qa_engineer_agent/agent.py` around lines 75 - 82, The condition expression for EdgeSpec with id "report-to-plan" is using the non-idiomatic "needs_more_testing == True"; update the EdgeSpec's condition_expr to a more Pythonic expression such as "needs_more_testing" (or "needs_more_testing is True" if explicit identity is required) so the framework evaluates it in a Pythonic way; locate the EdgeSpec instance (id="report-to-plan") and replace the condition_expr string accordingly.examples/templates/qa_engineer_agent/__init__.py (1)
3-7: Use English for code comments.The comments are in French but the rest of the codebase appears to use English. For consistency, consider translating:
- Line 3: "We import variables from agent.py and config.py so Hive can find them"
- Line 7: "We tell Python what is publicly exposed"
Suggested fix
-# On importe les variables depuis agent.py et config.py pour que Hive les trouve +# Import variables from agent.py and config.py for Hive discovery from .agent import default_agent, edges, goal, nodes from .config import metadata -# On indique à Python ce qui est exposé publiquement +# Define public API exports __all__ = [🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/templates/qa_engineer_agent/__init__.py` around lines 3 - 7, Translate the French comments in __init__.py to English to match the codebase: change the comment above the imports to something like "Import variables from agent.py and config.py so Hive can find them" and change the comment below to "Declare what is publicly exposed to Python"; keep the existing imports (default_agent, edges, goal, nodes) and metadata unchanged so behavior is identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/templates/qa_engineer_agent/mcp_servers.json`:
- Around line 11-14: The browser MCP server config uses the wrong invocation in
the "browser" object: replace the args array currently set to ["-m", "gcu",
"serve", "browser"] with the canonical MCP server invocation described in the
docs so the "browser" command runs the gcu.server in stdio mode; specifically
update the "browser" object's args to the documented invocation (use the "run"
style invocation that launches python -m gcu.server with --stdio) so MCP
communication is correct.
---
Nitpick comments:
In `@examples/templates/qa_engineer_agent/__init__.py`:
- Around line 3-7: Translate the French comments in __init__.py to English to
match the codebase: change the comment above the imports to something like
"Import variables from agent.py and config.py so Hive can find them" and change
the comment below to "Declare what is publicly exposed to Python"; keep the
existing imports (default_agent, edges, goal, nodes) and metadata unchanged so
behavior is identical.
In `@examples/templates/qa_engineer_agent/agent.py`:
- Around line 176-182: Add a configurable timeout to the run method so
trigger_and_wait cannot hang indefinitely: update the async def run(self,
context: dict, mock_mode=False, session_state=None) -> ExecutionResult signature
to accept a timeout parameter (e.g. timeout: Optional[float] = DEFAULT_TIMEOUT),
validate or default it, then pass that timeout into
self._agent_runtime.trigger_and_wait("default", context,
session_state=session_state, timeout=timeout). Ensure you handle a timeout
result or timeout exception by returning ExecutionResult(success=False,
error="Execution timeout") and still call await self.stop() in the finally
block; reference run, _agent_runtime.trigger_and_wait, ExecutionResult and stop
when making the changes.
- Around line 75-82: The condition expression for EdgeSpec with id
"report-to-plan" is using the non-idiomatic "needs_more_testing == True"; update
the EdgeSpec's condition_expr to a more Pythonic expression such as
"needs_more_testing" (or "needs_more_testing is True" if explicit identity is
required) so the framework evaluates it in a Pythonic way; locate the EdgeSpec
instance (id="report-to-plan") and replace the condition_expr string
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 05a11ce4-4dcd-40a6-98dd-ba2285d778e5
📒 Files selected for processing (7)
examples/templates/qa_engineer_agent/__init__.pyexamples/templates/qa_engineer_agent/__main__.pyexamples/templates/qa_engineer_agent/agent.pyexamples/templates/qa_engineer_agent/config.pyexamples/templates/qa_engineer_agent/flowchart.jsonexamples/templates/qa_engineer_agent/mcp_servers.jsonexamples/templates/qa_engineer_agent/nodes/__init__.py
| "browser": { | ||
| "command": "python", | ||
| "args": ["-m", "gcu", "serve", "browser"] | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check gcu module structure and available entry points
fd -t f '__main__.py' --full-path '.*gcu.*' --exec cat {}
# Check if gcu has a 'serve' subcommand or CLI entry point
rg -n "serve|browser" --type py -g '*gcu*'Repository: aden-hive/hive
Length of output: 10702
Fix incorrect GCU MCP server invocation in browser configuration.
The browser server uses an incorrect invocation pattern. The correct pattern, as documented in core/framework/graph/gcu.py and core/framework/agents/queen/reference/gcu_guide.md, is:
"args": ["run", "python", "-m", "gcu.server", "--stdio"]
Replace ["-m", "gcu", "serve", "browser"] with the canonical invocation above to ensure proper MCP server communication.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@examples/templates/qa_engineer_agent/mcp_servers.json` around lines 11 - 14,
The browser MCP server config uses the wrong invocation in the "browser" object:
replace the args array currently set to ["-m", "gcu", "serve", "browser"] with
the canonical MCP server invocation described in the docs so the "browser"
command runs the gcu.server in stdio mode; specifically update the "browser"
object's args to the documented invocation (use the "run" style invocation that
launches python -m gcu.server with --stdio) so MCP communication is correct.
Description
Added a new
qa_engineer_agenttemplate to the framework. This advanced agent is designed to handle full-project Quality Assurance by executing automated test suites (via CLI) and performing exploratory UI testing (via a GCU browser sub-agent). It orchestrates the testing process, analyzes stdout/stderr logs, evaluates UI states, and generates a comprehensive QA report.Type of Change
Related Issues
Fixes #6732
Changes Made
qa_engineer_agentpackage underexamples/templates/.agent.pydefining the graph workflow and success criteria for QA testing.nodes/__init__.pywith 4 distinct nodes:planning(event_loop): To formulate the testing strategy.test_execution(event_loop): To execute automated tests usingexecute_command_tooland delegate UI tasks.ui_testing(gcu): A sub-agent leveraging Playwright tools for exploratory visual testing.reporting(event_loop): To compile results and interact with the user.mcp_servers.jsonto load the bash executor and GCU browser tools.flowchart.jsonto accurately visualize the agent's graph and available tools in the Hive UI.__main__.pyto provide a CLI entry point for testing the agent directly.Testing
Describe the tests you ran to verify your changes:
python -m examples.templates.qa_engineer_agentand verified the graph loads perfectly in the Hive Dashboard).Checklist
Summary by CodeRabbit
Release Notes