Skip to content

refactor!: replace ModelRequestError with RerankRequestError - #9

Merged
TheGreatAxios merged 1 commit into
cl-9157-reranking-move-intx-to-peerdependenciesfrom
cl-9147-reranking-replace-copied-transport-and-modelrequesterror
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9157-reranking-move-intx-to-peerdependenciesfrom
cl-9147-reranking-replace-copied-transport-and-modelrequesterror

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds RerankRequestError extends Error with reason: InferenceError and url, exported from the barrel; ModelRequestError is deleted.
  • Reasons come from @intx/inference classifiers; retries use createDefaultRetryPolicy.
  • Adapters throw ProtocolMismatchError on malformed replies (the ResponseParser contract), which rerankDocuments wraps as a protocol_mismatch RerankRequestError. Out-of-range indices raise the same.
  • Config errors, including a missing Cohere/Voyage model, throw arktype's TraversalError via .assert.
  • The request helper and Retry-After extractor are no longer exported. The transport itself is still a copy of the one in @corbits/embedding; an XXX note in src/request.ts records that and the upstream blocker.

Verification

  • bun install --frozen-lockfile, bunx tsc --noEmit, bun test ./src, bunx prettier --check ., bun run build pass.

Closes CL-9147
Closes CL-9153

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review: diff checked against ticket outcomes; independent critique pass run, findings on README wording, registry example and CONTRIBUTING commands fixed. Typecheck, tests, prettier and build pass.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9147-reranking-replace-copied-transport-and-modelrequesterror branch from 856bdfb to a548268 Compare September 25, 2026 14:16
@TheGreatAxios
TheGreatAxios changed the base branch from main to cl-9157-reranking-move-intx-to-peerdependencies September 25, 2026 14:16
@TheGreatAxios
TheGreatAxios force-pushed the cl-9147-reranking-replace-copied-transport-and-modelrequesterror branch from a548268 to a2109cd Compare September 25, 2026 17:32
@TheGreatAxios TheGreatAxios changed the title Replace ModelRequestError with RerankRequestError Rename ModelRequestError to RerankRequestError and hide the transport Sep 25, 2026
@TheGreatAxios
TheGreatAxios force-pushed the cl-9147-reranking-replace-copied-transport-and-modelrequesterror branch from a2109cd to d597e95 Compare September 26, 2026 01:30
Failures now raise RerankRequestError, carrying the classified
InferenceError as reason plus the request URL. Malformed replies and
out-of-range indices classify as protocol_mismatch through the same
class; adapters signal them with ProtocolMismatchError per the
@intx/inference parser contract. Config errors, including a missing
model for cohere and voyage, throw arktype's TraversalError.

The JSON request helper and its Retry-After extractor are no longer
exported from the package.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9147-reranking-replace-copied-transport-and-modelrequesterror branch from d597e95 to a9aa3d8 Compare September 26, 2026 01:30
@TheGreatAxios TheGreatAxios changed the title Rename ModelRequestError to RerankRequestError and hide the transport refactor!: replace ModelRequestError with RerankRequestError Sep 26, 2026
@TheGreatAxios
TheGreatAxios added this pull request to stack #15 September 26, 2026 01:59
@TheGreatAxios
TheGreatAxios merged commit ef0fab5 into main Sep 27, 2026
1 check passed
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