From 82785e22230fb5865c858a49b23a53b003c9a297 Mon Sep 17 00:00:00 2001 From: Vlad Mocanu Date: Mon, 16 Mar 2026 10:16:38 +0200 Subject: [PATCH] fix: add guardrail to upstream-sync prompt to prevent early stop Claude was resolving merge conflicts but stopping before running tests, committing, pushing, or creating the PR. Add explicit instruction that the job is not done until the branch is pushed and PR is created. --- .forgejo/kcl-ci/main.k | 5 +++++ .forgejo/workflows/upstream-sync.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.forgejo/kcl-ci/main.k b/.forgejo/kcl-ci/main.k index 1615f51..9e68513 100644 --- a/.forgejo/kcl-ci/main.k +++ b/.forgejo/kcl-ci/main.k @@ -245,6 +245,11 @@ _merge_affected_ref = h.gha_steps("prepare", "affected_files") _merge_prompt = """\ You are automating an upstream sync for our Forgejo fork of anthropics/claude-code-action. +## CRITICAL: Do NOT stop early +You MUST complete ALL steps below before stopping. Resolving conflicts alone is NOT sufficient. +Your job is NOT done until you have pushed the branch AND created (or updated) the PR. +If you stop before pushing and creating the PR, the entire sync fails. + ## Current state - Branch: ${_merge_branch_ref} - ${_merge_behind_ref} commits behind upstream, ${_merge_ahead_ref} commits ahead (our Forgejo changes) diff --git a/.forgejo/workflows/upstream-sync.yml b/.forgejo/workflows/upstream-sync.yml index 49bda91..44eee5d 100644 --- a/.forgejo/workflows/upstream-sync.yml +++ b/.forgejo/workflows/upstream-sync.yml @@ -331,6 +331,11 @@ jobs: prompt: |- You are automating an upstream sync for our Forgejo fork of anthropics/claude-code-action. + ## CRITICAL: Do NOT stop early + You MUST complete ALL steps below before stopping. Resolving conflicts alone is NOT sufficient. + Your job is NOT done until you have pushed the branch AND created (or updated) the PR. + If you stop before pushing and creating the PR, the entire sync fails. + ## Current state - Branch: ${{ steps.prepare.outputs.branch }} - ${{ needs.check-upstream.outputs.behind }} commits behind upstream, ${{ needs.check-upstream.outputs.ahead }} commits ahead (our Forgejo changes)