Repository navigation
Co-op Translator 0.23.1
Co-op Translator 0.23.1
This patch release makes Markdown translation recovery reliable when an AI model reports a normal completion but silently omits source lines or loses, duplicates, or reorders protected Markdown content.
Highlights
- Validates line anchors and protected code-block, inline-code, and link-destination placeholders inside each translated chunk.
- Rejects silent placeholder loss, duplication, and reordering before a chunk is accepted.
- Preserves the longest verified translated prefix and retries only the missing terminal suffix when possible.
- Targets the first affected source line before falling back to semantic token limits and lossless paragraph/line bisection down to a single line.
- Emits safe structured retry diagnostics, including expected/actual counts and the first affected source line, without exposing source text.
Root cause
Live Azure OpenAI replays showed that AI model can intermittently return HTTP 200 with finish_reason='stop' while producing structurally incomplete Markdown. The omitted boundary can move between otherwise identical calls, and affected responses remain below provider token limits without a length or content_filter finish reason.
The Markdown splitter were not the root cause. Chunking limits retry cost and reduces the probability of failure, but it cannot prevent this model behavior by itself. Co-op Translator previously detected protected-placeholder corruption only after translated chunks were joined, which removed the chunk and source-line context needed for targeted recovery. It also discarded valid translated prefixes and retranslated them on every retry.
Verification
The production failure was reproduced and fixed with:
- Repository:
microsoft/generative-ai-for-beginners - Source:
CHANGELOG.mdat commitc35bc1950f9dc56af773d2c362dafce6f76e9a56 - Target language: Tamil (
ta)
Post-fix results:
- Translation run: 1 translated, 0 failed
- Source and translation: 181 lines each
- Protected code spans: 179/179 with exact content and order preserved
- Markdown link destinations: 1/1 with exact content and order preserved
- Leaked internal control or protection markers: 0
- Markdown translator tests: 30 passed
- Full non-live suite: 555 passed, 2 skipped
- Python 3.11, 3.12, 3.13, and 3.14 CI: passed
- Ruff, Black, package validation, and wheel build: passed
What's Changed
- Core: Recover silent Markdown translation omissions by Minseok Song (@skytin1004) in #568
Full Changelog: v0.23.0...v0.23.1