feat(providers): derive imageToText from the OCR registry + chutes dots.ocr seed - #10400
Merged
Conversation
The test's own title ("returns a sanitized 500") describes the new
behavior mandated by HR#12 (never leak err.message in a response body).
The old regex asserted the pre-sanitization leak (`OCR request failed:
socket closed`) as expected output, which contradicted its own title
and the sanitization this task intentionally introduced in
open-sse/handlers/ocr.ts. Scoped to this single assertion only.
pollOcrOperation now checks pollRes.ok and returns a sanitized 502 immediately (logging the upstream status via console.error) instead of looping until the 30-attempt cap and surfacing a misleading timeout for what was actually an auth/upstream error during polling.
- Route: map the connection's providerSpecificData.baseUrl onto credentials.baseUrl (resolveOcrCredentials) so azure-document-intelligence connections resolve their endpoint the same way every other custom-endpoint provider does (src/lib/providers/validation/*); previously handleOcr only saw a baseUrl when a caller set it directly, so the DB-backed Azure connection endpoint was never forwarded. - v1OcrSchema.model is already a free-form string, no schema change needed. - Docs: add the /v1/ocr provider table + example + Azure poll-flow note to API_REFERENCE.md, and describe the provider/model prefix + async poll behavior in openapi.yaml. - Test: tests/unit/ocr-route-contract.test.ts covers getAllOcrModels/ parseOcrModel for both providers and resolveOcrCredentials's mapping.
…totext-derivation
…iceKinds Same rebaseline as #10275 (frozen 1250 -> 1252): this branch adds the chutes serviceKinds declaration, the second of the two data lines.
…totext-derivation
…totext-derivation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR-D (final) of the OCR/image-to-text migration series (plan:
_tasks/superpowers/plans/2026-08-13-ocr-image-to-text-migration.md; heuristic pattern from aisbf, implemented in this repo's registry-derived style).(Replaces #10291, which GitHub auto-closed when #10283 merged with
--delete-branchand removed its base branch. Same commits, now targeting the release directly — #10283 is merged, so the azure-document-intelligence provider the derivation test covers is on the base.)imageToTextderived from the OCR registry (open-sse/config/mediaServiceKinds.ts): any provider registered inOCR_PROVIDERSnow resolves theimageToTextserviceKind automatically —mistralandazure-document-intelligenceappear in/dashboard/media-providers/imageToTextwith no manual catalog edit, and future OCR providers surface on registration (no drift). Complements feat(providers): declare imageToText serviceKind on major vision providers #10275, which declares the kind on the 7 major vision LLM providers.serviceKinds: ["llm", "imageToText"]on thechutesgateway entry (hostsrednote-hilab/dots.ocr— cheap OCR-specialized model, 131k ctx; arrives via model discovery since chutes ispassthroughModels: true, so no static registry entry)."llm"declared alongside for the same ProviderCard reason as feat(providers): declare imageToText serviceKind on major vision providers #10275.Validation (TDD)
imagetotext-derivation3/3: mistral + azure derive withdeclared: undefined; groq withundefineddoes NOT (isolates derivation from feat(providers): declare imageToText serviceKind on major vision providers #10275's declarations); chutes resolves bothimageToTextandllm.provider-service-kind-filter-4240,minimax-media-servicekinds(16 total).check:provider-consistencyOK (259 registry entries, 339 canonical providers) ·typecheck:core0 · eslint/prettier clean.serviceKindIndex.tsmemoization verified safe: derivation is a pure function ofproviderIdover the constantOCR_PROVIDERSmap.