feat: add comprehensive debug logging for issue #477 hanging/freezing diagnosis (#662)

* feat: add comprehensive debug logging for issue #477 hanging/freezing diagnosis
- Add debug logging to src/server/app.py for event streaming and message chunk processing
- Track graph event flow with thread IDs for correlation
- Add detailed logging in interrupt event processing
- Add debug logging to src/agents/tool_interceptor.py for tool execution and interrupt handling
- Log interrupt decision flow and user feedback processing
- Add debug logging to src/graph/nodes.py for agent node execution
- Track step execution progress and agent coordination in research_team_node
- Add debug logging to src/agents/agents.py for agent creation and tool wrapping
- Update server.py to enable debug logging when --log-level debug is specified
- Add thread ID correlation throughout for better diagnostics
- Helps diagnose hanging/freezing issues during workflow execution

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Willem Jiang
2025-10-27 08:21:30 +08:00
committed by GitHub
parent e9f0a02f1f
commit 83f1334db0
6 changed files with 171 additions and 27 deletions

View File

@@ -969,7 +969,9 @@ async def test_execute_agent_step_no_unexecuted_step(
)
assert isinstance(result, Command)
assert result.goto == "research_team"
mock_logger.warning.assert_called_with("No unexecuted step found")
# Updated assertion to match new debug logging format
mock_logger.warning.assert_called_once()
assert "No unexecuted step found" in mock_logger.warning.call_args[0][0]
@pytest.mark.asyncio