Summary
The prepare-commit-msg hook runs buildProfile() + generateSuggestions() synchronously inside the git commit path. The hook has no overall deadline of its own — a slow or stalled provider delays every commit for up to the per-request timeout (30s, src/providers/request.ts:1), and a provider outage adds seconds of latency to each commit before degrading to a warning. To an end user, git commit appears to hang.
Location
src/git/hook.ts:196-208 — runPrepareCommitMsgHook: LLM calls block commit
src/providers/request.ts:1 — DEFAULT_PROVIDER_REQUEST_TIMEOUT_MS = 30_000
Code snippet
// src/git/hook.ts (inside prepare-commit-msg, blocks `git commit`)
const profile = await deps.buildProfile(config.historySize);
const { suggestions } = await deps.generateSuggestions(config, diffResult.diff, profile);
const selected = suggestions[0];
...
await deps.writeMessageFile(args.messageFile, nextContent);
Suggested fix
Give the hook a tight overall deadline (e.g. abort suggestion generation after a few seconds and leave the commit message unchanged), so provider slowness can never block a commit for the full 30s. Consider also skipping the LLM call entirely when the provider appears unreachable (fast health check) or when --no-verify semantics apply.
Impact
- Every commit's latency is coupled to LLM provider health; a hung provider stalls all commits for up to 30s each.
- Users who install the hook and later hit a provider outage perceive git itself as broken.
Summary
The
prepare-commit-msghook runsbuildProfile()+generateSuggestions()synchronously inside the git commit path. The hook has no overall deadline of its own — a slow or stalled provider delays every commit for up to the per-request timeout (30s,src/providers/request.ts:1), and a provider outage adds seconds of latency to each commit before degrading to a warning. To an end user,git commitappears to hang.Location
src/git/hook.ts:196-208—runPrepareCommitMsgHook: LLM calls block commitsrc/providers/request.ts:1—DEFAULT_PROVIDER_REQUEST_TIMEOUT_MS = 30_000Code snippet
Suggested fix
Give the hook a tight overall deadline (e.g. abort suggestion generation after a few seconds and leave the commit message unchanged), so provider slowness can never block a commit for the full 30s. Consider also skipping the LLM call entirely when the provider appears unreachable (fast health check) or when
--no-verifysemantics apply.Impact