fix: refactor sync-upstream workflow to theirs-strategy + idempotent patches#4
Merged
fix: refactor sync-upstream workflow to theirs-strategy + idempotent patches#4
Conversation
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 43da87f Co-authored-by: Grynn <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…openclaw#16533) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 21e4045 Co-authored-by: BinHPdev <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Refactored sync-upstream.yml to use --theirs for src/* conflicts (accept upstream) + idempotent node patches to re-inject CodeBuddy code. This replaces the previous --ours strategy which blocked upstream updates from reaching fork users. Key changes: - Conflict whitelist now uses glob patterns (src/*, .github/workflows/*) - src/* conflicts resolved with --theirs, workflows with --ours - 14 idempotent patch scripts inject CodeBuddy provider code after merge - Patches cover: onboard types, auth credentials, auth choice options, model-auth early return, models-config provider registration, stream adapter integration, and e2e test adjustments
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
sync-upstream.ymlworkflow 使用--ours策略解决src/*冲突,导致上游所有源码更新被丢弃,fork 用户无法获得新功能和 bug 修复src/*冲突解决策略改为--theirs(接受上游),然后通过 14 个幂等node -epatch 脚本重新注入 CodeBuddy 特有代码;冲突白名单改用 glob 模式匹配codebuddy-stream-adapter.ts)未改动;上游功能逻辑未额外修改Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
NoNoNoNo— patch 脚本仅在 CI 环境中运行,操作范围与原 workflow 一致NoRepro + Verification
Environment
sync-upstream.ymlSteps
fix/sync-upstream-theirs-strategy分支上模拟完整同步流程:git merge --no-commit --no-ff v2026.2.14src/*用--theirs,deps 用--theirs)pnpm install && pnpm build && pnpm testExpected
Actual
pnpm build通过(219 个输出文件)pnpm test通过(694 个测试文件,4964 个测试用例)Evidence
Patch 执行日志:
测试结果:
Human Verification (required)
onboard-auth.ts和onboard-auth.credentials.ts的content.includes()大小写不匹配问题register.onboard.ts检测到formatAuthChoiceChoicesForCli动态生成后正确跳过src/*自动匹配)@tencent-ai/agent-sdk依赖恢复(workflow 中 package.json patch 处理)process.exit(1)错误处理models-config.skips-writing-models-json-no-env-token.e2e.test.ts)需在有完整环境的 CI 中验证Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
git revert <commit>回退到旧 workflow,或手动将sync-upstream.yml中src/*的--theirs改回--ours.github/workflows/sync-upstream.ymlRisks and Mitigations
content.indexOf(anchor))找不到process.exit(1)错误处理,workflow 会在 patch 阶段失败并报告具体是哪个文件/锚点出问题,便于快速定位修复--ours策略下同样存在Agent-Signoff: lobster-upstream-surfer