fix(compat): map legacy encoding "text" to "none" - #207
Merged
Merged
Conversation
Some legacy producers write dialog/analysis/attachment entries with encoding "text" for a plain-string body. That is not a spec value (base64url, json, none), so the conserver stored it unchanged and spec-strict consumers reject it: vcon-mcp returns 400 "invalid encoding: text" from storage.vcon_mcp. In one production corpus 18% of vCons (47,105 of 259,525) carry it on an attachment. normalize_legacy_fields now rewrites encoding "text" to "none", which means the same thing, alongside the existing legacy field renames. Body is untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Legacy producers write entries with
encoding: "text"for a plain-string body. It isn't a spec value (base64url,json,none).normalize_legacy_fieldsrenames legacy field names but never touched encoding values, so the conserver stored"text"as is and spec-strict consumers reject it. Withstorage.vcon_mcpin a chain, vcon-mcp answers400 {"message":"Attachment 5 has invalid encoding: text"}and the vCon lands inDLQ:storage:vcon_mcp.In a 30-day production corpus, 47,105 of 259,525 vCons (18%) carry it, all on a
searchable_textattachment.Change
_normalize_entry(dialog, analysis, attachments) rewritesencoding: "text"to"none", which means the same thing. The body is untouched. Docstring mapping list updated.Tests
test_legacy_text_encoding_to_noneincommon/tests/test_vcon_compat.py: fails on main, passes here.test_vcon_compat.py,test_vcon_egress_compat.py(round-trip guard),test_vcon_redis_spec_enforce.py,test_api.py: 57 passed.Independent of #206.
🤖 Generated with Claude Code