Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces several bug fixes, refactorings, and feature additions across the repository. Key changes include soft-deprecating @omniroute/opencode-provider in favor of @omniroute/opencode-plugin, modularizing the handleChatCore handler and the combo routing engine, and resolving several undocumented or missing API endpoints (such as gamification, guardrails, and agent-bridge). Additionally, it hardens the Antigravity/agy provider limits, translates chat-pipeline responses back to the legacy text-completion shape for /v1/completions, and migrates public OAuth client IDs to secure public credential resolvers. Feedback on the changes highlights a potential issue in open-sse/services/combo/constants.ts where an invalid QUOTA_SOFT_DEPRIORITIZE_FACTOR environment variable could parse to NaN and break sorting; a fallback check using Number.isFinite is recommended.
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.
| export const QUOTA_SOFT_DEPRIORITIZE_FACTOR = Number( | ||
| process.env.QUOTA_SOFT_DEPRIORITIZE_FACTOR ?? "0.7" | ||
| ); |
There was a problem hiding this comment.
If process.env.QUOTA_SOFT_DEPRIORITIZE_FACTOR is set to an invalid numeric string, Number(...) will return NaN. This will result in NaN scores during auto-combo scoring and break the sorting logic. Use Number.isFinite to safely fall back to 0.7 if the parsed value is invalid.
const rawFactor = Number(process.env.QUOTA_SOFT_DEPRIORITIZE_FACTOR ?? "0.7");
export const QUOTA_SOFT_DEPRIORITIZE_FACTOR = Number.isFinite(rawFactor) ? rawFactor : 0.7;…aper-inference#3691) Integrated into release/v3.8.23
…ce#3690) Integrated into release/v3.8.23
…heaper-inference#3689) Integrated into release/v3.8.23
…ution (cheaper-inference#3692) Integrated into release/v3.8.23
…e#3698) Integrated into release/v3.8.23
Integrated into release/v3.8.23
…per-inference#3685) (cheaper-inference#3702) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…per-inference#3696) (cheaper-inference#3703) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…er-inference#3660) Integrated into release/v3.8.23
…API (cheaper-inference#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 cheaper-inference#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.
…4062→3408 LOC (-654) (cheaper-inference#3717) Phase 1g-1j of cheaper-inference#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>
…3408→2553 LOC (-855) (cheaper-inference#3721) Phase 1k-1m of cheaper-inference#3501: client 3408→2553 LOC. Pure extraction (useModelImportHandlers+ImportProgressModal, useModelVisibilityHandlers, ProviderModelsSection). Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
….8.20 release branch The fix itself reached main pre-tag via cherry-pick cheaper-inference#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).
…rofileArn (cheaper-inference#3722) Integrated into release/v3.8.23
…2553→1376 LOC (-1177) (cheaper-inference#3725) Phase 1n-1s of cheaper-inference#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 (cheaper-inference#3629) Integrated into release/v3.8.23
…6→781 LOC (≤800 TARGET REACHED ✅) (cheaper-inference#3727) Phase 1t of cheaper-inference#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 (cheaper-inference#3726) Integrated into release/v3.8.23
…erence#3724) Integrated into release/v3.8.23
…eaper-inference#3288) (cheaper-inference#3723) Integrated into release/v3.8.23
… every chatHelpers import cheaper-inference#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).
…on) + cheaper-inference#3588 (combo reasoning buffer) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…drop shadow/guardrails doc-fiction (cheaper-inference#3496) (cheaper-inference#3602) Integrated into release/v3.8.21 — implements GET /api/guardrails + POST /api/guardrails/test, removes shadow/guardrails doc-fiction. TDD-validated (5/5) + check-docs-symbols/typecheck/eslint green.
Split-out PR C from cheaper-inference#3584. Isolates textual reasoning wrappers (<think>/<thinking>/<thought>/<internal_thought>, including malformed/open tags) into reasoning_content across both the non-streaming sanitizer and the Gemini streaming translator, with split-chunk buffering. Additive to the existing textual tool-call pipeline; does not touch the cheaper-inference#3569 native functionResponse path. Integrated into release/v3.8.21. Thanks @dhaern!
…nce#3603) Split-out PR A from cheaper-inference#3584. Normalizes the Antigravity/agy Gemini 3.5 Flash tier IDs to clean public names (gemini-3.5-flash-low/medium/high), maps them to the live upstream IDs at the executor boundary, and removes Antigravity from the global model resolver so the executor owns wire normalization. Maintainer follow-up: kept gemini-3.5-flash-preview as a hidden backward-compat alias routing to the High tier (so saved combos/configs keep working). Live-validated the tier set via the agy CLI catalog. Integrated into release/v3.8.21. Thanks @dhaern!
…s port 443 (cheaper-inference#3606) (cheaper-inference#3608) Integrated into release/v3.8.21 (cheaper-inference#3606)
…500 (cheaper-inference#3589) (cheaper-inference#3609) Integrated into release/v3.8.21 (cheaper-inference#3589)
…de-plugin (cheaper-inference#3419) (cheaper-inference#3613) Integrated into release/v3.8.21 (cheaper-inference#3419)
…ference#3604) Split-out PR B from cheaper-inference#3584. Normalizes Antigravity/agy provider quotas: prefers retrieveUserQuota for live consumption, falls back to fetchAvailableModels and local usage_history, sanitizes cached Provider Limits so retired upstream IDs are not re-exposed, and schedules a deduplicated post-usage refresh. Maintainer follow-up: decoupled the post-usage refresh via a lightweight usageEvents bus (usageHistory no longer dynamic-imports providerLimits) so it does not pull the executors/translator graph into the typecheck-core surface — typecheck:core stays at 0. Integrated into release/v3.8.21. Thanks @dhaern!
…ode (cheaper-inference#3331) (cheaper-inference#3614) Integrated into release/v3.8.21 (cheaper-inference#3331)
…aper-inference#3604 (provider quotas) + cheaper-inference#3605 (reasoning wrappers) Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
…nference#3594) Breaks the 12,882-line providers/[id]/page.tsx into 6 domain-focused files: - types.ts — all shared interfaces/types - utils.tsx — helper functions and utility components (ModelSourceBadge, CooldownTimer, ModelCompatPopover, etc.) - modelManagement.tsx — ModelRow, ModelVisibilityToolbar, PassthroughModelsSection, CustomModelsSection, CompatibleModelsSection - connectionManagement.tsx — ConnectionRow, EditConnectionModal, EditCompatibleNodeModal - authModals.tsx — AddApiKeyModal, SiliconFlowEndpointModal, Import/Apply (Codex/Claude/Gemini) auth modals - playground.tsx — ProviderPlaygroundPanel, renderKindPanel page.tsx reduced from 12,882 → 4,687 lines (63% reduction). TypeScript typecheck passes cleanly. ESLint: 0 errors, only 3 pre-existing warnings. Pre-parse and de-duplicate all imports per file to eliminate unused imports. Resolves part of cheaper-inference#3594.
- Replaced Buffer with browser-safe atob in utils.tsx - Fixed memory leaks/infinite intervals in cooldown timers - Typed chatCore handlers with 'any' instead of 'unknown' to fix strict-mode property access - Fixed single-model reasoning payload mutation in combo.ts
…nce#3594) - Splits the 4,600-line combo.ts monolithic file into 12 domain-specific files - Extracts Auto-Combo, Round-Robin, Quota tracking, Shadow routing, and Context Affinity logic into dedicated modules - Uses folder-as-module pattern with index.ts facade for zero backward-compatibility breakages - Auto-prunes and manages all imports for strict typechecking
7e46500 to
165fb6e
Compare
|
Thanks @oyi77 for the modularization work on
What would let this land: re-cut it as a single, independent PR branched from the current |
Summary
This PR addresses the 4th highest priority massive file from Issue #3594:
open-sse/services/combo.tsat 4,600+ lines.Changes
Splits the monolithic core combination service into 12 domain-focused files inside
open-sse/services/combo/:types.tsutils.tsconstants.tsstate.tsdag.tssorting.tsquota.tscontext.tsshadow.tsauto.tsbuildAutoCandidatesscoring logic, request-tag routingroundRobin.tshandleRoundRobinComboexecution pathchat.tshandleComboChatexecution orchestration loopindex.tsResults
combo/index.ts)combo.tsare re-exported.Verification
npm run typecheck:core— passes cleanly.npx eslint open-sse/services/combo/*.ts— 0 errors or warnings.Resolves part of #3594.