Skip to content

Draft: combine upstream Home improvements with fork schema v31 - #3

Merged
sofyan48 merged 18 commits into
mainfrom
maintenance/upstream-20261126
Nov 27, 2026
Merged

sofyan48 merged 18 commits into
mainfrom
maintenance/upstream-20261126

Conversation

@sofyan48

Copy link
Copy Markdown
Owner

DRAFT — upstream integration, verification blockers remain

Fork baseline fa17a89 (origin/main); upstream default main range 9208558ffa442e97001f5b385c5dd21d5ec68eaf..dcc3900b56ca9556387ae975f6c5bf784feb42ec. Comparison found 91 fork-only / 17 upstream-only commits, 14 patch-unmatched non-merge improvements. Includes Copilot routes/catalogs, Antigravity credential-scoped model/thinking enums, quota alias fixes, TPS output accounting and billing discovery improvements.

Combined conflicts / retained custom features

Actively combined four conflicted files, never blanket ours/theirs:

  • database_models.go: retain every fork migration/snapshot mapping, including organizations, playground and durable quota guards; add upstream provider-key data migration at effective version 31.
  • capabilities: retain topup_approval AND add antigravity_tos_pause_status.
  • registry definitions: retain lifecycle filtering on cloned catalog data while adopting provider-scoped lookups/Copilot.
  • registry model: retain retirement/lifecycle fields AND add source identity/response alias metadata.
    Branding, DB-backed runtime, organization scopes, usernameless passkeys, auth/mTLS/RESP, billing, alerting and existing API additions remain in the tree. No source tree replacement or deployment.

Database version

Fork 30, upstream 21, combined 31 (= max(30,21)+1) for newly integrated provider namespace startup data migration. This is schema/data version, not app release. Existing migration ordering/content retained; no occupied version reused, no downgrade. v30 snapshot shape remains explicitly supported. No production database touched.

Actual checks

  • Home compile go build -o /dev/shm/ai48home-maintenance-20261126 ./cmd/home: PASS. Normal on-disk compile initially failed ENOSPC; temporary output removed.
  • Registry/auth/Home/dynamic RESP dispatch package tests: PASS.
  • Isolated SQLite tests: TestCombinedProviderNamespaceMigrationVersion, TestMigrateOpenAICompatibleProviders, TestUserApprovalMigrationAndSnapshotCompatibility, TestBillingTopupMigrationAndSnapshots: PASS (fresh/legacy migration, all snapshot versions, repeated provider migration and retained metadata).
  • git diff --check: PASS.
  • go test ./internal/userapi: FAIL — analytics date/range assertions, reversed balance date validation, unattributed request-log visibility. Baseline comparison attempt could not link due ENOSPC, so these are NOT claimed pre-existing.
  • Full cluster/management verification initially interrupted by ENOSPC; follow-up results will be posted separately. PostgreSQL integration NOT run.

Blocking risks before ready

  1. Investigate user API test failures without weakening fork behavior/tests.
  2. Complete full cluster/management verification and PostgreSQL migration checks.
  3. Complete Home/UI/Rust Proxy compatibility audit for new provider namespace and downstream Antigravity settings. New Copilot support in Home does not imply the Rust worker supports it; Devin remains intentionally unsupported.
  4. Reconcile fork full English/Chinese API references; review note added under docs/ai48home/management/upstream-20261126.md.

Do not merge/deploy this draft until blockers resolved. Original checkout untouched. No service restart, production write, force push or main push.

GavinKung and others added 18 commits November 20, 2026 13:41
feat(management): expose the Antigravity pool pause status
Compute usage TPS and model availability throughput
from display output tokens instead of raw output
tokens, so complete v2 rows include reasoning tokens
consistently with the displayed output count. TPS is
display output divided by full latency without
subtracting TTFT, and is null when either is not
positive. Update management and user API docs.
Publish Copilot and Devin models from bare catalog IDs under
provider-qualified source IDs, track them via SourceModelID, and
apply exclusions, verbatim aliases, OAuth settings, and credential
prefixes consistently after namespacing.

Migrate legacy bare cooldown state to the canonical qualified
source key, keep rebound aliases isolated from prior cooldowns,
and prune ineligible Copilot snapshots on token or snapshot expiry,
credential replacement, or removal. Preserve Copilot token expiry
in database projections and scope static model lookups by channel.

BREAKING CHANGE: copilot/devin alias names must use the
provider-qualified source ID and aliases are published verbatim
without an automatic copilot/ or devin/ prefix
Return copilot/<id> and devin/<id> from static model
definitions to match OAuth exclusion and alias rules before
aliases and credential prefixes. Normalize channel casing
and document copilot as a supported channel.
Persist Copilot login and token storage failures with bounded
per-attempt timeouts and retries instead of an unbounded write
with ignored errors. Log authorization, storage, and exhaustive
retry failures so polling clients reliably observe error state.
Previously, model alias entries were only built for user-defined
models, so aliases pointing to registry-backed models could not be
dispatched to their upstream names. Include all metadata entries
and keep the display_name fallback only for older user-defined
models where it stored the upstream name.
feat(home)!: add Copilot support and unify namespaced routes
Discover billing identities from Copilot and Devin static catalogs
and per-credential execution models behind aliases, including Devin
plugin and legacy routes, instead of public route IDs.

Expose billing_models on v8 Copilot and Devin static models so
editors can merge static and available entries by billing pair.

Enforce the 10,000 distinct-target limit across all sources and
return 422 import_target_limit_exceeded before fetching the catalog
instead of silently truncating discovery.
Only clear the requested-model fallback for non-published routes.
When a published model ID is rebound to another source model,
resetting it must not also clear the original source's cooldown.
Prefix configured compatibility group names with
openai-compatible- for routing, dispatch, and model billing
while preserving configured names and credential IDs. This
prevents groups named like native providers from colliding
with them.

Add database version 21 migration to namespace existing
provider keys and simplify model publishing accordingly.

BREAKING CHANGE: OpenAI-compatible credentials now dispatch
under openai-compatible-<group> instead of the bare group
name. Stop older Home nodes before upgrading shared databases
and review price rules keyed by bare group names.
feat(billing)!: expand auto-discovery and namespace compat providers
@sofyan48

Copy link
Copy Markdown
Owner Author

Follow-up verification: full internal/cluster/management suite PASSED. Full internal/cluster suite FAILED: TestDeleteAccessGroupRemovesBindings, TestMergedSnapshotHistoriesRoundTrip, TestInFlightDetailStrictJSONRejectsInvalidDetails. Focused isolated migration/snapshot/version tests passed, but these broader failures remain blockers (not assumed pre-existing). Four userapi failures also remain. PR stays draft. CI retarget failed; verified base still main.

@sofyan48

Copy link
Copy Markdown
Owner Author

Daily reconciliation: fetched origin/main fa17a89 and upstream dcc3900; existing integration 2b35ede already contains latest origin/main and upstream tip (normal merge origin/main: already up to date). Original clean main pulled using git -c pull.rebase=false pull origin main --no-ff; resulting local-only merge 6e2b534, origin/main ancestry verified. No push to main. New identical-environment comparison using Go 1.26.10 and GOTMPDIR/TMPDIR=/dev/shm/ai48-daily-tmp: go build ./cmd/home succeeds on exact origin/main baseline and integration. go test ./internal/userapi fails on BOTH with the same four tests: TestUserBillingBalanceRoutesAuthenticationAndValidation, TestUserAnalyticsAuthenticationAndFilters, TestUserRequestLogsOwnershipAndSafeSummary, TestUserAnalyticsDateRange. These failures are now reproduced on baseline, not newly attributed to integration. Isolated migration regression selection (CombinedProviderNamespaceMigrationVersion, MigrateOpenAICompatibleProviders, UserApprovalMigrationAndSnapshotCompatibility, BillingTopupMigrationAndSnapshots) passes again. Schema remains fork 30 / upstream 21 / draft 31; no additional bump or production DB access. CI build and retarget remain failed; draft retained. Disk exhausted during subsequent Rust verification; full compatibility/PostgreSQL checks still outstanding. No new code or duplicate PR.

@sofyan48

Copy link
Copy Markdown
Owner Author

Follow-up verification after refreshing all three original main checkouts using merge-mode pull (git -c pull.rebase=false pull origin main --no-ff). Current origin/main baseline: fa17a89. Integration: 2b35ede. Disk now has >8 GB free; no ENOSPC in these reruns. Identical focused go test -count=1 commands on baseline and integration reproduce the same four userapi failures: TestUserAnalyticsAuthenticationAndFilters, TestUserAnalyticsDateRange, TestUserBillingBalanceRoutesAuthenticationAndValidation, TestUserRequestLogsOwnershipAndSafeSummary. TestDeleteAccessGroupRemovesBindings/model also fails identically on both (null vs []). These five observed failure signatures are therefore present before this integration, not newly introduced by it. The combined cluster invocation also covered TestMergedSnapshotHistoriesRoundTrip and TestInFlightDetailStrictJSONRejectsInvalidDetails; neither emitted a failure on either tree, unlike prior disk-full runs. This is focused baseline comparison, NOT full-suite or PostgreSQL/cross-repo parity certification. No code changes, deploy, production writes or direct main push performed. PR remains draft pending remaining checks.

@sofyan48
sofyan48 marked this pull request as ready for review November 27, 2026 05:42
@sofyan48
sofyan48 merged commit 34d7ae5 into main Nov 27, 2026
2 of 4 checks passed
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.

4 participants