Skip to content

fix(types): normalize Kie transcription result envelopes - #8824

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.49from
backryun:chore/ts7-types-kie-transcription
Jul 28, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.49from
backryun:chore/ts7-types-kie-transcription

Conversation

@backryun

@backryun backryun commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Validate nested Kie task results as JSON objects before reading transcription fields.
  • Preserve the supported response.text → resultText → nested text → top-level text fallback order.
  • Add an end-to-end handler test for all four envelopes, including a malformed earlier field.

Why

KieExecutor.pollTask() returns a generic JSON object whose nested values remain unknown.
The transcription handler read those nested values directly, producing three TS2339 diagnostics
under both TypeScript 6 and native TypeScript 7. It could also return a non-string value when an
earlier field had an unexpected shape.

Impact

The request and successful-response shapes are unchanged. Kie speech-to-text responses now
guarantee a string text value and continue to a later supported envelope when an earlier value
is malformed.

Validation

  • Re-measured on release/v3.8.49 at b4776a2d8 with a complete line-number-agnostic diagnostic diff:
    • TypeScript 6: 131 → 128; 3 fixed, 0 new
    • native TypeScript 7: 130 → 127; 3 fixed, 0 new
  • Audio transcription tests: 25/25 passing
  • Core typecheck passing
  • Focused ESLint passing
  • check:file-size, T11 any-budget, Prettier, and git diff --check passing

Tracking: #8484

@backryun
backryun marked this pull request as ready for review July 28, 2026 02:36
@backryun
backryun requested a review from diegosouzapw as a code owner July 28, 2026 02:36
@backryun
backryun force-pushed the chore/ts7-types-kie-transcription branch from 7bd295f to 57764f5 Compare July 28, 2026 03:27
@diegosouzapw
diegosouzapw merged commit 2f5e185 into cheaper-inference:release/v3.8.49 Jul 28, 2026
14 of 16 checks passed
@backryun
backryun deleted the chore/ts7-types-kie-transcription branch July 28, 2026 12:09
@diegosouzapw diegosouzapw mentioned this pull request Jul 28, 2026
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
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.

2 participants