Skip to content

fix(image): catch English upstream refusals and clarify timeout errors - #397

Open
CEastWind wants to merge 2 commits into
basketikun:mainfrom
CEastWind:fix/image-refusal-keywords
Open

CEastWind wants to merge 2 commits into
basketikun:mainfrom
CEastWind:fix/image-refusal-keywords

Conversation

@CEastWind

Copy link
Copy Markdown
Contributor
  • Add English refusal keywords observed in production ("i can't help", "nude", "topless", "unclothed", "sexually explicit") and normalize curly apostrophes before matching, so English model refusals on /v1/images/edits end at the first poll round instead of waiting out the poll timeout
  • Record conversation_id in call logs for generic image failures (poll timeout, SSE hard cap); reset last_conversation_id before backend construction so account retries never inherit a stale id
  • Log blocked flag and message_preview in image_stream_resolve_start
  • Reword poll-timeout and SSE hard-cap error messages to state the stage and known facts, dropping config hints and speculative causes
  • Rename the settings label to "生图阶段超时" and explain that both stages use the limit sequentially
  • Add unit tests using the eight refusal texts observed in production

- Add English refusal keywords observed in production ("i can't help",
  "nude", "topless", "unclothed", "sexually explicit") and normalize curly
  apostrophes before matching, so English model refusals on /v1/images/edits
  end at the first poll round instead of waiting out the poll timeout
- Record conversation_id in call logs for generic image failures (poll
  timeout, SSE hard cap); reset last_conversation_id before backend
  construction so account retries never inherit a stale id
- Log blocked flag and message_preview in image_stream_resolve_start
- Reword poll-timeout and SSE hard-cap error messages to state the stage
  and known facts, dropping config hints and speculative causes
- Rename the settings label to "生图阶段超时" and explain that both stages
  use the limit sequentially
- Add unit tests using the eight refusal texts observed in production
…tasks

The web image page runs generations through ImageTaskService, which writes
its own call log entry via _log_call. That path never carried the
conversation_id captured from the exception, so failed web-initiated
requests showed no conversation_id in the call log even though the API
path (LoggedCall) already did.
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