{"record":{"id":"c82baa36cc473f13","repo":"moeru-ai/airi","slug":"hearing-confidence-filter-is-enabled-but-the-pro","errorCode":null,"errorMessage":"[Hearing] Confidence filter is enabled but the provider did not return verbose_json segments. Filtering has no effect.","messagePattern":"\\[Hearing\\] Confidence filter is enabled but the provider did not return verbose_json segments\\. Filtering has no effect\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/stage-ui/src/stores/modules/hearing.ts","lineNumber":523,"sourceCode":"        file: normalizedInput.file,\n        fileName: resolveTranscriptionFileName(normalizedInput.file, normalizedInput.fileName),\n        responseFormat: useVerboseJson ? 'verbose_json' : format,\n      })\n\n      if (useVerboseJson) {\n        if (response.segments) {\n          verboseJsonNotSupported.value = false\n          const filteredText = filterTranscriptionByConfidence(response.segments, confidenceThreshold.value)\n          emitSucceeded(filteredText.length, false)\n          return {\n            mode: 'generate',\n            ...response,\n            text: filteredText,\n          }\n        }\n        else {\n          verboseJsonNotSupported.value = true\n          console.warn('[Hearing] Confidence filter is enabled but the provider did not return verbose_json segments. Filtering has no effect.')\n        }\n      }\n\n      const fallbackText = normalizeGeneratedTranscriptionText(response)\n      emitSucceeded(fallbackText.length, false)\n      return {\n        mode: 'generate',\n        ...response,\n        text: fallbackText,\n      }\n    }\n    catch (err) {\n      emitFailed(err)\n      throw err\n    }\n  }\n\n  return {","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/moeru-ai/airi/blob/f679616c34f1cf6d282c8d64264242af944b3fed/packages/stage-ui/src/stores/modules/hearing.ts#L505-L541","documentation":"With the hearing confidence filter enabled (confidenceThreshold above the disabled sentinel), the module requests responseFormat 'verbose_json' from the transcription provider. Some OpenAI-compatible endpoints accept verbose_json but return a payload without a segments array; when response.segments is missing, the confidence filter cannot run, verboseJsonNotSupported is flagged for the UI, and the unfiltered normalizeGeneratedTranscriptionText fallback text is returned instead.","triggerScenarios":"Using an OpenAI-compatible provider whose /audio/transcriptions endpoint ignores response_format=verbose_json (local whisper.cpp / faster-whisper shims, gateways that rewrite responses); providers that omit segments for very short clips; any generateTranscription response lacking segments while useVerboseJson is true.","commonSituations":"Self-hosted whisper servers with partial OpenAI API compatibility; third-party proxies normalizing verbose_json to plain text; provider upgrades dropping segments support; confidence slider enabled against such a provider.","solutions":["Use a provider that honors response_format=verbose_json (e.g. the OpenAI Whisper API) when confidence filtering matters","Upgrade the local whisper server to a build that emits segments in verbose_json","Disable the confidence threshold in hearing settings - useVerboseJson then becomes false and the warning stops","Surface verboseJsonNotSupported in the UI so users see the filter is inert instead of only a console warn"],"exampleFix":"// before: endpoint ignores verbose_json, segments undefined\nconst response = await generateTranscription({ ...request, responseFormat: 'verbose_json' })\nfilterTranscriptionByConfidence(response.segments ?? [], threshold)\n\n// after: capability-check before filtering\nif (useVerboseJson && Array.isArray(response.segments)) {\n  return { ...response, text: filterTranscriptionByConfidence(response.segments, threshold) }\n}\nverboseJsonNotSupported.value = true\nreturn { ...response, text: normalizeGeneratedTranscriptionText(response) }","handlingStrategy":"validation","validationCode":"const probe = await generateTranscription({ ...request, responseFormat: 'verbose_json' })\nif (!Array.isArray(probe.segments)) {\n  verboseJsonNotSupported.value = true\n  // disable the confidence filter for this provider\n}","typeGuard":"interface SegmentedTranscription {\n  segments?: Array<{ text: string, avg_logprob?: number }>\n}\nfunction hasVerboseSegments(r: SegmentedTranscription): r is SegmentedTranscription & { segments: NonNullable<SegmentedTranscription['segments']> } {\n  return Array.isArray(r.segments) && r.segments.length > 0\n}","tryCatchPattern":null,"preventionTips":["Probe provider verbose_json support once at setup and cache the result (verboseJsonNotSupported)","Surface filter inactivity in the UI instead of relying on the console warn","Keep the normalizeGeneratedTranscriptionText fallback wired so text is never lost"],"tags":["whisper","transcription","verbose-json","response-format","confidence-filter"],"backgroundTag":"verbose-json-segments-missing","analyzedSha":"f679616c34f1cf6d282c8d64264242af944b3fed","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}