Skip to content

SCA-3909: fix(batch): memoize deterministic decode failures on the sampled upload path - #26147

Merged
Git-on-my-level merged 1 commit into
mainfrom
agent/omi-control-hermes-glm-5-3/4cbe099ae258
Nov 23, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
agent/omi-control-hermes-glm-5-3/4cbe099ae258

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Multica: SCA-3909.

Failure-Class: none

Line-Count-Exception: backend/utils/batch_pipeline/intake.py | 1499 -> 1505 | the memo-gate comment documents why the sampled decode phase is memoizable and the probe phase is not

What

Luna's R2 review of the 24h-push decode-memo fix (SCA-2229, #25302) found a P2 that never landed: the intake memo gate recognized only phase decode, but a sampled upload (unknown-multilingual admission, legacy still on) advances the same decoder under its own phase sample_decode before anything is staged. A deterministic decode failure there returned the retryable 503 uncached, so every retry of bytes that cannot decode linked a fresh private sample and decoded them again.

  • backend/utils/batch_pipeline/intake.py — the gate now admits sample_decode beside decode. The probe phase (language_probe) classifies already-decoded audio, so no decoder fault can surface there; it stays out of the gate.
  • backend/tests/unit/test_batch_intake_decode_failure_memo.py — the fixture is parameterized (user row + legacy mode); a new sampled_world runs the unknown-multilingual admission. The regression test proves the sampled path stores the memo and the retry answers the byte-identical 503 without linking a sample directory or invoking the decoder; the kill-switch test proves SYNC_RECORD_DECODE_FAILURE_MEMO=off still repeats the decode.

Contract

  • The 503 response is byte-for-byte the existing _sync_unavailable_response() on both the hit and the miss path; no new status, headers or body.
  • No new flags: SYNC_RECORD_DECODE_FAILURE_MEMO keeps its default-on state and its off-switch semantics; the memo key, 300 s TTL and NX write are untouched.
  • The memo read side already ran before the sampled branch (_cached_decode_refusal), so only the write gate changed.

Evidence

  • The regression test fails on current main (no memo write on the sampled path; the retry re-decodes) and passes with the fix; live run results are recorded on the Multica issue.

View guided diff Turn on auto-fix

…ad path

The intake memo gate recognized only phase 'decode', but a sampled upload
(unknown-multilingual admission) advances the same decoder under phase
'sample_decode' before anything is staged, so its deterministic decode
failures returned the retryable 503 uncached and every retry re-decoded
the same bytes. Include 'sample_decode' in the gate; the probe phase
classifies already-decoded audio, so no decoder fault can surface there.

Regression tests: the sampled path stores the memo and the retry answers
the same 503 without linking a sample or invoking the decoder; the
existing kill switch keeps repeating the decode when off.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T14:31:00.085445Z 71f8700 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level
Git-on-my-level merged commit 318a28e into main Nov 23, 2026
75 of 77 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/omi-control-hermes-glm-5-3/4cbe099ae258 branch November 23, 2026 18:37
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