You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Title: [Bug] AI commit message fails with 429 rate_limit_exceeded on small changes after a large change fails in another project #2893
Description:
When using the AI commit message generation feature, if it fails on a massive commit in one project, the failure seems to "poison" the context cache globally. After the initial failure, generating a commit message for a very small change in a completely different project also fails with the exact same 429 (tokens: rate_limit_exceeded) error.
Based on the token count in the error message (e.g., requested 1344+ tokens for a tiny frontend change), the client or backend is clearly caching and sending the massive diff from the previous failed attempt across different projects, rather than clearing the context and strictly sending only the currently staged files.
Steps to Reproduce:
In Project A, make a massive code modification (e.g., huge backend Java file updates).
Stage the changes and click to generate an AI commit message. It fails (likely due to the diff being too large).
Switch to Project B (a completely different project).
Make a very small modification (e.g., a few lines of front-end Vue code) and stage only this small file.
Click to generate the AI commit message in Project B.
Observe the error: HTTP 429 (tokens: rate_limit_exceeded) Request too large for model...
Expected Behavior:
The AI commit message prompt should be strictly stateless and isolated per request. It should clear any previous conversational context, cache, or failed diffs—especially across different projects—to prevent token limit exhaustion. The prompt should only contain the git diff --cached for the current project.
Actual Behavior:
The prompt caches or mixes in the massive diff from the previously failed attempt in Project A, causing the tiny request in Project B to exceed the model's token limits.
Environment:
OS: [Windows 11]
Git Client Version: [v2026.24]
AI Model Used: qwen/qwen3.8-27b (via OpenRouter/API)
Activity
love-linger commentedon Nov 18, 2026
实际上每次执行生成命令,SourceGit 都创建一个新的 OpenAIClient。目前并不清楚为什么你那里会有缓存。