Skip to content

chore: bring the fork level with upstream (10 Oct) - #30

Open
polymaniadeveloper-hub wants to merge 133 commits into
masterfrom
integration/upstream-2026-10-10
Open

polymaniadeveloper-hub wants to merge 133 commits into
masterfrom
integration/upstream-2026-10-10

Conversation

@polymaniadeveloper-hub

Copy link
Copy Markdown
Collaborator

This merges 132 new upstream commits from pingdotgg/t3code main into master as one real merge commit, on top of #26. The main upstream change is that usage history is now read by readers that live on each provider driver, so the fork's Kimi, Hermes, DeepSeek and pi usage moves onto that API, and the fork's model-provider attribution rides on upstream's Claude and Codex readers through fork-only wrappers.

This supersedes the draft sync PR #28, whose conflict list predates #26.

Conflicts and how each was resolved

  • apps/server/src/auth/RpcAuthorization.ts: kept both sides' new scopes (the fork's checkout-update methods and upstream's storage-cleanup report).
  • apps/server/src/server.ts: upstream moved layerUsage above the background policy, so the fork's duplicate was dropped; layerDelivery kept.
  • apps/server/src/provider/Drivers/antigravityUsageReader.ts: upstream's Effect/SqlClient reader, with the fork's fallback to the conversation's model from executor_metadata ported onto it.
  • apps/server/src/provider/builtInDrivers.ts: upstream's usage driver list and env, plus the fork's Kimi, Hermes and DeepSeek drivers, pi's reader, and the Claude/Codex attribution wrappers.
  • apps/server/src/usage/UsageService.ts: upstream's driver-reader service; the fork keeps only its scan-cache migration (read the previous v5 file and the legacy file when the v6 file is missing). Its hard-coded harness homes, Hermes database, engine pi sources, OpenCode roots and Antigravity billing moved into the readers below.
  • apps/server/src/usage/opencodeUsageReader.ts: deleted, as upstream did; the fork's providerID attribution moved into provider-opencode's reader.
  • apps/server/src/usage/usageScanCache.ts: upstream's format-aware decoder, with the fork's model-provider columns (cache v6, and the fork's own older v5 rows still read).
  • apps/server/src/usage/usageTranscriptReader.ts: upstream's; the fork's pi, Kimi and DeepSeek parsing moved to the new readers.
  • apps/server/src/usage/usageTranscripts.ts: deleted, as upstream did; its fork parsers moved to Drivers/piUsage.ts, kimiUsage.ts and deepseekUsage.ts.
  • apps/web/src/components/ChatView.tsx: upstream's child-input banner and the fork's thread-tasks banner both kept.
  • apps/web/src/components/sidebar/SidebarChrome.tsx: both sides' imports; the fork's mobile-visible brand classes with upstream's inset focus ring.
  • apps/web/src/routes/__root.tsx: both imports; CheckoutUpdateProvider still wraps the app shell and upstream's DesktopWebLinkCoordinator is mounted.
  • packages/provider-opencode/src/server/driver.ts: upstream's usage reader and catalog imports, with the fork's GLM plan limits.
  • packages/provider-opencode/src/server/usageLimits.ts: the fork's shared auth-file reader and GLM limits, moved onto upstream's HostProcess.HomeDirectory.
  • packages/shared/src/usageLimits.ts: upstream's workspace-aware account keys, with the fork's quota groups and harness list.

Fork code adapted to upstream API changes

  • The fork's usage now lives in readers on drivers: Drivers/piUsage.ts, kimiUsage.ts, deepseekUsage.ts and hermesUsage.ts (scan readers), sharing harnessUsageFiles.ts. usageModelProviders.ts wraps upstream's Claude and Codex readers to add the model provider, so their own files stay as upstream wrote them.
  • UsageRecord in provider-core gains the optional modelProvider and modelProviderSource fields. Provider-opencode's reader records providerID and also reads each configured instance's own OPENCODE_DATA_DIR. Antigravity usage keeps the fork's billing attribution and GEMINI_HOME.
  • Moved from @t3tools/shared/hostProcess to @t3tools/shared/HostProcess in the checkout-update, delivery, workspace and Codex code. The Kimi, Hermes and DeepSeek drivers now handle mergeProviderInstanceEnvironment returning an Effect and expandHomePath taking the home directory.
  • Removed apps/server/src/usage/antigravityUsage.ts (and its test) and usageDatabases.ts. Neither was used by production code on master: upstream's Antigravity reader had replaced the first, and the second's Hermes half moved to hermesUsage.ts.

Verification

  • vp i: ok.
  • tsc --noEmit -p for apps/server, apps/web, packages/provider-opencode, packages/shared and packages/provider-core: no errors or warnings.
  • vp test run on server tests next to the conflicted files (auth, Antigravity reader and driver, Claude/Codex usage, all of usage/), the new reader tests, the ACP support tests, checkout update, workspace, CLI invocation, delivery, and the provider-opencode and shared usage tests: 324 passed, 2 failed. The 2 failures are in cli/invocation.test.ts ("requires the npm prefix's bin…" and "proves the native executable…"). They fail the same way on origin/master: on macOS the temp dir resolves to /private/var.
  • vp test run on the web side (ChatView.logic, CheckoutUpdate* tests, lib/delivery*, state/delivery*, components/delivery/): 469 passed.
  • node --test .github/scripts/tevin-upstream-sync.test.cjs: 23 passed.
  • No repo-wide checks were run.

Worth a reviewer's look

  • The fork's harness usage (pi, Kimi, DeepSeek, Hermes) is now read by scan readers, which cache parses only in memory. It no longer goes into the persisted scan cache, so usage of a session file deleted from disk drops out after a restart. Claude, Codex and Grok keep upstream's persisted cache.
  • The scan cache file is now usage-scan-cache-v6.json (version 6, with model-provider columns). This is the fork's own numbering. If upstream later ships its own v6, the next merge has to rename it.
  • An OpenCode instance's own OPENCODE_DATA_DIR and the Antigravity billing attribution are small fork additions to upstream files (provider-opencode/src/server/usage.ts and Drivers/AntigravityUsage.ts).

🤖 Generated with Claude Code

maria-rcks and others added 30 commits October 9, 2026 15:47
…ngdotgg#17559)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
…#16674)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ract (pingdotgg#17602)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…#17573)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…rgejo (pingdotgg#17581)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ol-azure-devops (pingdotgg#17592)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…lab (pingdotgg#17594)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…bitbucket (pingdotgg#17597)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…hub (pingdotgg#17607)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…g#17576)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…gg#17577)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…gg#17579)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…st kinds (pingdotgg#17617)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…not its kind (pingdotgg#17619)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…g move into their packages (pingdotgg#17624)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…nce (pingdotgg#17628)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…#17645)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Saikrishna1876 and others added 28 commits October 10, 2026 06:01
…utput (pingdotgg#17376)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… again (pingdotgg#17379)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…its thread (pingdotgg#17327)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…a check is still going (pingdotgg#17344)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
…dotgg#17223)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
…ingdotgg#17843)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g#17724)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
… full-access MCP grants (pingdotgg#17772)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…pull request (pingdotgg#12223)

Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <jmarminge@gmail.com>
Signed-off-by: Loïs Postula <lois@postu.la>
Brings in 132 upstream commits. Upstream now reads usage through readers
that live on each driver; the fork's Kimi, Hermes, DeepSeek and pi usage
moves onto that API as scan readers, and its model-provider attribution
rides on upstream's Claude and Codex readers through fork-only wrappers.

Conflicts:
- RpcAuthorization.ts: both sides' new scopes kept.
- server.ts: upstream moved layerUsage; layerDelivery kept.
- Drivers/antigravityUsageReader.ts: upstream's Effect reader, plus the
  fork's executor_metadata model fallback.
- builtInDrivers.ts: upstream's usage driver list, plus the fork's
  drivers and readers.
- UsageService.ts, usageTranscriptReader.ts: upstream's; the fork keeps
  only its v6 cache migration.
- usageScanCache.ts: upstream's format-aware decoder with the fork's
  model-provider columns (v6).
- usageTranscripts.ts, opencodeUsageReader.ts: deleted as upstream did;
  their fork parsers moved to the driver readers.
- ChatView.tsx: upstream's child-input banner and the fork's task banner.
- SidebarChrome.tsx: both imports; the fork's mobile brand classes with
  upstream's inset focus ring.
- __root.tsx: CheckoutUpdateProvider and DesktopWebLinkCoordinator.
- provider-opencode driver.ts, usageLimits.ts: upstream's usage reader and
  HomeDirectory reference, with the fork's GLM plan limits.
- shared usageLimits.ts: upstream's workspace-aware account keys with the
  fork's quota groups.

Adapted to upstream API changes: @t3tools/shared/HostProcess,
mergeProviderInstanceEnvironment as an Effect, expandHomePath(home).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.