Skip to content

rebuild fork on upstream main: single patch commit, zero drift - #13

Merged
feifeigood merged 2 commits into
agentfleet/mainfrom
agentfleet/rebuild-on-upstream-20260726
Jul 26, 2026
Merged

rebuild fork on upstream main: single patch commit, zero drift#13
feifeigood merged 2 commits into
agentfleet/mainfrom
agentfleet/rebuild-on-upstream-20260726

Conversation

@feifeigood

Copy link
Copy Markdown
Owner

按维护者要求重做:从 google/ax main 干净开分支,把我们自己的提交 cherry-pick 上去,而不是把上游 merge 进我们那条长期分叉的分支。

为什么必须重做

上游 google/ax 重写过 git 历史——同一个提交 "Run Antigravity Interactions as substrate actors (google#287)" 在上游是 fea5d23、在我们 fork 里是 c4f4cf9。SHA 错位导致 3-way merge 的 base 判定失真:base 有某个上游特性、我们这边没有、上游有 → git 判定「只有我们改了」→ 静默保留我们的删除,连冲突都不报

结果是 #12 合并后,git diff upstream/main fork/main33 个文件,其中 15 个不是我们的 patch:

类别 文件 说明
生成物工具链噪音 ax_grpc.pb.gocontent.pb.goax_pb2_grpc.pycontent_pb2.pycontent_pb2_grpc.py 用了与上游不同的 protoc/插件版本重新生成;顺带删掉上游刚加的 Google LLC 版权头,并把 python gencode 底线抬到 protobuf≥5.29 / grpcio≥1.70(import 期硬校验)
上游特性丢失 antigravityinteractions/*(5 个)、cliutil.gocmd/ax/harness.go 上游把 workdir 重构成显式 WorkDir 配置 + resolveRunDir,我们更早的 v0.2.0 同步(#10)在冲突解析里保留了旧的 chdir 方案
过期的 fork 补丁 check-binaries.yml(被我们删掉)、go.yml.gitignore 上游已自行清掉那个 30MB e2e 二进制并加了更完善的 check-binaries workflow,我们内联进 go.yml 的版本成了冗余

这个 PR 怎么做的

  1. origin/main(cbd2c56)开新分支;
  2. 只把我们真正的改动应用上去(排除上述 15 个文件),零冲突;
  3. 生成物用上游同款工具链重新生成——protoc 28.2、protoc-gen-go-grpc 1.5.1、grpcio-tools 1.62.2,并手工补回版权头 → ax_grpc.pb.go / content.pb.go / content_pb2*.py / ax_pb2_grpc.py 现在与上游逐字节一致,只有 ax.pb.goax_pb2.py 因为我们真加了字段而变;
  4. 压成单一 patch commit 01dd9f4

结果:git diff origin/main = 18 个文件,全部是我们的 patch,零多余。(重建版 vs 旧 fork main 的差异也逐一核对过,只有上表那 15 个文件,我们的功能代码一行没丢。)

以后怎么跟上游

git checkout -b sync-YYYYMMDD origin/main   # 从上游干净开分支
git cherry-pick 01dd9f4                      # 拿我们这一个 patch
# 有冲突就修,修完仍是单一 patch

关于合并方式

分支顶端有一个 -s ours 的 merge,把旧的 agentfleet/main 记为父提交。这样不需要 force-push、不改写已发布历史就能落地,同时保留本分支这棵干净的树。普通 3-way 合并会把 drift 又合回来,所以必须这样。合并后 agentfleet/main 与上游的差异就只剩那一个 patch。

验证

gofmt / go build / go vet / go test -race ./... 全绿,13 包 0 失败(含被还原成上游版的 antigravityinteractions 包)。

后续

合并后 af 的 go.mod replace pin 需要指向新提交(现指向旧分支的 1234e31),我会跟一个小 PR。

🤖 Generated with Claude Code

https://claude.ai/code/session_017TK34TZokEcfPq5JdbUVWo

feifeigood and others added 2 commits July 26, 2026 10:16
…e aa1d14a7

Single squashed patch carrying every agentfleet-owned change on top of
google/ax main. Rebuilt directly on upstream so `git diff origin/main`
is exactly this patch and nothing else -- the previous long-lived merge
branch had accumulated drift because upstream rewrote its history, which
made 3-way merge bases unreliable.

To follow upstream: branch from the new upstream main, cherry-pick this
commit, resolve conflicts, done.

Contents:

- proto: `harness_metadata` on ConversationEvent, HarnessEnd and
  ExecResponse so a harness can attach an opaque terminal blob (token
  usage) to the event that ends a turn. Generated artifacts regenerated
  with upstream's toolchain (protoc 28.2, protoc-gen-go-grpc 1.5.1,
  grpcio-tools 1.62.2) so only ax.pb.go / ax_pb2.py move.
- harness: `Drainer` optional capability; stream plumbing for terminal
  metadata (OnCompleteWithMetadata / OnFailWithMetadata).
- controller: honor `CloseBeforeNextStart` so harnesses tracking
  per-conversation turn state close before the next turn starts, while
  everything else keeps upstream's deferred-close semantics; persist
  terminal metadata on both COMPLETED and FAILED paths.
- registry: drain Drainer harnesses on Close so warm actors awaiting
  deferred idle suspension are suspended, not leaked, on process exit.
- server: GracefulStop drains gRPC before closing the controller so no
  turn re-arms the idle timer after the drain.
- substrate harness: warm-then-suspend idle policy, warm actor
  revalidation with cold-resume fallback, shutdown drain.
- go.mod: substrate pin -> aa1d14a7 (imagecache Phase 1 plus the 07-24
  fixes); internal/ate and harnesstest adapted to name-based actor
  addressing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017TK34TZokEcfPq5JdbUVWo
…uild

Records the previous agentfleet/main as a parent so this lands without
rewriting published history, while keeping this branch's tree (the clean
upstream-based rebuild) verbatim. A normal 3-way merge would resurrect
the drift, hence -s ours.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017TK34TZokEcfPq5JdbUVWo
@feifeigood
feifeigood marked this pull request as ready for review July 26, 2026 02:25
@feifeigood
feifeigood merged commit 46e03c8 into agentfleet/main Jul 26, 2026
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.

1 participant