fix(offers): DE→DA translation returned nothing — disable thinking, batch big #3

Merged
hjess merged 1 commits from worktree-citti-arkiver-tur into main 2026-10-30 11:23:41 +01:00
Owner

Prod showed 0 of 467 headings translated while AI matching worked. Cause:
Haiku 5.5 defaults thinking on, which consumed the 4000-token budget on the
40-item translation batches and truncated the JSON, so every batch fell back
to German. Matching (one small response) slipped through.

  • Disable thinking on both Claude calls (mechanical JSON tasks), via a shared
    _claude_json helper that retries without the flag if a model rejects it
  • Raise max_tokens (16000 translate / 8000 match) so output fits even if
    thinking stays on
  • Batch ~all headings in 1-2 calls (250) instead of 40, so the preamble isn't
    repeated per batch and we don't hammer the rate limit (cheaper, as suggested)
Prod showed 0 of 467 headings translated while AI matching worked. Cause: Haiku 5.5 defaults thinking on, which consumed the 4000-token budget on the 40-item translation batches and truncated the JSON, so every batch fell back to German. Matching (one small response) slipped through. - Disable thinking on both Claude calls (mechanical JSON tasks), via a shared _claude_json helper that retries without the flag if a model rejects it - Raise max_tokens (16000 translate / 8000 match) so output fits even if thinking stays on - Batch ~all headings in 1-2 calls (250) instead of 40, so the preamble isn't repeated per batch and we don't hammer the rate limit (cheaper, as suggested)
hjess added 1 commit 2026-10-30 11:23:37 +01:00
Prod showed 0 of 467 headings translated while AI matching worked. Cause:
Haiku 5.5 defaults thinking on, which consumed the 4000-token budget on the
40-item translation batches and truncated the JSON, so every batch fell back
to German. Matching (one small response) slipped through.

- Disable thinking on both Claude calls (mechanical JSON tasks), via a shared
  _claude_json helper that retries without the flag if a model rejects it
- Raise max_tokens (16000 translate / 8000 match) so output fits even if
  thinking stays on
- Batch ~all headings in 1-2 calls (250) instead of 40, so the preamble isn't
  repeated per batch and we don't hammer the rate limit (cheaper, as suggested)
hjess merged commit b7141d787b into main 2026-10-30 11:23:41 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hjess/ti#3