René's URL Explorer Experiment


Title: chore(coderd/database): drop deferred chat spend and cost columns · Issue #27600 · coder/coder · GitHub

Open Graph Title: chore(coderd/database): drop deferred chat spend and cost columns · Issue #27600 · coder/coder

X Title: chore(coderd/database): drop deferred chat spend and cost columns · Issue #27600 · coder/coder

Description: Context The chat-cost stack (#27328, #27329, #27330) removed native chat usage limits and native chat cost tracking, leaving AI Gateway data and budgets as the only path. Three physical columns, one table, and one index were deliberately...

Open Graph Description: Context The chat-cost stack (#27328, #27329, #27330) removed native chat usage limits and native chat cost tracking, leaving AI Gateway data and budgets as the only path. Three physical columns, on...

X Description: Context The chat-cost stack (#27328, #27329, #27330) removed native chat usage limits and native chat cost tracking, leaving AI Gateway data and budgets as the only path. Three physical columns, on...

Opengraph URL: https://github.com/coder/coder/issues/27600

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"chore(coderd/database): drop deferred chat spend and cost columns","articleBody":"## Context\n\nThe chat-cost stack (#27328, #27329, #27330) removed native chat usage limits and native chat cost tracking, leaving AI Gateway data and budgets as the only path. Three physical columns, one table, and one index were deliberately left in place for one release so a replica still running the previous release keeps working during a rolling upgrade.\n\n`users.sql` and `groups.sql` use `SELECT *`, so sqlc bakes every column into explicit column lists in `GetUserByID`, `GetUserByEmailOrUsername`, `GetUsersByIDs`, `GetGroupByID`, `GetGroupByOrgAndName`, and `GetGroups`. Dropping the `users` and `groups` columns in the same release would have failed broad authorization, audit, and API-key reads on an old replica, not just the usage-limit admin screens. Dropping `chat_messages.total_cost_micros` would have broken `InsertChatMessages`, and therefore every chat message insert.\n\n`chat_usage_limit_config` and `idx_chat_messages_owner_spend` were kept for the same reason: an old replica still serves `getMyChatUsageLimitStatus`, which reads that table through `chatd.ResolveUsageLimitStatus` and runs `GetUserChatSpendInPeriod` behind that index. Dropping the table would 500 that handler (it tolerates only `sql.ErrNoRows`); dropping the index would leave a per-minute-polled path scanning `chat_messages`.\n\nNothing in the application reads any of these as of #27330.\n\n## Scope\n\nDrop in a single migration:\n\n- [ ] `users.chat_spend_limit_micros` and `users_chat_spend_limit_micros_check`\n- [ ] `groups.chat_spend_limit_micros` and `groups_chat_spend_limit_micros_check`\n- [ ] `chat_messages.total_cost_micros`\n- [ ] `chat_usage_limit_config` (table, plus its sequence and three check constraints)\n- [ ] `idx_chat_messages_owner_spend`\n\nThen:\n\n- [ ] Delete the two `\"chat_spend_limit_micros\": ActionTrack` entries in `enterprise/audit/table.go` (the `&database.User{}` and `&database.AuditableGroup{}` maps). They exist only because `entry()` exits the process at package init for any JSON-tagged field without an action, so they must go with the columns.\n- [ ] Remove the `&i.ChatSpendLimitMicros` scan from `GetAuthorizedUsers` in `coderd/database/modelqueries.go`, which is hand-maintained and must match generated `GetUsers`.\n- [ ] `make gen`, then confirm `check_constraint.go` loses both check constants and the three `chat_usage_limit_config` ones, `unique_constraint.go` loses its primary key, and `models.go` loses both fields and the now-unused `ChatUsageLimitConfig` struct.\n- [ ] Deleting a migration does not invalidate the mtime-gated `dump.sql` target, so if the drop is ever reverted, `touch` a migration that creates the object before regenerating.\n\n## Notes\n\n- Choose the migration number at authoring time against `origin/main`, not now. Also note that stacked PRs target their parent branch, so a duplicate migration number passes CI green; compare against `origin/main` directly before pushing.\n- Operators who still want their old native caps should read these columns out of the database before this lands. #27329 did not migrate configured values into `group_ai_budgets`: period semantics do not map (native supported day/week/month, gateway budgets are month-only), group resolution picks the highest budget where native limits took the minimum, and `user_ai_budget_overrides.group_id` is `NOT NULL` so a groupless native user override has no destination.\n\n> Mux filed this issue on Mike's behalf.\n\n","author":{"url":"https://github.com/ibetitsmike","@type":"Person","name":"ibetitsmike"},"datePublished":"2026-07-28T16:49:18Z","url":"https://github.com/coder/coder/issues/27600"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:784fc360-a033-e3cc-6641-cb9ea7d63659
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC996:2AAD2E:189E35A:20D8EC9:6B014E6A
html-safe-nonce8ef5d7cb45b492886867e8ba4f22f11600779382ff98f07f70820884ec4f276e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTk2OjJBQUQyRToxODlFMzVBOjIwRDhFQzk6NkIwMTRFNkEiLCJ2aXNpdG9yX2lkIjoiNzY0NjE0NjQyODQ5Mzk3NTE0NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacccaa08e10e51d1a27cc3fa4e790505fa0e7cc35c078fc71a1acda2e5b0cda392
hovercard-subject-tagissue:5001002207
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/27600/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d8bb69e5d500edce80cc14c8643fb3afc220f76aca3a43c0f27b9f50d1f9eb38/coder/coder/issues/27600
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d8bb69e5d500edce80cc14c8643fb3afc220f76aca3a43c0f27b9f50d1f9eb38/coder/coder/issues/27600
og:image:altContext The chat-cost stack (#27328, #27329, #27330) removed native chat usage limits and native chat cost tracking, leaving AI Gateway data and budgets as the only path. Three physical columns, on...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameibetitsmike
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/coder/coder/issues/27600#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F27600
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F27600
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/issues/27600
Reloadhttps://github.com/coder/coder/issues/27600
Reloadhttps://github.com/coder/coder/issues/27600
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues320 (320)https://github.com/coder/coder/issues
Pull requests469 (469)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
https://github.com/coder/coder
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/27600
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/27600
chore(coderd/database): drop deferred chat spend and cost columnshttps://github.com/coder/coder/issues/27600#top
https://github.com/ibetitsmike
ibetitsmikehttps://github.com/ibetitsmike
on Jul 28, 2026https://github.com/coder/coder/issues/27600#issue-5001002207
#27328https://github.com/coder/coder/pull/27328
#27329https://github.com/coder/coder/pull/27329
#27330https://github.com/coder/coder/pull/27330
#27330https://github.com/coder/coder/pull/27330
feat: remove native chat usage limits in favor of AI Gateway budgets #27329https://github.com/coder/coder/pull/27329
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Jul 28, 2026https://github.com/coder/coder/issues/27600#issuecomment-5107112253
Linear Codehttps://linear.app
ENG-3103https://linear.app/codercom/issue/ENG-3103
ibetitsmikehttps://github.com/ibetitsmike
on Jul 29, 2026https://github.com/coder/coder/issues/27600#event-28651866978
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/4a440cb2e1c9323ab335c62969a11952f584814c
4a440cbhttps://github.com/coder/coder/commit/4a440cb2e1c9323ab335c62969a11952f584814c
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/7c89a436cb3e02c99656d94f4432cac8fa034262
7c89a43https://github.com/coder/coder/commit/7c89a436cb3e02c99656d94f4432cac8fa034262
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/03cf06ce329d7b58f05c3340a994f1b79c16e861
03cf06chttps://github.com/coder/coder/commit/03cf06ce329d7b58f05c3340a994f1b79c16e861
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/943343b7aec9135ee53586a648a350c545d56b6f
943343bhttps://github.com/coder/coder/commit/943343b7aec9135ee53586a648a350c545d56b6f
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/06940e45740c34207d020471bc01254f5cb15eeb
06940e4https://github.com/coder/coder/commit/06940e45740c34207d020471bc01254f5cb15eeb
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/b642d5f5eff317fb26124ef447059ca59ba48a5a
b642d5fhttps://github.com/coder/coder/commit/b642d5f5eff317fb26124ef447059ca59ba48a5a
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/d2ffe026c5f7055263e3b5f945e287903abbd4b9
d2ffe02https://github.com/coder/coder/commit/d2ffe026c5f7055263e3b5f945e287903abbd4b9
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/83ff547d3903cb40001a283adac3f1a1731ac985
83ff547https://github.com/coder/coder/commit/83ff547d3903cb40001a283adac3f1a1731ac985
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/b9758b637f55fdd73ac30159585cd5d6a92b670c
b9758b6https://github.com/coder/coder/commit/b9758b637f55fdd73ac30159585cd5d6a92b670c
feat: remove native chat usage limits in favor of AI Gateway budgetshttps://github.com/coder/coder/commit/d8ed2f3f5fa166a9a5defa98264a0ab800533927
d8ed2f3https://github.com/coder/coder/commit/d8ed2f3f5fa166a9a5defa98264a0ab800533927
feat: remove native chat usage limits in favor of AI Gateway budgets (#…https://github.com/coder/coder/commit/f0e6ac64b377928d35008896d67051e4972257f7
#…https://github.com/coder/coder/pull/27329
f0e6ac6https://github.com/coder/coder/commit/f0e6ac64b377928d35008896d67051e4972257f7
feat: remove native chat cost tracking in favor of AI Gateway cost da…https://github.com/coder/coder/commit/6b8f8204933cf5896c6416e3fb567fc2194d7409
6b8f820https://github.com/coder/coder/commit/6b8f8204933cf5896c6416e3fb567fc2194d7409
linear-codehttps://github.com/apps/linear-code
not plannedhttps://github.com/coder/coder/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Nov 18, 2026https://github.com/coder/coder/issues/27600#event-36543430478
Sign up for freehttps://github.com/signup?return_to=https://github.com/coder/coder/issues/27600
Sign in to commenthttps://github.com/login?return_to=https://github.com/coder/coder/issues/27600
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.