Skip to content

Revert "Stop yielding the accumulated final response"#1048

Merged
nan-yu merged 1 commit intomainfrom
revert-986-streaming-remove-final-response
Apr 1, 2026
Merged

Revert "Stop yielding the accumulated final response"#1048
nan-yu merged 1 commit intomainfrom
revert-986-streaming-remove-final-response

Conversation

@nan-yu
Copy link
Copy Markdown
Collaborator

@nan-yu nan-yu commented Apr 1, 2026

Reverts #986

We still need the full accumulated final response in case the client is not running in streaming mode.

@github-project-automation github-project-automation bot moved this to Todo in A2UI Apr 1, 2026
@nan-yu nan-yu requested a review from gspencergoog April 1, 2026 17:40
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the contact_lookup and restaurant_finder agents to include parsed response parts in the final task completion yield. The review feedback identifies that using a hardcoded 'OK.' as fallback text in parse_response_to_parts would cause data loss in text-only modes; it is recommended to use the original response content instead. Additionally, unused imports of ResponsePart should be removed from both files.

Comment on lines +364 to 366
final_parts = parse_response_to_parts(
final_response_content, fallback_text="OK."
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using fallback_text="OK." will cause the agent to return "OK." instead of the actual response when running in text-only mode (i.e., when ui_version is None). In text-only mode, parse_response will fail to find A2UI tags and raise a ValueError, causing parse_response_to_parts to return the fallback text.

You should use final_response_content as the fallback text to ensure the full response is preserved in non-UI scenarios.

Suggested change
final_parts = parse_response_to_parts(
final_response_content, fallback_text="OK."
)
final_parts = parse_response_to_parts(
final_response_content, fallback_text=final_response_content
)

Comment on lines +333 to +335
final_parts = parse_response_to_parts(
final_response_content, fallback_text="OK."
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using fallback_text="OK." will cause the agent to return "OK." instead of the actual response when running in text-only mode (i.e., when ui_version is None). In text-only mode, parse_response will fail to find A2UI tags and raise a ValueError, causing parse_response_to_parts to return the fallback text.

You should use final_response_content as the fallback text to ensure the full response is preserved in non-UI scenarios.

Suggested change
final_parts = parse_response_to_parts(
final_response_content, fallback_text="OK."
)
final_parts = parse_response_to_parts(
final_response_content, fallback_text=final_response_content
)

from a2ui.core.schema.constants import VERSION_0_8, VERSION_0_9, A2UI_OPEN_TAG, A2UI_CLOSE_TAG
from a2ui.core.schema.manager import A2uiSchemaManager
from a2ui.core.parser.parser import parse_response
from a2ui.core.parser.parser import parse_response, ResponsePart
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The import of ResponsePart is unused in this file and can be removed.

Suggested change
from a2ui.core.parser.parser import parse_response, ResponsePart
from a2ui.core.parser.parser import parse_response

from a2ui.core.schema.constants import VERSION_0_8, VERSION_0_9, A2UI_OPEN_TAG, A2UI_CLOSE_TAG
from a2ui.core.schema.manager import A2uiSchemaManager
from a2ui.core.parser.parser import parse_response
from a2ui.core.parser.parser import parse_response, ResponsePart
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The import of ResponsePart is unused in this file and can be removed.

Suggested change
from a2ui.core.parser.parser import parse_response, ResponsePart
from a2ui.core.parser.parser import parse_response

@nan-yu nan-yu merged commit 3d92813 into main Apr 1, 2026
6 checks passed
@nan-yu nan-yu deleted the revert-986-streaming-remove-final-response branch April 1, 2026 22:14
@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants