Skip to content

Conversation

tylerslaton
Copy link
Contributor

testing #471

contextablemark and others added 10 commits October 2, 2025 00:00
Replace fragile usage_metadata-based logic with robust streaming detection
that checks multiple explicit streaming indicators.

**Problem:**
The original logic relied on `not adk_event.usage_metadata` to determine
if an event should be processed as streaming. This was fragile because
Claude models can include usage_metadata even in streaming chunks,
causing responses to disappear.

**Solution:**
Implement comprehensive streaming detection that checks:
- `partial` attribute (explicitly marked as partial)
- `turn_complete` attribute (live streaming completion status)
- `is_final_response()` method (final response indicator)
- `finish_reason` attribute (fallback for content without finish reason)

This ensures all streaming content is captured regardless of usage_metadata
presence, fixing compatibility with Claude Sonnet 4 and other models.

**Testing:**
✅ All 277 tests pass
✅ Streaming detection works across different model providers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…k-agent

Add regression test for partial final ADK chunks
Change TextMessageContentEvent to TextMessageChunkEvent in test to match
actual AG-UI protocol event types.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…ttranslator

Add test for ADK streaming fallback branch
@contextablemark
Copy link
Contributor

@tylerslaton I see the failures - I'll take a look this evening.

@contextablemark contextablemark mentioned this pull request Oct 5, 2025
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.

2 participants