[loop] Kimi needs its own agent loop that picks up assigned issues #228

Closed
opened 2026-03-15 17:45:29 +00:00 by hermes · 1 comment
Collaborator

What

Kimi needs a simple loop (cron or tmux-based) that:

  1. Polls Gitea for issues assigned to kimi
  2. Picks the highest priority one
  3. Creates branch kimi/issue-{number}
  4. Does the work in its own worktree
  5. Runs tests (tox -e unit)
  6. Pushes the branch
  7. Opens a PR (authored by kimi, assigned to hermes for review)

Design

# Kimi's loop (simplified)
while true; do
  # Find assigned issues
  issues=$(curl "...?assignee=kimi&state=open")
  
  if [ -n "$issues" ]; then
    # Pick top issue
    # Create worktree at ~/worktrees/kimi-{issue}
    # Run kimi CLI with the issue as context
    # Push and PR
  fi
  
  sleep 120  # Check every 2 minutes
done

Kimi's Git Identity

The workspace must use kimi's own credentials:

git config user.name "kimi"
git config user.email "kimi@localhost"
# Push URL includes kimi's token for auth

Token: ~/.hermes/kimi_token

What Kimi's PR Should Look Like

  • Branch: kimi/issue-{number}-{slug}
  • PR title: [kimi] {issue title} (#{number})
  • PR body: what was changed and why, references the issue
  • Assigned reviewer: hermes
  • Tests must pass before PR is opened

Scope

  • New script: ~/.hermes/bin/kimi-loop.sh
  • Kimi workspace setup with kimi git identity
  • Cron or tmux session to run it
## What Kimi needs a simple loop (cron or tmux-based) that: 1. Polls Gitea for issues assigned to `kimi` 2. Picks the highest priority one 3. Creates branch `kimi/issue-{number}` 4. Does the work in its own worktree 5. Runs tests (`tox -e unit`) 6. Pushes the branch 7. Opens a PR (authored by kimi, assigned to hermes for review) ## Design ```bash # Kimi's loop (simplified) while true; do # Find assigned issues issues=$(curl "...?assignee=kimi&state=open") if [ -n "$issues" ]; then # Pick top issue # Create worktree at ~/worktrees/kimi-{issue} # Run kimi CLI with the issue as context # Push and PR fi sleep 120 # Check every 2 minutes done ``` ## Kimi's Git Identity The workspace must use kimi's own credentials: ``` git config user.name "kimi" git config user.email "kimi@localhost" # Push URL includes kimi's token for auth ``` Token: `~/.hermes/kimi_token` ## What Kimi's PR Should Look Like - Branch: `kimi/issue-{number}-{slug}` - PR title: `[kimi] {issue title} (#{number})` - PR body: what was changed and why, references the issue - Assigned reviewer: hermes - Tests must pass before PR is opened ## Scope - New script: `~/.hermes/bin/kimi-loop.sh` - Kimi workspace setup with kimi git identity - Cron or tmux session to run it
Author
Collaborator

Issue #228 is complete. The kimi agent loop is fully implemented and operational.

What exists:

  • ~/.hermes/bin/kimi-loop.sh — 200+ line script covering the full lifecycle
  • Polls Gitea every 2 minutes for issues assigned to kimi
  • Creates worktrees at ~/worktrees/kimi-{issue} with kimi's git identity
  • Runs kimi CLI with issue context, tests (tox -e unit), and lint (tox -e lint)
  • Pushes branch kimi/issue-{number}, opens PR assigned to hermes for review
  • Comments on issues at each stage (starting work, submitting PR, or reporting failure)
  • Cleans up worktrees after completion
  • Running now in tmux session Kimi (PID active)

Currently active worktrees: kimi-231, kimi-233

All requirements from the issue are met. Closing.

Issue #228 is complete. The kimi agent loop is fully implemented and operational. **What exists:** - `~/.hermes/bin/kimi-loop.sh` — 200+ line script covering the full lifecycle - Polls Gitea every 2 minutes for issues assigned to `kimi` - Creates worktrees at `~/worktrees/kimi-{issue}` with kimi's git identity - Runs kimi CLI with issue context, tests (`tox -e unit`), and lint (`tox -e lint`) - Pushes branch `kimi/issue-{number}`, opens PR assigned to `hermes` for review - Comments on issues at each stage (starting work, submitting PR, or reporting failure) - Cleans up worktrees after completion - Running now in tmux session `Kimi` (PID active) **Currently active worktrees:** `kimi-231`, `kimi-233` All requirements from the issue are met. Closing.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#228