Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions python/packages/devui/agent_framework_devui/_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,12 +918,16 @@ async def _convert_workflow_event(self, event: Any, context: dict[str, Any]) ->

# Create ExecutorActionItem with completed status
# ExecutorCompletedEvent uses 'data' field, not 'result'
# Serialize the result data to ensure it's JSON-serializable
# (AgentExecutorResponse contains AgentRunResponse/ChatMessage which are SerializationMixin)
raw_result = getattr(event, "data", None)
serialized_result = self._serialize_value(raw_result) if raw_result is not None else None
executor_item = ExecutorActionItem(
type="executor_action",
id=item_id,
executor_id=executor_id,
status="completed",
result=getattr(event, "data", None),
result=serialized_result,
)

# Use our custom event type
Expand All @@ -939,15 +943,17 @@ async def _convert_workflow_event(self, event: Any, context: dict[str, Any]) ->
if event_class == "ExecutorFailedEvent":
executor_id = getattr(event, "executor_id", "unknown")
item_id = context.get(f"exec_item_{executor_id}", f"exec_{executor_id}_unknown")
error_info = getattr(event, "error", None)
# ExecutorFailedEvent uses 'details' field (WorkflowErrorDetails), not 'error'
details = getattr(event, "details", None)
err_msg: str | None = str(getattr(details, "message", details)) if details else None

# Create ExecutorActionItem with failed status
executor_item = ExecutorActionItem(
type="executor_action",
id=item_id,
executor_id=executor_id,
status="failed",
error={"message": str(error_info)} if error_info else None,
error={"message": err_msg} if err_msg else None,
)

# Use our custom event type
Expand Down
2 changes: 1 addition & 1 deletion python/packages/devui/agent_framework_devui/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ async def _stream_execution(
yield "data: [DONE]\n\n"

except Exception as e:
logger.error(f"Error in streaming execution: {e}")
logger.error(f"Error in streaming execution: {e}", exc_info=True)
error_event = {"id": "error", "object": "error", "error": {"message": str(e), "type": "execution_error"}}
yield f"data: {json.dumps(error_event)}\n\n"

Expand Down
1 change: 1 addition & 0 deletions python/packages/devui/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ fallback-version = "0.0.0"

[tool.pytest.ini_options]
testpaths = 'tests'
pythonpath = ["tests"]
addopts = "-ra -q -r fEX"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions python/packages/devui/tests/test_cleanup_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def __init__(self, name: str = "TestAgent"):
async def run_stream(self, messages=None, *, thread=None, **kwargs):
"""Mock streaming run method."""
yield AgentRunResponse(
messages=[ChatMessage(role=Role.ASSISTANT, content=[TextContent(text="Test response")])],
inner_messages=[],
messages=[ChatMessage(role=Role.ASSISTANT, contents=[TextContent(text="Test response")])],
)


Expand Down
1 change: 0 additions & 1 deletion python/packages/devui/tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def test_entities_dir():
return str(samples_dir.resolve())


@pytest.mark.skip("Skipping while we fix discovery")
async def test_discover_agents(test_entities_dir):
"""Test that agent discovery works and returns valid agent entities."""
discovery = EntityDiscovery(test_entities_dir)
Expand Down
Loading
Loading