Skip to content

Make source-control AI timeout configurable#7928

Open
sdhilip200 wants to merge 1 commit into
stablyai:mainfrom
sdhilip200:fix/commit-message-timeout
Open

Make source-control AI timeout configurable#7928
sdhilip200 wants to merge 1 commit into
stablyai:mainfrom
sdhilip200:fix/commit-message-timeout

Conversation

@sdhilip200

Copy link
Copy Markdown
Contributor

Summary

  • Make source-control AI timeout configurable with ORCA_SOURCE_CONTROL_AI_TIMEOUT_MS
  • Keep the default at 60 seconds and clamp configured values to 30-300 seconds
  • Apply the resolved timeout to local/remote model discovery and generation paths

Closes #7865

Test plan

  • pnpm exec vitest run --config config/vitest.config.ts src/main/text-generation/commit-message-text-generation.test.ts
  • pnpm exec oxfmt --check src/main/text-generation/commit-message-text-generation.ts src/main/text-generation/commit-message-text-generation.test.ts
  • pnpm exec oxlint src/main/text-generation/commit-message-text-generation.ts src/main/text-generation/commit-message-text-generation.test.ts
  • pnpm run typecheck
  • pnpm run build:desktop
  • git diff --check

Notes

  • No visual change.
  • pnpm run lint still fails on an unrelated pre-existing switch exhaustiveness issue in src/main/ipc/notification-authorization-status.ts:76.
  • Full pnpm test was interrupted after unrelated runtime/socket/daemon failures.

Review checklist

  • Local, remote, and SSH-backed source-control generation use the same timeout resolver.
  • Unsupported or missing timeout values fall back to the default.
  • Timeout values outside the supported range are clamped before use.
  • No release metadata or version files changed.
  • X handle: not provided.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0a62a21e-d8c3-44e5-8ff5-f328436be735

📥 Commits

Reviewing files that changed from the base of the PR and between 06afbc4 and ab7ae2b.

📒 Files selected for processing (2)
  • src/main/text-generation/commit-message-text-generation.test.ts
  • src/main/text-generation/commit-message-text-generation.ts

📝 Walkthrough

Walkthrough

This change replaces a fixed generation timeout constant with a configurable timeout resolved from the ORCA_SOURCE_CONTROL_AI_TIMEOUT_MS environment variable via a new exported resolveSourceControlGenerationTimeoutMs function, which clamps values between defined min/max bounds and falls back to a default when unset or invalid. Local and remote model discovery and commit-message/text generation paths are updated to compute and use this resolved timeout, with timeout error messages now formatted via a new formatTimeoutSeconds helper. Corresponding tests are added covering timeout resolution edge cases and remote generation timeout behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, testing, and notes, but it omits required Screenshots, AI Review Report, and Security Audit sections. Add the missing template sections and briefly summarize the AI review and security audit; include screenshots or state 'No visual change'.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making the source-control AI timeout configurable.
Linked Issues check ✅ Passed The code matches #7865 by adding a configurable timeout, preserving the 60s default, and clamping values to 30–300s.
Out of Scope Changes check ✅ Passed The changes stay focused on timeout configuration and tests, with no obvious unrelated code or metadata edits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

[Feature]: make commit message generation timeout configurable

1 participant