Skip to content

fix(commit): timeout AI and compact large diffs - #17

Merged
kooksee merged 3 commits into
mainfrom
fix/commit-hang-timeout
Aug 11, 2026
Merged

fix(commit): timeout AI and compact large diffs#17
kooksee merged 3 commits into
mainfrom
fix/commit-hang-timeout

Conversation

@kooksee

@kooksee kooksee commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add 45s OpenAI HTTP + commit AI timeouts with rule-based fallback so spinner no longer hangs forever
  • Compact oversized staged diffs before AI prompts (size/file caps, skip lockfiles/binaries)
  • Soft-reset quick-update commits only when they actually exist (avoid no-op reset --soft HEAD)

Test plan

  • go test ./cmds/fastcommitcmd/... ./pkg/aiprovider/...
  • Stage a tiny change and run fastgit commit --single --skip-check (should prompt normally)
  • Stage a very large diff / many files and confirm log shows abbreviated patch, then still produces a message
  • Confirm no git reset --soft <HEAD> when latest commit is not chore: quick update ...

Made with Cursor

kooksee and others added 3 commits August 11, 2026 20:50
Prevent hang/blowups on oversized staged diffs by abbreviating prompts, adding OpenAI timeouts, and only soft-resetting when quick-update commits exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Reorder check before soft-reset squash, commit messages via direct git exec, replace os.Exit on push rejection, and warn on pull --hard with dirty trees.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kooksee
kooksee merged commit d9b7a6f into main Aug 11, 2026
1 check passed
@kooksee
kooksee deleted the fix/commit-hang-timeout branch August 11, 2026 13:27
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.

1 participant