Skip to content

fix(agents): return failed response for NewsAgent stream errors - #643

Open
pei711 wants to merge 1 commit into
ValueCell-ai:mainfrom
pei711:fix/news-agent-stream-failure-response
Open

pei711 wants to merge 1 commit into
ValueCell-ai:mainfrom
pei711:fix/news-agent-stream-failure-response

Conversation

@pei711

@pei711 pei711 commented Oct 27, 2026

Copy link
Copy Markdown

Summary

  • Return streaming.failed(...) when NewsAgent.stream() encounters an upstream error so the executor receives a valid failed task response.
  • Add a regression test for an upstream error during streaming.

Closes #641

Testing

  • uv run pytest valuecell/agents/news_agent/tests/test_core.py -q — 1 passed
  • uv run pytest valuecell/agents/news_agent/tests/test_core.py valuecell/core/agent/tests/test_decorator.py -q — 12 passed
  • uv run ruff check valuecell/agents/news_agent/core.py valuecell/agents/news_agent/tests/test_core.py — passed
  • uv run ruff format --check valuecell/agents/news_agent/core.py valuecell/agents/news_agent/tests/test_core.py — passed
  • uv run isort --check valuecell/agents/news_agent/core.py valuecell/agents/news_agent/tests/test_core.py — passed
  • git diff --check — passed

AI assistance: Codex assisted with implementation and validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NewsAgent.stream yields raw dict on error instead of StreamResponse, causing GenericAgentExecutor to raise ValueError`

1 participant