Skip to content

refactor: modularize 2.5K-line schemas.ts (Issue #3594) - #3655

Closed
oyi77 wants to merge 32 commits into
diegosouzapw:release/v3.8.24from
oyi77:refactor/modularize-schemas
Closed

oyi77 wants to merge 32 commits into
diegosouzapw:release/v3.8.24from
oyi77:refactor/modularize-schemas

Conversation

@oyi77

@oyi77 oyi77 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the final "Medium Priority" file from Issue #3594 by modularizing `src/shared/validation/schemas.ts` (2,506 lines).

The monolithic schema file has been split into 16 clean domain-focused files under `src/shared/validation/schemas/`, while maintaining backward compatibility with a 1-line facade re-exporting the modules in `src/shared/validation/schemas.ts`.

Changes:

  • Extracted domain schemas into `auth.ts`, `combo.ts`, `keys.ts`, `settings.ts`, `pricing.ts`, `proxy.ts`, `provider.ts`, `payloadRules.ts`, `routing.ts`, `apiV1.ts`, `gemini.ts`, `cli.ts`, `evals.ts`, `translator.ts`, `cloud.ts`, and `misc.ts`

Fixes #3594

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the validation schemas by splitting the monolithic src/shared/validation/schemas.ts file into multiple modular schema files under a new schemas/ directory. The main schemas.ts file now acts as a barrel file, re-exporting all schemas. Feedback on these changes highlights the need to add or update corresponding unit tests under the tests/ directory to comply with the repository style guide's requirement for testing production code changes. Additionally, several of the newly created schema files contain unused imports from @/shared/constants/... and @/shared/utils/... that should be cleaned up to maintain codebase cleanliness.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/shared/validation/schemas.ts Outdated
});

export type ConfirmedAccount = z.infer<typeof confirmedAccountSchema>;
export * from "./schemas/auth.ts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

According to Rule 9 of the Repository Style Guide, tests must always be included when changing production code under src/. Since this PR refactors and modularizes the schemas, please ensure that corresponding unit tests are added or updated under the tests/ directory to verify the modularized schemas.

References
  1. Always include tests when changing production code (src/, open-sse/, electron/, bin/).

Comment thread src/shared/validation/schemas/auth.ts Outdated
Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

None of the imported constants from @/shared/constants/... or @/shared/utils/... are used in this file. Please remove these unused imports to keep the codebase clean and maintainable.

Comment thread src/shared/validation/schemas/cli.ts Outdated
Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

None of the imported constants from @/shared/constants/... or @/shared/utils/... are used in this file. Please remove these unused imports to keep the codebase clean and maintainable.

Comment thread src/shared/validation/schemas/cloud.ts Outdated
Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

None of the imported constants from @/shared/constants/... or @/shared/utils/... are used in this file. Please remove these unused imports to keep the codebase clean and maintainable.

Comment thread src/shared/validation/schemas/evals.ts Outdated
Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

None of the imported constants from @/shared/constants/... or @/shared/utils/... are used in this file. Please remove these unused imports to keep the codebase clean and maintainable.

Comment thread src/shared/validation/schemas/apiV1.ts Outdated
Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Only SUPPORTED_BATCH_ENDPOINTS is used in this file. Please remove the other unused imports to keep the codebase clean and maintainable.

import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";

Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Only ROUTING_STRATEGY_VALUES and MAX_TIMER_TIMEOUT_MS are used in this file. Please remove the other unused imports to keep the codebase clean and maintainable.

import { ROUTING_STRATEGY_VALUES } from "@/shared/constants/routingStrategies";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Comment thread src/shared/validation/schemas/misc.ts Outdated
Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Only isForbiddenUpstreamHeaderName and isForbiddenCustomHeaderName are used in this file. Please remove the other unused imports to keep the codebase clean and maintainable.

Suggested change
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";

Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Only providerAllowsOptionalApiKey is used in this file. Please remove the other unused imports to keep the codebase clean and maintainable.

import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";

Comment on lines +2 to +15
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Only ACCOUNT_FALLBACK_STRATEGY_VALUES, MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB, COMBO_CONFIG_MODES, and HIDEABLE_SIDEBAR_ITEM_IDS are used in this file. Please remove the other unused imports to keep the codebase clean and maintainable.

