Skip to content

genie: return full answer text from all text attachments#432

Open
yinxi-db wants to merge 1 commit into
databricks:mainfrom
yinxi-db:yinxi-feat-dev/es-1953657-genie-full-text
Open

genie: return full answer text from all text attachments#432
yinxi-db wants to merge 1 commit into
databricks:mainfrom
yinxi-db:yinxi-feat-dev/es-1953657-genie-full-text

Conversation

@yinxi-db
Copy link
Copy Markdown

@yinxi-db yinxi-db commented Jun 5, 2026

Summary

Genie.poll_for_result previously kept only the first text attachment following the final query, silently dropping a leading summary or a trailing follow-up. When Genie returns an answer split across multiple text attachments (e.g. a bulleted summary plus a follow-up prompt), part of the response text was lost.

This change makes _parse_attachments return all text attachments that belong to the final answer, and joins their contents in order:

  • Text strictly between the first and last query attachment is treated as a superseded self-correction attempt and dropped.
  • All other text — a leading summary before the query, or any text following the final query — is part of the answer and is kept in order.
  • _extract_text_attachment_content_from_attachments (renamed from the singular form) joins the kept text contents with a blank line.

No public API changes; GenieResponse.text_attachment_content now contains the complete answer text.

Tests

  • Updated _parse_attachments parametrized unit tests to assert the list of kept text attachments, including a case with a summary before the query plus a trailing text after it.
  • Updated _extract_text_content tests to cover joining multiple text attachments and skipping empty ones.
  • Added an integration behavior test asserting the surfaced summary text is non-empty.

This pull request and its description were written by Isaac.

poll_for_result previously kept only the first text attachment following
the final query, silently dropping a leading summary or trailing follow-up.
_parse_attachments now returns all text attachments belonging to the final
answer (dropping only text superseded by self-correction, i.e. text strictly
between the first and last query), and the contents are joined in order.

Co-authored-by: Isaac
@nisha2003 nisha2003 self-requested a review June 8, 2026 03:49
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.

1 participant