Skip to content

fix: bound prepare-commit-msg hook latency (#271) - #322

Merged
404-Page-Found merged 34 commits into
mainfrom
fix/prepare-hook-timeout-271
Sep 22, 2026
Merged

404-Page-Found merged 34 commits into
mainfrom
fix/prepare-hook-timeout-271

Conversation

@404-Page-Found

@404-Page-Found 404-Page-Found commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Closes #271

What changed

  • Adds a 5-second overall deadline to the prepare-commit-msg hook.
  • Propagates cancellation into provider requests so timed-out LLM calls are aborted.
  • Keeps provider request timeouts active through response-body consumption.
  • Adds regressions for stalled hook generation and stalled response bodies.

The hook leaves the existing commit message unchanged on timeout and clears pending hook state.

Review in cubic

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 5a6c83a5-536e-4e8a-9cf5-6ab5a086f64b

📥 Commits

Reviewing files that changed from the base of the PR and between 335fda8 and c8bf5c8.

📒 Files selected for processing (10)
  • src/git/diff.ts
  • src/git/hook.ts
  • src/llm/client.ts
  • src/providers/anthropic.ts
  • src/providers/cohere.ts
  • src/providers/openai-compatible.ts
  • src/providers/request.ts
  • src/types.ts
  • tests/hook.test.mjs
  • tests/provider-timeout.test.mjs

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread src/git/hook.ts Outdated
Comment thread src/git/hook.ts Outdated
Comment thread src/providers/request.ts Outdated
Comment thread tests/provider-timeout.test.mjs
Comment thread src/git/hook.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Shadow auto-approve: would not auto-approve because issues were found.
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/git/hook.ts Outdated
Comment thread tests/hook.test.mjs Outdated
Comment thread tests/provider-timeout.test.mjs
Comment thread src/git/hook.ts Outdated
@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 5 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would require human review. Adds a 5s deadline to the prepare-commit-msg hook and keeps provider timeouts active through body consumption; the timeout values and fallback behavior are operational tradeoffs needing human sign-off.

Re-trigger cubic

@404-Page-Found
404-Page-Found merged commit d63006f into main Sep 22, 2026
7 checks passed
@404-Page-Found
404-Page-Found deleted the fix/prepare-hook-timeout-271 branch September 22, 2026 04:38
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.

[Bug] prepare-commit-msg hook blocks every commit on LLM latency with no overall timeout

1 participant