Skip to content

Conversation

@monkeyWie
Copy link
Owner

No description provided.

@augmentcode
Copy link

augmentcode bot commented Jan 19, 2026

🤖 Augment PR Summary

Summary: Adds explicit handling for Cloudflare “flagged” generation failures so the UI can show a targeted message instead of a generic error.

Changes:

  • Introduces new generation failure reasons: PROMPT_FLAGGED and INPUT_IMAGE_FLAGGED (DB schema + UI mapping).
  • Adds EN/ZH i18n strings for the new error states.
  • Adds GenError and updates the Cloudflare provider to map policy-related 400 responses to these reasons.
Technical Notes: Cloudflare 400 responses are inspected for error code 3030 to classify policy violations.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

throw new GenError("TOO_MANY_REQUESTS");
}
if (resp.status === 400) {
const errorResp = JSON.parse(errorText);
Copy link

Choose a reason for hiding this comment

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

On 400 responses, JSON.parse(errorText) (and firstErr.message.includes(...)) can throw if Cloudflare returns non-JSON or the shape differs, which would skip the intended GenError mapping. Consider guarding the parse/message access so flagged requests reliably surface as PROMPT_FLAGGED / INPUT_IMAGE_FLAGGED.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@monkeyWie monkeyWie added the enhancement New feature or request label Jan 19, 2026
@monkeyWie monkeyWie merged commit 50d84cc into main Jan 19, 2026
1 check passed
@monkeyWie monkeyWie deleted the feat/flagged_error_handler branch January 19, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants