Repository navigation
feat(gateway): expand model compatibility and harden failover, quotas, and billing - #82
Open
xiaoguai1818 wants to merge 50 commits into
Open
xiaoguai1818 wants to merge 50 commits into
xiaoguai1818 wants to merge 50 commits into
Conversation
added 30 commits
November 17, 2026 19:27
added 20 commits
November 18, 2026 15:15
…ases Preserve Antigravity 429/503 failover, final retry cooldowns and shared accounts after empty streams. Detect incomplete Gemini streams across six entry paths, truncate leaked turns, and preserve thinking configuration and accumulated usage. Persist irreversible OpenAI OAuth rotations with compare-and-swap, protect concurrent reauthorization and credential shadows, and keep peer-instance Redis leases intact during startup. Add PostgreSQL atomicity and Redis lifecycle regressions. Keep Codex external context and additional_tools IDs intact, prevent native WebSocket later turns from replaying the initial request, preserve metadata and tool-loop affinity, and return protocol errors rather than successful completions after Anthropic upstream read failures. Retain lite-specific routing, pricing and product boundaries. Refresh outdated model/version/reasoning test fixtures and close test-owned WebSocket pools. Upstream: Wei-Shaw#8973, Wei-Shaw#8974, Wei-Shaw#8975, Wei-Shaw#8987, Wei-Shaw#8997, Wei-Shaw#8980, Wei-Shaw#8685, Wei-Shaw#8671, Wei-Shaw#8703, Wei-Shaw#8589, Wei-Shaw#8741, Wei-Shaw#8786, Wei-Shaw#8622, Wei-Shaw#8769, Wei-Shaw#8564, Wei-Shaw#8754, Wei-Shaw#8673, Wei-Shaw#8994. Local verification: full unit suite (19,640 passes, 14 explicit environment/platform skips), focused race suites (182 and 60 overlapping cases), frontend typecheck/lint/1,841 tests/build, embed build and deployment fixtures. PostgreSQL integration code compiles; actual database execution and final-SHA CI/Security remain required. No migration, pricing-policy change, merge, release or deployment.
Record the unified gateway code commit, pinned upstream PR heads, existing 40-commit inventory, failure reproductions, local unit/race/frontend/build evidence, database validation requirements and unresolved scope boundaries. Keep the original conflicting checkout and local Cairn knowledge untouched by Git publication. The current branch is for consolidated verification only; a final PR remains gated on the remaining applicable work and final-SHA CI/Security results.
… masking Explicitly acknowledge strings.Builder's non-failing writes and format the existing GPT-6.2 model tests. Strengthen the PostgreSQL rotation/outbox atomicity regression using an autocommit connection so test SAVEPOINT rollback cannot hide a partial production update. Clean only fixture-owned account/outbox records. Affected Antigravity/OpenAI packages passed 315 race-enabled tests. The revised integration suite compiles; actual PostgreSQL/Redis execution remains blocked by the stopped local Docker engine and repository Actions dispatch denial. No migration, pricing-policy change or deployment.
…xplicit Acknowledge non-failing strings.Builder writes in reasoning conversion and turn-boundary fixtures. Add explicit returns after fatal nil guards in existing tests so staticcheck can follow their control flow without changing runtime assertions. Keep all lint checks enabled and remove diagnostic output limits for verification: golangci-lint v2.9.0 reports zero issues. Darwin and Linux/amd64 source-target govulncheck report no code-reachable vulnerabilities; seven uncalled required-module advisories remain recorded. No production control-flow, routing, schema or billing-policy changes.
Pin final gateway code 6601085 and its backend tree. Record the content-fenced full unit pass (19,657 tests/subtests, 14 explicit skips), zero lint issues, race/frontend/build results, strengthened PostgreSQL integration compile, and local vulnerability-scan scope. Correct the earlier Actions-permission inference: CI and Security Scan dispatch were actually denied with HTTP 422 despite enabled metadata. Preserve explicit real-database and remaining-feature gates; do not claim a final unified PR, merge, deployment, or zero dependency vulnerabilities.
Restore Antigravity Responses custom-tool roundtrips and correct Embeddings platform scheduling. Harden OAuth probe fencing, request-scoped Gemini 403 behavior, OpenAI stream failover and WebSocket current-turn safety. Preserve Claude/GPT-6.2/Grok protocol details and model observations; correct Fable/Kimi quota refreshes and user-vs-account cost reporting. Bound scheduler fallback, request memory retention and shutdown/stream lifecycles without unapproved pricing or schema changes. Local checks: complete Go unit packages, PostgreSQL 18.1/Redis 8.4 repository and audit integration, focused -race, frontend typecheck/lint/1858 Vitest/build, backend lint 0 issues and embedded server build. Remote CI/Security Scan remain pending. Upstream references: Wei-Shaw/sub2api Wei-Shaw#8833 Wei-Shaw#8875 Wei-Shaw#8856 Wei-Shaw#8730 Wei-Shaw#8990 Wei-Shaw#8806 Wei-Shaw#8832 Wei-Shaw#8809 Wei-Shaw#8164 Wei-Shaw#8804 Wei-Shaw#8773 Wei-Shaw#8309.
…isks Link the local gateway development commit to upstream sources and verified Go, PostgreSQL/Redis, frontend, race, lint and embedded-build results. Preserve approval requirements and GitHub CI/Security limitations without claiming remote checks.
Record fork Actions HTTP 422 despite enabled API status, pending required CI/Security Scan, and overlapping existing lite PRs CherryLover#73-CherryLover#81. Do not claim the single consolidated PR is review-ready until the final SHA checks can actually run.
The CLA Assistant workflow is gated to Wei-Shaw/sub2api and performs no useful checks on CherryLover/sub2api or the development fork. Remove this obsolete inherited workflow; retain CI, Security Scan, and target release/image workflows with actual usage. Document why the development fork keeps its three inactive image/release workflows disabled and why the target repository release paths must remain intact.
Keep Branch Docker Image available through explicit workflow_dispatch and internal-rc-* tag pushes. Remove the legacy claude/** branch push path and redundant [rc-build] guard, which generated historical skipped workflow runs and is no longer needed for validation. Preserve the target repo release pipeline and the fork disabled states; document the retained workflow ownership and deprecation evidence.
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
Selectively backport gateway reliability, new-model compatibility, security and usage fixes into Sub2API Lite, while preserving Lite-specific routing and billing defaults. This is one integrated delivery; no unrelated upstream product modules were restored.
Account safety and routing
Protocol compatibility and model support
Usage, quotas and UI
Workflow cleanup
Validation for final fork SHA
Final SHA: 51cbaa4.
Upstream sources
Upstream PRs may still be open or superseded; fixes were selectively adapted to Lite, not automatically cherry-picked.
Reviewer notes and boundaries
Detailed source mapping and validation evidence are in docs/maintenance/upstream-reviews/.