Skip to content

fix: increase default LLM enrichTimeout from 5s to 8s (GIT-95)#64

Merged
TonyCasey merged 2 commits intomainfrom
git-95
Feb 14, 2026
Merged

fix: increase default LLM enrichTimeout from 5s to 8s (GIT-95)#64
TonyCasey merged 2 commits intomainfrom
git-95

Conversation

@TonyCasey
Copy link
Copy Markdown
Owner

@TonyCasey TonyCasey commented Feb 14, 2026

Summary

  • Increased default enrichTimeout from 5000ms to 8000ms for the commit-msg hook
  • LLM API calls were timing out at 5 seconds, causing fallback to heuristic analysis
  • Kept under 10 seconds to respect the hook's hard timeout (setupShutdown(10_000))

Root Cause

Recent commits (6d1e0c0, b233c4a, a65346f, 69358ca) had AI-Source: heuristic instead of llm-enrichment because the LLM API was timing out before returning results.

Test Plan

  • Unit tests pass
  • Integration tests pass
  • Manual test with commit-msg hook confirms LLM enrichment works with new timeout

Closes GIT-95

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Updated default commit message enrichment timeout from 5000ms to 8000ms to improve reliability.
  • Documentation

    • Clarified timeout constraints: commit message enrichment timeout must remain under the 10-second hook timeout limit.

Copilot AI review requested due to automatic review settings February 14, 2026 22:59
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

Default commitMsg.enrichTimeout changed from 5000 ms to 8000 ms in internal defaults and documentation; no API or control-flow changes.

Changes

Cohort / File(s) Summary
Defaults (config)
src/hooks/utils/config.ts
Updated internal default: commitMsg.enrichTimeout 5000 → 8000 (ms).
Interface / Docs
src/domain/interfaces/IHookConfig.ts
Updated documentation for ICommitMsgConfig.enrichTimeout to reflect new default (8000 ms) and note constraint that it must be below hook timeout (~10s).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: increasing the default enrichTimeout from 5s to 8s, which matches the file modifications and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch git-95

No actionable comments were generated in the recent review. 🎉


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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the default configuration for the commit-msg hook’s LLM enrichment timeout to reduce unintended fallbacks to heuristic analysis during slower LLM responses.

Changes:

  • Increased the default enrichTimeout for hooks.commitMsg from 5000ms to 15000ms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/hooks/utils/config.ts Outdated
defaultLifecycle: 'project',
enrich: true,
enrichTimeout: 5000,
enrichTimeout: 15000,
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

enrichTimeout default was updated to 15000ms here, but the inline documentation in src/domain/interfaces/IHookConfig.ts still says "Default: 5000." Please update that comment (and any other user-facing config docs) to match the new default to avoid confusion.

Suggested change
enrichTimeout: 15000,
enrichTimeout: 15000, // Default: 15000 ms

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This has been addressed - I amended the commit to change the value from 15s to 8s, which is safely under the 10s hook hard timeout. The current default is now 8000ms.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed - updated the documentation comment in IHookConfig.ts to say 'Default: 8000. Must be under hook timeout (10s).'

The commit-msg hook was falling back to heuristic analysis because
the LLM API calls were timing out at the 5 second default. Anthropic
API calls typically take 2-5 seconds but can take longer during high
load.

Increased to 8 seconds (not higher) because the hook itself has a
10 second hard timeout via setupShutdown() - must leave buffer for
the rest of the hook processing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AI-Agent: Claude-Code/2.1.42
AI-Model: claude-opus-4-5-20251101
AI-Decision: the LLM API calls were timing out at the 5 second default
AI-Confidence: medium
AI-Tags: hooks, utils, pattern:because-clause
AI-Lifecycle: project
AI-Memory-Id: 6c4a23e2
AI-Source: heuristic
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/hooks/utils/config.ts`:
- Line 54: The default commitMsg.enrichTimeout (currently 15000) exceeds the
hook runner hard shutdown (~10000ms), so clamp the default to the hard limit:
change the commitMsg.enrichTimeout default to use the shutdown constant (or
Math.min(15000, HOOK_SHUTDOWN_MS / 1000 where units apply) so it never exceeds
the value used in setupShutdown()), or alternatively set the hard timeout
variable used by setupShutdown() to >=15000 if you intend a longer real limit;
also add a brief comment next to commitMsg.enrichTimeout explaining the cap to
avoid misleading configuration.

Comment thread src/hooks/utils/config.ts Outdated
@TonyCasey TonyCasey changed the title fix: increase default LLM enrichTimeout from 5s to 15s (GIT-95) fix: increase default LLM enrichTimeout from 5s to 8s (GIT-95) Feb 14, 2026
AI-Agent: Claude-Code/2.1.42
AI-Model: claude-opus-4-5-20251101
AI-Decision: The default enrichTimeout for LLM enrichment calls was changed from 5000ms to 8000ms, and there's a constraint that it must be under the hook timeout of 10 seconds.
AI-Confidence: verified
AI-Tags: ihookconfig, timeout, llm-enrichment, configuration, hook-constraints
AI-Lifecycle: project
AI-Memory-Id: 7f8d8075
AI-Source: llm-enrichment
Copilot AI review requested due to automatic review settings February 14, 2026 23:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TonyCasey TonyCasey merged commit ba59134 into main Feb 14, 2026
9 checks passed
@TonyCasey TonyCasey deleted the git-95 branch February 14, 2026 23:26
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