Skip to content

[bug] Two overlapping forced AI re-translations let the older source text win #4237

Closed

Description

@Quick104

What happened

Two forced AI re-translations of the same item and language can overwrite each other, so the one that finishes last wins even when it translated older source text.

A forced job replaces any AI-sourced localized overview or tagline when it writes. It doesn't check that the source text it translated is still the current source. When two forced jobs overlap, the slower one writes its result over the newer one's.

#4234 fixes the plain-versus-forced case from #2472 by letting a plain job fill only empty fields. Forced jobs still replace AI text by design, so this case remains.

Steps to reproduce

Proven from source; not reproduced on a live deployment.

  1. An admin requests a forced re-translation of a series into a language with model A. The job reads the current overviews and starts calling the model.
  2. While it runs, the admin edits the series' base overview, switches the description translation model to B, and requests a forced re-translation again. The job key includes the model, so this request gets its own job instead of reusing the first one. With the default AI concurrency of 2 (or on a second node), both jobs run at the same time.
  3. Job B translates the new overview and finishes first.
  4. Job A finishes and writes its translation of the old overview over job B's result. Both jobs report success.

Expected behavior

A translation of outdated source text never replaces a translation of the current source text.

Silo version / commit

main at 703f457 (the rule is unchanged on the #4234 head).

Deployment

n/a, found by source review.

Clients affected

Other/not client-specific (stored localized descriptions shown by every client).

Relevant logs

No logs available.

Technical notes

  • Write: internal/catalog/localization_repo.go, UpsertAITranslation and the season and episode UpsertAIOverview. A forced write lands whenever the stored value is AI-sourced.
  • Job key: idempotencyKey in internal/metadata/translation/job.go includes the model, so forced requests with different models don't share a job.
  • Concurrency: ai.max_concurrent_jobs defaults to 2 (internal/config/db_loader.go), and each node runs its own jobs.
  • Possible repair: have the job pass the source text (or a hash of it) it translated, and write only when that still matches the item's current source text, or the field is empty. That check would cover any writer that changes the source between collection and write, not only forced jobs.
  • This follows fix(metadata): let a plain AI translation fill only fields still empty #4234, which changes the same SQL statements.

AI harness

Claude Code (in T3 Code)

AI tool(s)

Claude Code, OpenAI Codex (review)

AI model(s)

claude-opus-5-5, gpt-6.1-sol

AI involvement

Fully AI-generated from a source review; not reproduced on a live deployment.

Independent or adversarial review

Found independently by a code-review subagent (claude-opus-5-5) and a cross-provider review (gpt-6.1-sol) of #4234, then checked against the source by claude-opus-5-5.

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported
  • I reproduced this myself on a real deployment

Source: found in review of #4234

Activity

  1. added
    bug
    on Nov 15, 2026
  2. added
    priority: P2
    triaged
    on Nov 15, 2026
  3. added a commit that references this issue on Nov 15, 2026
    48cae66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: P2triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions