From efaf96394d30f3f1bb12196c9b930c6f6fa296dc Mon Sep 17 00:00:00 2001 From: kyson Date: Mon, 23 Mar 2026 17:49:53 +0800 Subject: [PATCH 1/2] feat(core): add git_sync_flow orchestrator - Implement industrial-grade git sync flow (pull/rebase/push). - Add safety guards and conflict handling logic. --- src/agent_tools/core/orchestrators/git_sync.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/agent_tools/core/orchestrators/git_sync.py b/src/agent_tools/core/orchestrators/git_sync.py index 01a668a..fe83f61 100644 --- a/src/agent_tools/core/orchestrators/git_sync.py +++ b/src/agent_tools/core/orchestrators/git_sync.py @@ -169,15 +169,15 @@ def _handle_push() -> Result: branch_info = get_branch_context(refresh=True) is_protected = _is_protected_branch(refresh=True) - if branch_info.ahead == 0: - return Result( - status="success", - message="Local branch is already up-to-date with remote.", - workflow=WORKFLOW, - ) - if branch_info.upstream: - # 这里保护分支本地领先不能提交,如果是相同的话提示成功,如果落后的话不应该存在返回错误吧 + # 有远程且为最新 + if branch_info.ahead == 0: + return Result( + status="success", + message="Local branch is already up-to-date with remote.", + workflow=WORKFLOW, + ) + # 这里保护分支本地领先不能提交 if is_protected: return Result( status="error", From c1858a9a38e87520781e2c3672ca10ad4662571b Mon Sep 17 00:00:00 2001 From: kyson Date: Mon, 23 Mar 2026 17:49:53 +0800 Subject: [PATCH 2/2] docs(core): translate Chinese notice to English - Translate instructions for squash commit message synthesis to English for consistency. --- src/agent_tools/core/orchestrators/gh_pr_merge.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/agent_tools/core/orchestrators/gh_pr_merge.py b/src/agent_tools/core/orchestrators/gh_pr_merge.py index e23b262..eea8fad 100644 --- a/src/agent_tools/core/orchestrators/gh_pr_merge.py +++ b/src/agent_tools/core/orchestrators/gh_pr_merge.py @@ -173,6 +173,7 @@ def _handle_sense() -> Result: "2. Synthesize a professional squash commit message for `override` following the 'details.json_format' layout.\n" " - 'title': A professional squash commit subject.【STRICT】MUST satisfy 'details.subject_regex'.\n" " - 'body': The detailed body should explain the 'why' and 'how' (not just 'what'), especially for complex logic changes. 【STRICT】single line max `details.body_wrap_length` chars.\n" + " - 【NOTICE】 You cannot directly use the PR's commit information; you must reorganize the language based on the PR information to form a new commit message.\n" "3. Call 'gh_pr_merge_flow' with point='merge' and your 'override' object.\n" ), details={