Skip to content

feat(engine): push run branch to remote on loop_restart#6

Merged
danshapiro merged 1 commit into
danshapiro:mainfrom
mvanhorn:feat/git-push-on-loop-restart
Feb 10, 2026
Merged

feat(engine): push run branch to remote on loop_restart#6
danshapiro merged 1 commit into
danshapiro:mainfrom
mvanhorn:feat/git-push-on-loop-restart

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented Feb 9, 2026

Summary

  • Adds optional git.push_remote config field to run config
  • Pushes the run branch to the configured remote on each loop_restart (before starting fresh iteration) and on terminal outcome persistence
  • Push is best-effort: failures are logged as warnings + progress events (git_push_start, git_push_ok, git_push_failed) but never abort the run
  • Adds gitutil.PushBranch helper and Engine.gitPushIfConfigured method

Motivation

During long-running autonomous pipeline executions (e.g., feature factories that loop for hours), all committed work lives only on the local run branch until the user manually pushes. If the machine dies, hours of work are lost. This change ensures completed work is pushed to a remote after each successful loop iteration.

Usage

git:
  push_remote: origin  # optional; omit to disable auto-push

Test plan

  • TestGitPushIfConfigured_NoPushRemote - no-op when push_remote is empty
  • TestGitPushIfConfigured_NilRunConfig - no-op when config is nil
  • TestGitPushIfConfigured_NilEngine - no-op on nil receiver
  • TestGitPushIfConfigured_PushesToRemote - verifies branch appears on bare remote
  • TestLoopRestart_PushesOnRestart - full integration: loop_restart triggers push to bare remote
  • go vet clean
  • go build ./... clean

🤖 Generated with Claude Code

…outcome

Add best-effort git push support so completed work is pushed to a configured
remote after each loop_restart (feature completion) and on terminal outcome.
This prevents data loss during long-running autonomous pipeline executions.

New config field: git.push_remote (optional, string)
New progress events: git_push_start, git_push_ok, git_push_failed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danshapiro danshapiro merged commit 9e8ff89 into danshapiro:main Feb 10, 2026
@danshapiro
Copy link
Copy Markdown
Owner

🎉 This is fantastic work! The best-effort push design is exactly right — protecting long-running autonomous runs from data loss without ever risking an abort on push failure is a really elegant approach.

The defensive nil checks, the clean progress event lifecycle (git_push_startgit_push_ok/git_push_failed), and the thorough test coverage (including the full loop_restart integration test) are all top-notch.

I added a small hardening commit on top:

  • 2-minute timeout on git push via exec.CommandContext so a network stall or stuck credential prompt can't hang the run
  • GIT_TERMINAL_PROMPT=0 to prevent interactive auth prompts from blocking
  • Documented push_remote in kilroy-metaspec.md so the schema stays in sync

All tests passing. Merged — great contribution! 🚀

— Codex

danshapiro pushed a commit that referenced this pull request Feb 14, 2026
- Fix #1: goreleaser check now uses command -v guard, not error masking
- Fix #2: remove hardcoded occurrence counts from commit message
- Fix #3: add Safety section update to release skill edits
- Fix #4: add RELEASE_NOTES.md mechanism for hand-crafted release notes
- Fix #5: add version_test.go for --version output coverage
- Fix #6: use fully qualified brew install danshapiro/kilroy/kilroy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants