Skip to content

fix: ignore truncated Gemini responses#67

Merged
crisbeto merged 1 commit intoangular:mainfrom
crisbeto:truncated-responses
Sep 30, 2025
Merged

fix: ignore truncated Gemini responses#67
crisbeto merged 1 commit intoangular:mainfrom
crisbeto:truncated-responses

Conversation

@crisbeto
Copy link
Copy Markdown
Member

Occasionally Gemini truncates the response on the class= sequence. These changes ignore such responses to reduce noise from the results.

Occasionally Gemini truncates the response on the `class=` sequence. These changes ignore such responses to reduce noise from the results.
// Consider these cases as invalid so they don't influence the results.
return (
files.length === 0 ||
!files.some((file) => file.code.trim().endsWith('class='))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This makes sense to treat as "invalid", but two questions:

  • Wouldn't such output result in a failed build etc anyway?
  • This seems Angular specific? how can other frameworks configure this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. If there's an API error, we ignore the full run further down so these won't show up at all.
  2. It's basically a no-op for other frameworks so I figured that we don't really need to configure it.

Copy link
Copy Markdown
Member

@devversion devversion Sep 30, 2025

Choose a reason for hiding this comment

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

I see, for (2) I was thinking other frameworks might see same issues and want to "error out gracefully" then. We can always follow up on this

@crisbeto crisbeto merged commit 8ec4883 into angular:main Sep 30, 2025
3 checks passed
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