Suggested change
import {
ACCOUNT_FALLBACK_STRATEGY_VALUES,
ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { providerAllowsOptionalApiKey } from "@/shared/constants/providers";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";
import {
isForbiddenUpstreamHeaderName,
isForbiddenCustomHeaderName,
} from "@/shared/constants/upstreamHeaders";
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";
import { ACCOUNT_FALLBACK_STRATEGY_VALUES } from "@/shared/constants/routingStrategies";
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
import { HIDEABLE_SIDEBAR_ITEM_IDS } from "@/shared/constants/sidebarVisibility";

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.23 June 12, 2026 01:18
zhiru and others added 25 commits June 12, 2026 02:40
…osouzapw#3685) (diegosouzapw#3702)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…API (diegosouzapw#3712)

Integrated into release/v3.8.23. Vertex dynamic model discovery — surfaces image models (imagen-*, gemini-*-image), embeddings and audio from the live Generative Language catalog, with cached→static fallback and the shared parseGeminiModelsList helper. Validated: parser test 5/5, typecheck:core clean.
Integrated into release/v3.8.23. Makes the diegosouzapw#3588 reasoning token buffer safe and configurable: only inflates max_tokens when the model has a known, non-default output cap and the buffered value fits inside it; otherwise preserves/clamps the client limit. Adds the reasoningTokenBufferEnabled kill switch (default ON). Validated: combo-routing-engine 81/81, combo-config 25/25, combo-quality-validator-reasoning 12/12, phase1f 10/10, typecheck:core clean.
…3408 LOC (-654) (diegosouzapw#3717)

Phase 1g-1j of diegosouzapw#3501: client 4062→3408 LOC. Pure extraction (ProviderPlaygroundPanel, useCommandCodeAuth, useExternalLinkFlow+ExternalLinkModal, useAuthFileHandlers) + loadConnProxies ReferenceError fix + phase1f test path fix.

Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
…2553 LOC (-855) (diegosouzapw#3721)

Phase 1k-1m of diegosouzapw#3501: client 3408→2553 LOC. Pure extraction (useModelImportHandlers+ImportProgressModal, useModelVisibilityHandlers, ProviderModelsSection).

Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
… release branch

The fix itself reached main pre-tag via cherry-pick diegosouzapw#3591, but its changelog
bullet (commit e33fdd4) only ever existed on release/v3.8.20 after the
squash-merge. Restored under [3.8.20] per the 2026-06-12 release-branch
leftover audit (_tasks/release-audit/release-leftovers-audit-2026-06-12.md).
…1376 LOC (-1177) (diegosouzapw#3725)

Phase 1n-1s of diegosouzapw#3501: client 2553→1376 LOC. Pure extraction (ConnectionsListPanel, ConnectionsHeaderToolbar, ZedImportCard, BatchTestResultsModal, AdaptaTutorialModal, useApiKeySave + helpers).

Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
…cation, and success-decay recovery (diegosouzapw#3629)

Integrated into release/v3.8.23
… LOC (≤800 TARGET REACHED ✅) (diegosouzapw#3727)

Phase 1t of diegosouzapw#3501: client 1376→781 LOC (≤800 reached). Original god-component 12,882→781 (−94%).

Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
…opencode' CLI command (diegosouzapw#3726)

Integrated into release/v3.8.23
… every chatHelpers import

diegosouzapw#3692 added a lazy 'await import(proxyEgress)' for egress-IP visibility inside
safeLogEvents, which is a sync function — an ES syntax error. It went unnoticed
because typecheck:core does not cover src/sse and no test in the merge gates
loaded chatHelpers via tsx; any consumer that did (chat-context-relay and
chat-route-coverage suites, integration harnesses) failed at module load with
'await can only be used inside an async function'.

safeLogEvents is fire-and-forget logging with an outer try/catch, so making it
async (and 'void'-ing the single chat.ts call site) preserves behavior exactly.

Validation: tests/unit/chat-context-relay.test.ts + chat-route-coverage.test.ts
went from failing-at-load to green (+14 tests destravados).
… + combo/proxy audit fixes (diegosouzapw#3699)

Integrated into release/v3.8.23
felipesartori and others added 5 commits June 12, 2026 11:54
- extracted Zod validation schemas into 16 domain files (auth, combo, keys, settings, pricing, proxy, provider, payloadRules, routing, apiV1, gemini, cli, evals, translator, cloud, misc)
- schemas.ts is now a facade re-exporting modules
@oyi77
oyi77 force-pushed the refactor/modularize-schemas branch from b515332 to 0000a71 Compare June 12, 2026 18:47
@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.23 to release/v3.8.24 June 13, 2026 02:52
@kilo-code-bot

kilo-code-bot Bot commented Jun 13, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 14
Issue Details (click to expand)

WARNING

Unused imports in modularized schema files (lines 3-4 of each file):

File Issue
src/shared/validation/schemas/apiV1.ts ACCOUNT_FALLBACK_STRATEGY_VALUES and ROUTING_STRATEGY_VALUES unused
src/shared/validation/schemas/auth.ts Both strategy constants imported but never used
src/shared/validation/schemas/cli.ts Both strategy constants imported but never used
src/shared/validation/schemas/cloud.ts Both strategy constants imported but never used
src/shared/validation/schemas/evals.ts Both strategy constants imported but never used
src/shared/validation/schemas/gemini.ts Both strategy constants imported but never used
src/shared/validation/schemas/keys.ts Both strategy constants imported but never used
src/shared/validation/schemas/misc.ts Both strategy constants imported but never used (header constants ARE used)
src/shared/validation/schemas/payloadRules.ts Both strategy constants imported but never used
src/shared/validation/schemas/pricing.ts Both strategy constants imported but never used
src/shared/validation/schemas/provider.ts ACCOUNT_FALLBACK_STRATEGY_VALUES unused
src/shared/validation/schemas/proxy.ts Both strategy constants imported but never used
src/shared/validation/schemas/routing.ts Both strategy constants imported but never used
src/shared/validation/schemas/translator.ts Both strategy constants imported but never used

Note: combo.ts (line 65) and settings.ts (line 17) correctly use these constants.

Positive Observations
  • Clean refactoring: The 2,506-line monolithic schemas.ts was successfully split into 16 domain-focused modules while maintaining backward compatibility via re-exports.
  • Facade pattern preserved: src/shared/validation/schemas.ts now cleanly re-exports all modules from ./schemas/.
  • Tests added: tests/unit/modular-schemas.test.ts provides basic validation.
Files Reviewed (18 files)
  • src/shared/validation/schemas.ts
  • src/shared/validation/schemas/auth.ts
  • src/shared/validation/schemas/cli.ts
  • src/shared/validation/schemas/cloud.ts
  • src/shared/validation/schemas/combo.ts
  • src/shared/validation/schemas/evals.ts
  • src/shared/validation/schemas/gemini.ts
  • src/shared/validation/schemas/keys.ts
  • src/shared/validation/schemas/misc.ts
  • src/shared/validation/schemas/payloadRules.ts
  • src/shared/validation/schemas/pricing.ts
  • src/shared/validation/schemas/provider.ts
  • src/shared/validation/schemas/proxy.ts
  • src/shared/validation/schemas/routing.ts
  • src/shared/validation/schemas/settings.ts
  • src/shared/validation/schemas/translator.ts
  • tests/unit/modular-schemas.test.ts
  • src/app/(dashboard)/dashboard/providers/[id]/ProviderDetailPageClient.tsx

Reviewed by laguna-m.1-20260312:free · 4,691,792 tokens

@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks @oyi77 for the modularization work on schemas.ts (Issue #3594). I can't merge this as it currently stands — and the reason is structural, not about the quality of the split:

  1. It's a stacked/cumulative chain. This branch carries ~49–55 commits all starting from chore(release): open v3.8.23 development cycle, and the per-PR additions grow monotonically (refactor: modularize providerRegistry.ts (Issue #3594) #3617 ≈ +22k → refactor: modularize 3.1K-line providers.ts constants (Issue #3594) #3646 ≈ +52k). Each refactor branch is built on top of the previous one, so merging any single PR drags in all the earlier refactors too. That makes each PR impossible to review in isolation and guarantees conflicts between them.

  2. The base is stale (v3.8.23 era). Since these were cut, release/v3.8.24 has merged dozens of PRs — including changes to the very files several of these PRs modularize (e.g. providerRegistry.ts grew via fix(providers): correct Ollama Cloud kimi-k2.7-code capabilities (#3761) #3768, validation.ts via fix(providers): repair qwen-web validation + stop mislabeling benign redirects as SSRF (#3288, #3758) #3767, plus combo/stream/usage edits). GitHub now reports this PR as CONFLICTING, and the conflicts are substantial.

What would let this land: re-cut it as a single, independent PR branched from the current release/v3.8.24 tip, modularizing only schemas.ts (not stacked on the other refactors), small enough to review on its own. One file per PR, rebased on current release. I'll gladly review and merge them in that form — the god-file modularization goal is worth it; it's the 14-deep stack on a 2-week-old base that can't go in. Leaving this open so nothing is lost.

@oyi77

oyi77 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Closed in favor of clean re-cut — see #3790 (chatgpt-web), #3788 (stream), #3789 (models route), #3791 (auth), #3792 (schemas). Only modularization commits were cherry-picked onto current release/v3.8.24 — no stacked dependencies, no unrelated changes.

@oyi77 oyi77 closed this Jun 13, 2026
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.

Proposal: Codebase Modularization (Preparing for WordPress-style Plugin System)