Skip to content

woocommerce evals: don't crash on unknown email charsets in Subject headers - #68

Open
bleonard wants to merge 1 commit into
hkust-nlp:mainfrom
induction-ai:fix/email-subject-charset
Open

woocommerce evals: don't crash on unknown email charsets in Subject headers#68
bleonard wants to merge 1 commit into
hkust-nlp:mainfrom
induction-ai:fix/email-subject-charset

Conversation

@bleonard

Copy link
Copy Markdown

The woocommerce-product-recall verifier failed whole runs with:

Recall Emails: ❌ FAILED
  Details: Recall email check error: unknown encoding: unknown-8bit

email.header.decode_header can report charset labels that are RFC-legal but have no Python codec (e.g. unknown-8bit); calling part.decode(encoding or 'utf-8') on those raises LookupError, which fails the entire email check regardless of what the agent actually sent.

Body decoding was already hardened against exactly this (_decode_email_part falls back to utf-8 with errors="replace"); the Subject path wasn't.

This PR applies the same fallback to Subject decoding in woocommerce-product-recall, and to the identical pattern in woocommerce-stock-alert (two sites) and woocommerce-new-product.

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