Files
dify/api/services/dify_builder
Charles YaoandClaude Opus 4.8 70c92b97d9 fix(dify-builder): make M2 translation parsing model-agnostic
Harden the Localizer's batch translation against models that format JSON
differently (the Builder model is user-changeable):
- correlate by numeric INDEX instead of echoing source strings as keys, so a
  model that normalizes/truncates long keys no longer misses every lookup
- accept the reply as an index-keyed object OR a positional array, optionally
  wrapped one level (_translations_by_index)
- cache only real translations; a failed/partial reply is left UNCACHED so the
  next turn retries (self-heals) instead of sticking on the English original

TDD: added parser shape-variation tests + a no-cache-failure/self-heal test;
the fake now speaks the index protocol.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 17:31:38 -07:00
..