fix: remove chatd usage limit enforcement (#27535) - #27599
Conversation
This PR surgically removes enforcement of Agents spend limits: - Adjusts the relevant function that checks usage to always return nil - Deletes tests that expect a usage limit error. (cherry picked from commit 75fd7bc)
Documentation CheckRemoving chatd usage-limit enforcement is a user-visible behavior change: the published docs still state that Coder Agents blocks messages when a user's spend limit is reached. Those statements are now inaccurate. Updates Needed
Notes
Automated review via Coder Agents |
There was a problem hiding this comment.
Pull request overview
This PR removes chat usage-limit (budget) enforcement from chatd by turning the server-side limit check into a no-op and deleting tests that asserted limit-exceeded behavior, aligning enforcement responsibility with the AI Gateway.
Changes:
- Replace
Server.checkUsageLimitwith a no-op implementation that always allows chat operations. - Delete/trim unit and integration tests that expected
UsageLimitExceededfailures. - Remove gomock expectations for
GetChatUsageLimitConfigin internal chatd title-generation tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| coderd/x/chatd/chatd.go | Makes checkUsageLimit always return nil, delegating enforcement to AI Gateway. |
| coderd/x/chatd/chatd_test.go | Removes chatd runtime tests that assert operations are rejected at the usage limit. |
| coderd/exp_chats_test.go | Removes API-level tests that assert chat endpoints return “usage limit exceeded” responses. |
| coderd/x/chatd/chatd_internal_test.go | Removes usage-limit config DB expectations that are no longer triggered. |
| coderd/x/chatd/title_override_internal_test.go | Removes usage-limit config DB expectation in title override tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR surgically removes enforcement of Agents spend limits:
(cherry picked from commit 75fd7bc)