-
Notifications
You must be signed in to change notification settings - Fork 957
feat(images): relay Codex image_gen to xAI Imagine with Grok OAuth (carry of #2083) #2986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2fe7abd
feat(images): relay Codex image_gen to xAI Imagine with Grok OAuth
zhou-zhichao b36e808
fix(images): bound xAI relay timeout and reject empty edits
zhou-zhichao 48b47e2
fix(images): cap xAI relay output across the full batch
zhou-zhichao f8f0081
fix(images): harden xAI relay identity, redirects, and URL fetches
zhou-zhichao e851f16
fix(images): close reverse image_gen identity and sanitize xAI errors
zhou-zhichao f96f90b
fix(images): match CCA inline validation and OAuth relay coverage
zhou-zhichao 02c3cd0
fix(images): honor explicit images.provider and validate URL payloads
zhou-zhichao d1a4f42
fix(images): fail closed when Imagine OAuth is missing
zhou-zhichao b7ad882
fix(images): close Auto ratio, root image_gen collapse, and default d…
lidge-jun 2b79a02
docs(images): state the xAI relay credential mode, provider precedenc…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
devlog/_plan/260902_nonbug_adoption_backlog/050_wp5_xai_imagine_carry.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # wp5 — PR #2986 xAI Imagine image_gen relay (carry of #2083) | ||
|
|
||
| State at entry: head `842170b6f`, 25 files +1175/-64, exact-head CI fully green, rebased cleanly onto | ||
| `origin/dev` (`6a6efa928`) as `codex/carry-2083-xai-imagine-2` (`b7ad8820c`) with no conflicts. | ||
| Reviewer (Ingwannu) confirmed all three code blockers resolved at `842170b6f` and left two | ||
| documentation-boundary items before approval. No code redesign requested. | ||
|
|
||
| ## Scope (docs only) | ||
|
|
||
| 1. `docs-site/src/content/docs/guides/codex-integration.md` — xAI Imagine relay bullet: | ||
| - state that the Grok grant is used only when the `xai` provider has `authMode: "oauth"` | ||
| (`resolveXaiImageAuthToken` in `src/images/plan.ts`); any other authMode uses the API key. | ||
| - state that an explicit `images.provider` owns `/v1/images` and prevents the xAI fallback. | ||
| - result URL contract beside the 100 MiB cap: public HTTPS only, no redirects, no file/loopback, | ||
| bounded download (`MAX_DOWNLOAD_BYTES` 50 MiB per file), artifacts served through the | ||
| authenticated management endpoint. | ||
| 2. Same factual sentences in the locale copies of the same bullet (ja/ko/zh-cn/zh-tw/ru/fr/tr) where | ||
| the bullet exists, so a translation does not contradict English. | ||
| 3. Resolve the now-fixed `maxBytes` review thread. | ||
|
|
||
| ## Acceptance | ||
|
|
||
| - English bullet contains: authMode oauth condition, explicit images.provider precedence, URL contract. | ||
| - Locales that carry the bullet do not contradict it. | ||
| - `bun x tsc --noEmit` and `bun run privacy:scan` clean; focused `tests/server-images.test.ts`, | ||
| `tests/responses-parser.test.ts` green (unchanged code, sanity). | ||
| - Push `--no-verify` to the same PR branch (force since rebased), admin squash merge, landing proof, close #2083 | ||
| as landed-via-carry. | ||
|
|
13 changes: 13 additions & 0 deletions
13
devlog/_plan/260902_nonbug_adoption_backlog/051_wp5_audit_r1_synthesis.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # wp5 audit r1 — synthesis | ||
|
|
||
| Audit input is the maintainer-reviewer's incremental review of exact head `842170b6f` (Ingwannu, | ||
| 2026-08-31): all three code blockers resolved, focused regressions meaningful, exact-head CI and the | ||
| service lifecycle matrix green. Residual: two documentation-boundary items and one review thread to | ||
| resolve. Verdict carried as **near-pass**; residuals are the whole of the B scope in 050. | ||
|
|
||
| Source verification for the doc sentences (read in this worktree): | ||
| - `src/images/plan.ts` `resolveXaiImageAuthToken`: Grok grant only when `authMode === "oauth"`, else API key. | ||
| - `src/images/artifacts.ts`: HTTPS-only (`:278`, `:313`), `redirect: "manual"` with 3xx rejected | ||
| (`xai-client.ts:124-128`), `MAX_DOWNLOAD_BYTES` 50 MiB default (`:14`, `:281`, `:327`). | ||
| - Image-bridge precedence sentence already present and correct; mirror it into codex-integration. | ||
|
|
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.