diff --git a/.github/workflows/codex-feedback-loop.yml b/.github/workflows/codex-feedback-loop.yml index 27e82a7..acf9742 100644 --- a/.github/workflows/codex-feedback-loop.yml +++ b/.github/workflows/codex-feedback-loop.yml @@ -54,6 +54,21 @@ jobs: exit 1 fi + if [ -z "$REVIEW_ID" ]; then + REVIEW_ID=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR/reviews" --paginate --jq ' + [ + .[] + | select( + .user.login == "chatgpt-codex-connector[bot]" + and .state == "COMMENTED" + ) + ] + | sort_by(.submitted_at // .id) + | last + | .id // empty + ') + fi + STATE=$(gh pr view "$PR" --repo "$GITHUB_REPOSITORY" --json state --jq .state) echo "pr_number=$PR" >> "$GITHUB_OUTPUT" echo "review_id=$REVIEW_ID" >> "$GITHUB_OUTPUT" @@ -107,7 +122,7 @@ jobs: PR_NUMBER: ${{ steps.ctx.outputs.pr_number }} REVIEW_ID: ${{ steps.ctx.outputs.review_id }} run: | - MARKER="" + MARKER="" FOUND=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" --paginate --jq ".[] | select(.body | contains(\"$MARKER\")) | .id" | head -n 1 || true) echo "marker=$MARKER" >> "$GITHUB_OUTPUT" if [ -n "$FOUND" ]; then @@ -125,16 +140,16 @@ jobs: SUMMARY: ${{ steps.findings.outputs.summary }} COUNT: ${{ steps.findings.outputs.count }} run: | - gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$(cat < /tmp/codex-feedback-comment.txt + gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body-file /tmp/codex-feedback-comment.txt - name: No-op summary if: steps.ctx.outputs.pr_state == 'OPEN' && (steps.findings.outputs.count == '0' || steps.dedupe.outputs.already == 'true') diff --git a/docs/breadcrumbs.md b/docs/breadcrumbs.md index a5e2bab..2ebf6b8 100644 --- a/docs/breadcrumbs.md +++ b/docs/breadcrumbs.md @@ -379,3 +379,6 @@ - Added reusable review playbook command `.cursor/commands/pr-review.md` (OpenUsage-style process adapted for StepCast). - Added codex follow-up automation workflow `.github/workflows/codex-feedback-loop.yml` (auto on codex review, manual `/codex-fix`, workflow_dispatch) with dedupe marker comments. - Updated `CONTRIBUTING.md` with review automation usage and added spec `docs/specs/2026-02-16-codex-feedback-loop.md`. +2026-02-16 +- Applied codex follow-up fix for workflow dedupe edge case: `.github/workflows/codex-feedback-loop.yml` now resolves latest concrete codex `review_id` when manual triggers (`/codex-fix` or `workflow_dispatch`) omit it. +- Result: dedupe marker keys by real review id instead of static `review-latest`, so later manual runs are no longer blocked after earlier autofix comments. diff --git a/docs/choices.md b/docs/choices.md index 6fae466..137975f 100644 --- a/docs/choices.md +++ b/docs/choices.md @@ -273,3 +273,4 @@ - Default: codex feedback automation is follow-up-by-comment (`@codex address that feedback`) with dedupe markers, not direct auto-commit from workflow; reason: keeps human oversight and avoids unsafe write automation in CI context. - Default: codex follow-up workflow supports three entry points (codex review submit, `/codex-fix` comment, manual dispatch); reason: reliable trigger paths for both automatic and operator-driven remediation. - Default: Apple Intelligence eligibility uses selected app language (resolved `en|de`) instead of backend `system_locale`; reason: prevents mixed-language eligibility reasons in localized Settings UI. +- Default: when manual `/codex-fix` or `workflow_dispatch` omits `review_id`, resolve the latest concrete codex review id before dedupe; reason: avoid static `review-latest` marker collisions and allow later manual reruns for new findings.