Skip to content

fix(compat): map legacy encoding "text" to "none" - #207

Merged
howethomas merged 1 commit into
mainfrom
fix/compat-text-encoding
Sep 25, 2026
Merged

howethomas merged 1 commit into
mainfrom
fix/compat-text-encoding

Conversation

@howethomas

Copy link
Copy Markdown
Contributor

Problem

Legacy producers write entries with encoding: "text" for a plain-string body. It isn't a spec value (base64url, json, none). normalize_legacy_fields renames legacy field names but never touched encoding values, so the conserver stored "text" as is and spec-strict consumers reject it. With storage.vcon_mcp in a chain, vcon-mcp answers 400 {"message":"Attachment 5 has invalid encoding: text"} and the vCon lands in DLQ:storage:vcon_mcp.

In a 30-day production corpus, 47,105 of 259,525 vCons (18%) carry it, all on a searchable_text attachment.

Change

_normalize_entry (dialog, analysis, attachments) rewrites encoding: "text" to "none", which means the same thing. The body is untouched. Docstring mapping list updated.

Tests

  • New test_legacy_text_encoding_to_none in common/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

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>
@howethomas
howethomas merged commit a4ccbc9 into main Sep 25, 2026
1 check 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.

1 participant