@oh-my-pi/pi-catalog 18.12.0 → 18.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.12.1] - 2026-10-17
6
+
7
+ ### Fixed
8
+
9
+ - Anthropic's `request-encoding-rejection` now also matches the API's "request body is not valid JSON" 400, which a gzip body gets when a proxy drops its `Content-Encoding` header ([#16108](https://github.com/can1357/oh-my-pi/pull/16108) by [@alphastorm](https://github.com/alphastorm))
10
+
5
11
  ## [18.12.0] - 2026-10-17
6
12
 
7
13
  ### Added
@@ -6,8 +6,10 @@ export interface RequestCompressionPolicy {
6
6
  /** Accepted encodings, most preferred first. */
7
7
  readonly encodings: readonly RequestBodyEncoding[];
8
8
  /**
9
- * Error-body pattern of a 400/415 that rejects the encoding; `undefined`
10
- * treats every 400/415 as a possible rejection.
9
+ * Pattern of a JSON 400/415 error body that rejects the encoding;
10
+ * `undefined` treats every JSON 400/415 as a possible rejection. A
11
+ * 400/403/415 whose body is not JSON (presumed a proxy's answer, not the
12
+ * host's) is a possible rejection either way.
11
13
  */
12
14
  readonly rejection: RegExp | undefined;
13
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-catalog",
3
- "version": "18.12.0",
3
+ "version": "18.12.1",
4
4
  "description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
5
5
  "keywords": [
6
6
  "ai",
@@ -93,12 +93,12 @@
93
93
  "gen:proto": "bun scripts/generate-protocols.ts"
94
94
  },
95
95
  "dependencies": {
96
- "@oh-my-pi/omptype": "18.12.0",
97
- "@oh-my-pi/pi-utils": "18.12.0"
96
+ "@oh-my-pi/omptype": "18.12.1",
97
+ "@oh-my-pi/pi-utils": "18.12.1"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@bgotink/kdl": "0.4.0",
101
- "@oh-my-pi/pi-ai": "18.12.0",
101
+ "@oh-my-pi/pi-ai": "18.12.1",
102
102
  "@types/bun": "^1.3.14"
103
103
  },
104
104
  "engines": {
@@ -513,9 +513,11 @@ export const AXES: Readonly<Record<string, AxisDef>> = {
513
513
  */
514
514
  "endpoint-hosts": { key: "endpointHosts", set: "catalog", shape: "array" },
515
515
  /**
516
- * Pattern of the 400/415 error body the host returns when it cannot decode
517
- * a compressed request body. Unassigned: every 400/415 is a possible
518
- * rejection and is re-checked with an uncompressed resend.
516
+ * Pattern of the JSON 400/415 error body the host returns when it cannot
517
+ * decode a compressed request body. Unassigned: every JSON 400/415 is a
518
+ * possible rejection and is re-checked with an uncompressed resend. Either
519
+ * way, a 400/403/415 whose body is not JSON (presumed a proxy's answer, not
520
+ * the host's) is re-checked too.
519
521
  */
520
522
  "request-encoding-rejection": { key: "requestEncodingRejection", set: "catalog", shape: "scalar" },
521
523
  /**
@@ -10,8 +10,10 @@ export interface RequestCompressionPolicy {
10
10
  /** Accepted encodings, most preferred first. */
11
11
  readonly encodings: readonly RequestBodyEncoding[];
12
12
  /**
13
- * Error-body pattern of a 400/415 that rejects the encoding; `undefined`
14
- * treats every 400/415 as a possible rejection.
13
+ * Pattern of a JSON 400/415 error body that rejects the encoding;
14
+ * `undefined` treats every JSON 400/415 as a possible rejection. A
15
+ * 400/403/415 whose body is not JSON (presumed a proxy's answer, not the
16
+ * host's) is a possible rejection either way.
15
17
  */
16
18
  readonly rejection: RegExp | undefined;
17
19
  }
@@ -231,7 +231,7 @@ One object axis carries a computed form: `long-context-cost` accepts either the
231
231
 
232
232
  `endpoint-hosts` lists the HTTPS hostnames a provider serves besides its bundled base URL's host, such as Copilot's per-plan `api.<plan>.githubcopilot.com` hosts. That host plus these define the provider's own endpoint (`isCatalogEndpointUrl`), which separates first-party traffic from a custom model or provider override that keeps a catalog provider id but points `baseUrl` at a gateway, proxy, or local server. Connection prewarming and request compression act only on the provider's own endpoint.
233
233
 
234
- `request-encodings` lists the `Content-Encoding`s (`zstd`, `gzip`) a provider's own endpoint decodes on request bodies, most preferred first; pi-ai's `wrapFetchForRequestCompression` reads them through `resolveRequestCompression` and compresses bodies of 1 KiB or more. A proxy, relay, or `ANTHROPIC_BASE_URL` reroute never receives bytes it cannot read. `request-encoding-rejection` is a regular expression for the 400/415 error body the host returns when it cannot decode the body; unassigned, every 400/415 is re-checked with an uncompressed resend. A rejected encoding is dropped for that host only after the uncompressed resend succeeds. Assign them only from a live probe of every endpoint host: a compressed body, the same plain JSON mislabeled as compressed (a decoding host must reject it), and a real request.
234
+ `request-encodings` lists the `Content-Encoding`s (`zstd`, `gzip`) a provider's own endpoint decodes on request bodies, most preferred first; pi-ai's `wrapFetchForRequestCompression` reads them through `resolveRequestCompression` and compresses bodies of 1 KiB or more. A proxy, relay, or `ANTHROPIC_BASE_URL` reroute never receives bytes it cannot read. `request-encoding-rejection` is a regular expression for the JSON 400/415 error body the host returns when it cannot decode the body; unassigned, every JSON 400/415 is re-checked with an uncompressed resend. A 400/403/415 whose body is not JSON (empty included) is presumed to come from a proxy in front of the host, such as a TLS-inspecting gateway that refuses compressed uploads, and is re-checked either way, until the uncompressed resend draws the same status from that host. A rejected encoding is dropped for that host only after the uncompressed resend succeeds. Assign them only from a live probe of every endpoint host: a compressed body, the same plain JSON mislabeled as compressed (a decoding host must reject it), and a real request.
235
235
 
236
236
  `judgment-questions-max` is the most questions one System One judgment request may carry (razorback16/openjev: 256; Cloudflare Clef on Workers AI and through OpenRouter Decisions: 64; unidentified `*openjev*` deployments: 16). The coding agent reads it through `resolveJudgmentQuestionsMax` and `NativeJudge` splits larger requests into parallel chunks; unassigned means the endpoint takes any batch size. [`providers/judgment-questions.kdl`](providers/judgment-questions.kdl) lists the servers verified uncapped or not isolatable.
237
237
 
@@ -93,9 +93,11 @@ provider "anthropic" {
93
93
  image-count-budget 90
94
94
  official-image-count-budget 600
95
95
  // The Messages API decodes gzip request bodies and rejects zstd and br
96
- // with a 400 (`request_body_encoding_invalid`).
96
+ // with a 400 (`request_body_encoding_invalid`). Gzip bytes that arrive
97
+ // without their `Content-Encoding` (a proxy dropped the header) get a 400
98
+ // "The request body is not valid JSON" (live, 2026-10-17).
97
99
  request-encodings "gzip"
98
- request-encoding-rejection "request_body_encoding_invalid|Unsupported Content-Encoding"
100
+ request-encoding-rejection "request_body_encoding_invalid|Unsupported Content-Encoding|request body is not valid JSON"
99
101
  class "anthropic" {
100
102
  revision "<4.6" {
101
103
  official-image-count-budget 100