Skip to content

fix(weave): show contentless agent errors in conversations - #7724

Merged
bcsherma merged 1 commit into
masterfrom
codex/show-contentless-agent-errors
Aug 11, 2026
Merged

fix(weave): show contentless agent errors in conversations#7724
bcsherma merged 1 commit into
masterfrom
codex/show-contentless-agent-errors

Conversation

@bcsherma

@bcsherma bcsherma commented Aug 11, 2026

Copy link
Copy Markdown
Member

What

Keep errored chat spans in the agent conversation projection even when they have no output text or reasoning. The API emits an empty assistant message carrying the span ID, timing, model, and ERROR status, so the existing conversation and turn timeline can show the failure.

Why

The conversation badge counts every ERROR span, but build_chat_messages previously dropped content spans without renderable content. A failed streaming chat call could therefore contribute to the badge while disappearing from the turn timeline and conversation view.

How

_emit_assistant_message still omits empty successful spans. It now emits a message when status_code == "ERROR", using the existing assistant-message schema and status rendering.

This does not require an API schema change or migration.

Testing

  • uv run --group test python -m pytest tests/trace_server/test_genai_chat_view.py -q (56 passed, 1 expected failure)
  • uvx ruff check weave/trace_server/agents/chat_view.py tests/trace_server/test_genai_chat_view.py
  • uvx ruff format --check weave/trace_server/agents/chat_view.py tests/trace_server/test_genai_chat_view.py

Anything Else?

This PR is stacked on the exception-event detail fallback because the same contentless error span should expose its exception details when opened from the conversation.

bcsherma commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Base automatically changed from codex/surface-otel-exception-details to master August 11, 2026 18:21
@bcsherma
bcsherma force-pushed the codex/show-contentless-agent-errors branch from 7a3c926 to 6f16a48 Compare August 11, 2026 18:23
@bcsherma
bcsherma marked this pull request as ready for review August 11, 2026 18:24
@bcsherma
bcsherma requested a review from a team as a code owner August 11, 2026 18:24
@bcsherma
bcsherma merged commit 1213bfa into master Aug 11, 2026
108 checks passed
@bcsherma
bcsherma deleted the codex/show-contentless-agent-errors branch August 11, 2026 23:27
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants