refactor: clean up agent architecture and coordination loop

Squash merged refactoring of agent architecture.
This commit is contained in:
2026-06-29 22:44:06 +02:00
parent 7f66d09d9e
commit edc8415571
8 changed files with 760 additions and 812 deletions
+5 -4
View File
@@ -94,7 +94,8 @@ def test_run_verification_failure(tmp_path: Path) -> None:
@patch("core.dispatcher.CodingAgent")
async def test_dispatch_planning_and_coding_phases(mock_agent_class: MagicMock) -> None:
@patch("core.dispatcher.PlanningAgent")
async def test_dispatch_planning_and_coding_phases(mock_planning_class: MagicMock, mock_coding_class: MagicMock) -> None:
mock_client: MagicMock = MagicMock(spec=GiteaClient)
mock_tools: MagicMock = MagicMock(spec=GiteaTools)
@@ -117,14 +118,14 @@ async def test_dispatch_planning_and_coding_phases(mock_agent_class: MagicMock)
mock_client.get_pull_request_files.return_value = []
mock_client.get_pr_reviews.return_value = []
# Mock CodingAgent instances
# Mock agent instances
mock_planning_agent = MagicMock()
mock_planning_agent.run_with_tools = AsyncMock(return_value="Plan: Modify file A")
mock_planning_class.return_value = mock_planning_agent
mock_coding_agent = MagicMock()
mock_coding_agent.run_with_tools = AsyncMock(return_value="PR #1 Created")
mock_agent_class.side_effect = [mock_planning_agent, mock_coding_agent]
mock_coding_class.return_value = mock_coding_agent
dispatcher = AgentDispatcher(client=mock_client, tools=mock_tools)