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={ 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",