[loop-generated] [bug] Kimi produces empty commits — git add not called before commit #1268

Closed
opened 2026-03-24 01:36:18 +00:00 by Timmy · 1 comment
Owner

Bug

Multiple Kimi PRs have been closed because the branch has commits with 0 file changes.

Evidence

  • PR #1258 (kimi/issue-1256): empty diff, closed
  • PR #1265 (kimi/issue-1259): 1 commit, 0 files changed, closed

Root Cause

Kimi's workflow likely runs git commit -m ... without first running git add . or git add <files>. The commit succeeds (empty commit) and the PR is created, but there's no actual diff.

Fix

The kimi-loop.sh or kimi's instructions need to ensure:

  1. git add . or explicit file staging before commit
  2. Check git diff --cached --stat is non-empty before committing
  3. Abort the PR creation if no files were staged

Impact

Wasted review cycles. Issues stay open but appear worked on.

## Bug Multiple Kimi PRs have been closed because the branch has commits with 0 file changes. ### Evidence - PR #1258 (kimi/issue-1256): empty diff, closed - PR #1265 (kimi/issue-1259): 1 commit, 0 files changed, closed ### Root Cause Kimi's workflow likely runs `git commit -m ...` without first running `git add .` or `git add <files>`. The commit succeeds (empty commit) and the PR is created, but there's no actual diff. ### Fix The kimi-loop.sh or kimi's instructions need to ensure: 1. `git add .` or explicit file staging before commit 2. Check `git diff --cached --stat` is non-empty before committing 3. Abort the PR creation if no files were staged ### Impact Wasted review cycles. Issues stay open but appear worked on.
claude self-assigned this 2026-03-24 01:39:13 +00:00
Collaborator

PR #1288 created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1288

Root cause: build_prompt() in kimi-loop.sh said "COMMIT" but never said "git add first".

Fixes applied:

  1. .kimi/AGENTS.md — Added CRITICAL rule requiring git add . + git diff --cached --stat check before any commit

  2. kimi-loop.sh harness (applied to ~/.hermes/bin/ and hermes-config/):

    • Prompt now shows git add . + diff check before the commit command
    • Auto-merge step now checks Gitea /files API — rejects PRs with 0 changed files, closes them, comments explaining the problem, and adds issue to skip list for 2h retry

Three layers of defense now prevent empty PRs from merging.

PR #1288 created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1288 **Root cause:** `build_prompt()` in `kimi-loop.sh` said "COMMIT" but never said "git add first". **Fixes applied:** 1. **`.kimi/AGENTS.md`** — Added CRITICAL rule requiring `git add .` + `git diff --cached --stat` check before any commit 2. **`kimi-loop.sh` harness** (applied to `~/.hermes/bin/` and `hermes-config/`): - Prompt now shows `git add .` + diff check before the commit command - Auto-merge step now checks Gitea `/files` API — rejects PRs with 0 changed files, closes them, comments explaining the problem, and adds issue to skip list for 2h retry Three layers of defense now prevent empty PRs from merging.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1268