Repository navigation
feat(api): support Grok subscription image generation - #15423
Merged
diegosouzapw merged 7 commits intoOct 7, 2026
Merged
diegosouzapw merged 7 commits into
diegosouzapw merged 7 commits into
Conversation
Register the xai-oauth and grok-cli image routes, and remap OpenAI quality high/hd, only when GROK_SUBSCRIPTION_IMAGES_ENABLED is true. While the flag is off, the API-key xAI image path stays on the existing request. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw
merged commit Oct 7, 2026
4e1f541
into
cheaper-inference:release/v3.8.52
7 of 9 checks passed
diegosouzapw
added a commit
that referenced
this pull request
Oct 7, 2026
Records the Onda B quality drift on the post-squash tip `9214916a`. Product squashes do not carry the baseline.
File-size ceilings inside `frozen`, measured with `split("\n").length`:
- `browser-worker.ts` 4398 → 4467 (#15615)
- `EndpointPageClient.tsx` 2493 → 2531 (#15565)
- `SystemStorageTab.tsx` 1611 → 1619 (#15565)
- `imageGeneration.ts` 3346 → 3377 (#15423, #15513)
- `catalog.ts` 2127 → 2130 (#15701)
- `auth.ts` 3666 → 3668 (#15624)
`node scripts/check/check-file-size.mjs` passed. The legacy string map was not edited.
⚠️ base-red inherited: #15306
This was referenced Oct 8, 2026
Merged
diegosouzapw
added a commit
that referenced
this pull request
Oct 8, 2026
Drains 9 v3.8.52 tip unit reds: 3 production defects — MCP bundle startup deadlock (async ESM init cycle from #13739; lazy-load cleanModelName), client bundles pulling server-only DB via imageRegistry→featureFlags (#15423; dependency-free resolver bridge, DB override preserved, default OFF), zh-CN/zh-TW glossary violations (#15138/#15092) — plus regenerated route namespaces, env-isolated guide-settings test, auth-test alignments that keep (and tighten to count=2) the loopback/management guards, quota-card guard following #15138 redesign, and stryker listing of 2 tip covering tests. Combined-board validation with #15903: 327/329 on the previously red files, typechecks, lint, 22 gates.
Abhijeet1520
added a commit
to Abhijeet1520/OmniRoute
that referenced
this pull request
Oct 18, 2026
cheaper-inference#15423 statically imported isFeatureFlagEnabled into imageRegistry, which is reachable from "use client" pages via mediaServiceKinds (the cheaper-inference#10692 invariant). That dragged featureFlags → db/core → the server-only graph into the browser bundle, failing production builds with ~175 Module not found: 'fs'/'async_hooks'/'child_process' errors (same class as cheaper-inference#13474). The repo's own guard (client-bundle-no-server-only-10692.test.ts) fails on the current tip. Dependency inversion, matching the dynamicImageModelSources pattern: - imageRegistry exports a resolver seam; unregistered (client bundle) falls back to the env var only - registerNodejs() installs the real DB+env reader at server boot Validated: guard test 4/4 green, grok/xai image tests 6/6 green, image-generation-route tests 30/30 green, typecheck-core clean, dashboard typecheck baseline unchanged (0 new errors). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Oct 18, 2026
Merged
diegosouzapw
added a commit
to Kizuno18/OmniRoute
that referenced
this pull request
Oct 27, 2026
…ABLED Owner decision for cheaper-inference#15305 (option a): the grok-cli image provider joins the other Grok subscription image routes behind the opt-in flag instead of being always on. - Drop the always-on grok-cli entry from IMAGE_PROVIDERS; the Grok Build provider now lives only in XAI_SUBSCRIPTION_IMAGE_PROVIDERS, so with the flag off gc/ is not an image provider (grok-subscription-images-flag-off keeps passing). - Build the Grok Build image body with the same buildXaiImageRequest the xAI routes use (cheaper-inference#15423): native aspect_ratio/resolution, size mapping, Image 2.0 quality and Zod validation stay identical; only the host, the CLI token-auth header and the token source differ. - Tests: grok-oauth-media runs with the flag on and checks the catalog split; image-generation-route expects the Grok Build proxy for grok-cli (xai-oauth and xai keep api.x.ai); video-job-abort warms the call-log recorder the tip added so the abort-latency check measures the abort. - Docs: grok-cli-media and GROK_IMAGES describe the opt-in and the transport difference; the changelog fragment says images are opt-in. Co-authored-by: Kizuno18 <appdoleo@gmail.com>
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
Grok subscription OAuth connections previously could not resolve image models through
/v1/images/generations. Register Grok Imagine Image 2.0 and the existing Imagine models forgrok-cli/gcandxai-oauth/xao, and add Image 2.0 to xAI API-key connections. Requests reuse the existing OAuth refresh, persistence and account-selection path and dispatch to the xAI image endpoint.Translate OpenAI pixel sizes into xAI aspect ratio/resolution, preserve explicit native options, map
high/hdtomediumandstandardtolow, and validate options before dispatch. Older Imagine models reject the unsupported quality option. Document the callable model IDs and request contract.Validation
npm run test:vitest: 54 files / 493 tests passednpm run typecheck:corenpm run lint(full repository) and ESLint on all changed TypeScript filesnode scripts/check/check-api-typecheck.mjs(new diagnostic fixed; existing baseline preserved)npm run check:provider-consistencyandnpm run check:provider-assetsprovider-translate-path-golden.test.ts: 2 passed / 1 failed on macOS; the only snapshot differences are existing Copilotuser-agentplatform strings (linuxversusdarwin). This PR does not change the chat provider builders or their golden snapshot.npm run check:docs-allnpm run test:unitwas started and stopped after failures outside the image change. A separate run on unmodified company main (48bcfc9556) reproduced failures in stream-chunk lifecycle, early keepalive logging, Claude cooldown escalation and relay error handling (25 passed / 6 failed). These files and their implementation are unchanged by this PR.docs/architecture/QUALITY_GATES.md, and generatedomni-providersskill drift (unchanged generator inputs). The feature guide is a separate document; the API reference translation drift introduced by the initial draft was removed.Tests Added Or Updated
tests/unit/image-xai-subscription.test.ts: provider aliases/catalog, native options, size and quality mapping, invalid inputs and legacy model behavior.tests/unit/image-generation-route.test.ts: API-key and both OAuth providers, catalog visibility, token refresh persistence and validation before upstream dispatch.Coverage Notes
The new adapter's branches are exercised by deterministic payload tests; route tests cover credential selection, actual dispatch and persisted token rotation. No credentials or generated media are included in this change.
Reviewer Notes
Before implementation, a live subscription OAuth call to
https://api.x.ai/v1/images/generationswithgrok-imagine-image-2.0,aspect_ratio: "3:2",resolution: "1k",quality: "medium"andresponse_format: "b64_json"returned HTTP 200 and an image. Entitlements and quota remain upstream-controlled.Provider contract: https://docs.x.ai/developers/model-capabilities/images/generation