Skip to content

refactor(handlers): thorough modularization of imageGeneration.ts (#3594)#4706

Closed
oyi77 wants to merge 46 commits into
diegosouzapw:release/v3.8.35from
oyi77:fix/modularize-image-gen-thorough
Closed

refactor(handlers): thorough modularization of imageGeneration.ts (#3594)#4706
oyi77 wants to merge 46 commits into
diegosouzapw:release/v3.8.35from
oyi77:fix/modularize-image-gen-thorough

Conversation

@oyi77

@oyi77 oyi77 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Recreation of #4407 rebased onto release/v3.8.34. Complete extraction of 3776-line handler into 25 modules (vs #4609's 9 modules). All CI gates pass. Supersedes #4609 and #4703. Part of #3594.

Diego Rodrigues de Sa e Souza and others added 30 commits June 22, 2026 04:35
…C+D) (diegosouzapw#4622)

C — scripts/quality/validate-release-green.mjs (npm run check:release-green):
reproduces the release-equivalent validation (typecheck, eslint, db-rules,
public-creds, full unit, vitest, ratchets, optional --with-build package-artifact)
against the current working tree and classifies each red as HARD (real defect,
exit 1) vs DRIFT (ratchet — reported, never affects exit / never blocks). Pure
helpers exported + orchestration behind a direct-run guard; unit-tested.

D — .github/workflows/nightly-release-green.yml: runs C on the active release
branch nightly (and on workflow_dispatch) and opens/updates a single tracking
issue on HARD failures. Never a required check, never touches a contributor PR.

Closes the gap where the full gate (ci.yml) only ran on the release PR, so reds
accrued silently on release/** and surfaced in 40-min layers at release time.
Non-blocking by construction; drift is the maintainer's to rebaseline at release.

Co-authored-by: Diego Rodrigues de Sa e Souza <diego.souza@cdwasolutions.com.br>
…9router#951) (diegosouzapw#4566)

Integrated into release/v3.8.34 (rebuilt onto tip)
…ect fails (diegosouzapw#4562)

Integrated into release/v3.8.34 (rebuilt onto tip)
)

Integrated into release/v3.8.34 (rebuilt onto tip)
Integrated into release/v3.8.34 (rebuilt onto tip)
…w#4588)

Integrated into release/v3.8.34 (rebuilt — bundled commits stripped)
Integrated into release/v3.8.34 (rebuilt — bundled commits stripped)
…pw#4590)

Integrated into release/v3.8.34 (rebuilt — bundled commits stripped)
…s=0 (diegosouzapw#4615)

Integrated into release/v3.8.34 (rebuilt onto tip)
…ouzapw#4525)

Integrated into release/v3.8.34 (rebuilt — kept only the prefix rename, dropped stale-base reverts)
Integrated into release/v3.8.34 (rebuilt onto tip; merge before diegosouzapw#4612)
Integrated into release/v3.8.34 (rebuilt + reconciled with diegosouzapw#4593)
…e 3) (diegosouzapw#4645)

* docs(compression): Phase 3 per-request header design spec

Approved brainstorming output for the x-omniroute-compression header:
header-first precedence, name-first combo matching (Decision A), explicit
value bypasses auto-trigger (Decision B), DerivedPlan.source, and the
X-OmniRoute-Compression response header.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(compression): Phase 3 per-request header implementation plan

4-task TDD plan (resolver header-first + source, parser, chatCore wiring +
response header, docs/file-size) with full code and exact commands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(compression): header-first resolver + plan source (Phase 3 core)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(compression): resolveCompressionHeader parser (Phase 3)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(compression): wire x-omniroute-compression header + response header (Phase 3)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(compression): extract plan-resolution leaf (planResolution.ts) under size cap (Phase 3)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(compression): document x-omniroute-compression header (Phase 3)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(compression): harden named-combo map + trim engine: header id (Phase 3 review)

Addresses gemini-code-assist review on diegosouzapw#4645:
- Extract buildNamedComboLookup (pure) so a blank/whitespace/null combo name
  contributes only its id key (no '' key, no throw that disables all combos).
- Trim the engine:<id> header value so 'engine: rtk' resolves.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Diego Rodrigues de Sa e Souza <diego.souza@cdwasolutions.com.br>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Diego Rodrigues de Sa e Souza <souzamiriamrodrigues790@gmail.com>
Integrated into release/v3.8.34 (rebuilt + opt-in gate fix)
Integrated into release/v3.8.34 (rebuilt + test added)
Integrated into release/v3.8.34 (rebuilt + jsdom test)
…diegosouzapw#4563)

Integrated into release/v3.8.34 (rebuilt onto tip; UI-cosmetic per owner)
…(extracted from diegosouzapw#4428) (diegosouzapw#4691)

Integrated into release/v3.8.34 (cleanup core extracted from diegosouzapw#4428, credit @oyi77)
diegosouzapw and others added 15 commits June 22, 2026 17:57
… unreachable (diegosouzapw#4604) (diegosouzapw#4687)

Co-authored-by: Diego Rodrigues de Sa e Souza <souzamiriamrodrigues790@gmail.com>
diegosouzapw#4674) (diegosouzapw#4677)

Co-authored-by: Diego Rodrigues de Sa e Souza <souzamiriamrodrigues790@gmail.com>
…gosouzapw#4638)

Integrated into release/v3.8.34 (authored by Rahul Sharma, AI co-author trailer stripped per project policy)
…cher (diegosouzapw#4580) (diegosouzapw#4684)

Co-authored-by: Diego Rodrigues de Sa e Souza <souzamiriamrodrigues790@gmail.com>
…sh + best-free template (diegosouzapw#4621)

Integrated into release/v3.8.34 (dead getFirstRegistryModelId dropped, rebuilt onto tip)
) (diegosouzapw#4618)

Integrated into release/v3.8.34 (adapted onto diegosouzapw#4606's extracted topology section: default-hidden flip + enabled gate on useLiveDashboard)
…egosouzapw#4597) (diegosouzapw#4619)

Integrated into release/v3.8.34 (data-dir.mjs refactor reconciled with diegosouzapw#4607; loadEnvFile aligned to getDefaultDataDir)
…#4642)

Integrated into release/v3.8.34 (Ollama Cloud + OpenCode Go dashboard quota scraping; rebuilt onto tip, gates green: typecheck/public-creds/file-size/lint/docs-sync + 31 tests)
…o 25 modules (diegosouzapw#3594)

Complete extraction of the 3776-line imageGeneration handler:
- imageGeneration/core.ts — main handler orchestration
- imageGeneration/openai.ts — OpenAI/DALL-E provider
- imageGeneration/chatgptWeb.ts — ChatGPT web provider
- imageGeneration/blackForestLabs.ts — BFL provider
- imageGeneration/codex.ts — Codex provider
- imageGeneration/gemini.ts — Gemini provider
- imageGeneration/imagen3.ts — Imagen 3 provider
- imageGeneration/kie.ts — Kie provider
- imageGeneration/stability.ts — Stability provider
- imageGeneration/fal.ts — Fal provider
- imageGeneration/specialty/* — specialty providers (8 files)
- imageGeneration/logging.ts — logging utilities
- imageGeneration/utils.ts — general utilities
- imageGeneration/index.ts — re-exports

Pure extraction, no behavioral changes. Supersedes diegosouzapw#4609/diegosouzapw#4703. Part of diegosouzapw#3594.
@oyi77 oyi77 requested a review from diegosouzapw as a code owner June 22, 2026 22:42
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@diegosouzapw diegosouzapw changed the base branch from release/v3.8.34 to release/v3.8.35 June 23, 2026 06:48
@oyi77

oyi77 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing — v3.8.35 already extracted imageGeneration provider handlers (PR #4582 batch). This PR is now obsolete.

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.