Skip to content

perf: cherry-pick upstream connection, git and checkpoint fixes - #222

Merged
tusharbhardwaj-bk merged 11 commits into
expbkmainfrom
t3code/perf-7-upstream-picks
Sep 26, 2026
Merged

tusharbhardwaj-bk merged 11 commits into
expbkmainfrom
t3code/perf-7-upstream-picks

Conversation

@tusharbhardwaj-bk

@tusharbhardwaj-bk tusharbhardwaj-bk commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #221 (fork-marker check): the markers check needs #221's rule to accept cherry-picked upstream lines. This branch includes #221's commit until that merges.

Problem

Nine upstream fixes from upstream/main (e5a46d6) address bkt3's measured slowness: reconnect CPU, event-loop blocking by logs, git process bursts, turn-end checkpoint cost, and the missing desktop keep-alive for running threads. None of them are in the fork yet. Details and measurements: ~/perf-audit-bkt3/10-upstream.md.

Fix

Each commit is applied with git cherry-pick -x in the approved order, with a5da327 moved before 99641fd, which builds on it. The (cherry picked from commit …) trailers let the next upstream merge recognise them.

upstream what it does resolution
7931227 (pingdotgg#11811) no provider refresh on every subscribeServerConfig clean
b17cc2a (pingdotgg#12305) bound provider event-log records before serialization clean
5b377e2 (pingdotgg#11405) at most 8 short git processes at once test-file import conflict: kept ours plus the new gitCommandDuration import. The other upstream import there (parseGitCheckoutProgressLine) belongs to a commit not picked.
b12c92f (pingdotgg#10792) checkpoint capture reuses git index metadata clean
c1738f1 (pingdotgg#12154) large sparse checkouts stay on the fast path VcsProcess.ts: upstream's new onStdoutChunk line sits beside the fork's changed env line; kept both
d17f46d (pingdotgg#12308) file-search refresh moved off checkpoint processing, coalesced per cwd source merged clean. In the test file, upstream's new test needs a harness option (secondThreadWorktreePath) from a commit not picked. It is adapted to a single workspace (same assertions: checkpoints finalize while the refresh is blocked, later scans coalesce). Upstream-only test context was dropped.
cb3d95c (pingdotgg#12523) oversized PR diffs are not retained in the diff cache added the 4 new lines only (not upstream's unrelated FILES_VIEWED_CACHE_CAPACITY); its 2 new tests are included
a5da327 (pingdotgg#8309) busy threads keep a fresh disk cache; older-page loading fixed clean
99641fd (pingdotgg#13554) desktop keeps running threads synced in the background import conflict in apps/web/src/state/threads.ts: kept the fork's outbox import plus upstream's OrchestrationThreadShell type

One extra commit, test(web): fork thread fields in the keep-alive fixture, adds the fork-required thread fields to the picked threads.test.ts fixture so it typechecks.

Nothing was dropped. Deliberately not picked, per the approved plan: 5975ec7, eafb4a9, f4600d7, 18de6bb. Step 3 (PR state from GitHub webhooks, #217) replaces that path.

Reaches users: 99641fd and a5da327 are client changes. They reach desktop users only with the next desktop build.

Evidence

Targeted tests (NODE_ENV=test vp test run), all passing:

  • GitVcsDriverCore.test.ts + EventNdjsonLogger.test.ts: 89
  • GitVcsDriver.test.ts + VcsProcess.test.ts: 49
  • CheckpointReactor.test.ts: 36, including the adapted coalescing test
  • PullRequestService.test.ts: 121, including both new diff-cache tests
  • client-runtime threads-sync + threads-pagination: 39
  • web state/threads.test.ts: 3

vp run typecheck is clean in apps/server, packages/client-runtime and apps/web.

Fork-marker check: with #221 it passes. Without it, the 5 upstream-only files fail.

server.test.ts (touched by 7931227) is left to CI; it is too large for the shared box.

Model/harness: Claude Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

bk-agent-01 and others added 11 commits September 26, 2026 09:00
The check diffs HEAD against its merge-base with upstream, so a
`git cherry-pick -x` of an upstream fix the fork has not merged yet showed up
as unmarked fork edits and failed the required check. Wrapping cherry-picked
code in markers would create conflicts in the very merge that brings the same
commit in.

A line now only counts as a fork edit when it also differs from the upstream
tip (FORK_UPSTREAM_REF, which CI already sets to upstream/main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ingdotgg#11811)

Co-authored-by: Bil0000 <bilal.bakr.elsherif@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 7931227)
…ngdotgg#8309)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit a5da327)
…gg#13554)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 99641fd)
The cherry-picked test from 99641fd builds an OrchestrationThread without
the fields the fork adds (owner, members, summaries, source control profile).

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:XL labels Sep 26, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 13.8 KiB — 15.1 KiB ✅
Codex Thread snapshot wire — 7.3 KiB — 7.8 KiB ✅
Codex Live turn WebSocket wire — 6.5 KiB — 7.8 KiB ✅
Codex Live turn WebSocket decoded — 57.1 KiB — 66.4 KiB ✅
Codex Live turn messages — 10 — 21 ✅
Claude Total thread wire — 13.8 KiB — 15.1 KiB ✅
Claude Thread snapshot wire — 7.3 KiB — 7.8 KiB ✅
Claude Live turn WebSocket wire — 6.5 KiB — 7.8 KiB ✅
Claude Live turn WebSocket decoded — 57.9 KiB — 66.4 KiB ✅
Claude Live turn messages — 9 — 21 ✅

Baseline: unavailable · PR result: 5a82338 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 114.9 KiB
  • Claude decoded thread snapshot: 115.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@tusharbhardwaj-bk
tusharbhardwaj-bk merged commit 7d44edd into expbkmain Sep 26, 2026
20 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 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.

8 participants