Repository navigation
fix(infra): spend alerts count usage before credits - #1221
Merged
Merged
Conversation
While AWS credits pay the bill, a budget that counts them reads $0 spent, so neither the $300 nor the $600 forecast alert could fire. Both now count usage before credits: they warn about how fast credits are spent, and keep working unchanged once credits run out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 of 2 tasks
allisonmahmood
added a commit
that referenced
this pull request
Nov 3, 2026
…tals stay exact (#1222) ## What changed This adds release 35's What's new entry, written from `dd0e2ec`. It covers everything merged since release 34's `through` (`e5334ca`), and sets the `patchy` release to `0.35.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | Fixed: keyboard shortcuts in patches do what they say (a once-per-press shortcut doesn't fire again while held, shortcuts wait during input-method composition, symbol keys such as `+` work on every keyboard) | #1152 | | Improved: agents keep shared totals exact | #1184 | The rest get no line: - #1147, #1154, #1189, #1155, #1172 and #1153 are `pnpm dev eval` tooling. - #1150 renames a CI check. - #1203 is an internal docs paragraph. - #1221 changes the production spend alerts, which nobody using Patchy sees. - #1149 is release 34's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `11dc68b` (release 34) to `dd0e2ec`:** - None of the 11 PRs is labelled `one-way`, and each one's Release impact answers say a revert leaves nothing behind. - #1152 changes `patchy/hotkeys`, which patches bundle when they are built. Published patches keep the copy they bundled. A patch repo that writes `"+"` stops typechecking only if it moves back to an older `patchy` release. - #1184 is skill text. #1147 adds a dev-only personas option that production never reads. - #1221 changes a cost setting on the two budgets in the base stack. Releases don't read budgets. - Nothing else touches code that runs in production. **Rollback line:** If this release misbehaves, roll back to `11dc68b` (release 34). ## How it was verified - **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and `schemas.test.ts` pass (21 tests), and `bun fmt` passes on the changed files. - **Deploy state.** I pinned the live commit from `/healthz/deep`: `11dc68b` (release 34). The Deploy run updated last succeeded, and none is unfinished. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Text and version numbers only. Like every release, the `0.35.0` bump tells CLIs and patch repos installed before this deploy to upgrade. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The production spend alerts email when the month's forecast passes $300 or $600. Both budgets counted AWS credits, which is the default, so while credits pay the bill they read $0 spent and can never fire. Both now count usage before credits. That way they warn about how fast credits are being spent, and they keep working unchanged once the credits run out.
Look at
One property on each budget, no replacement.
costTypes: { includeCredit: false }is part of each budget'sBudgetproperty, which CloudFormation updates in place ("Update requires: No interruption"). Only a change toNotificationsWithSubscribersreplaces a budget, so the deploy keeps both names and their subscribers. The synthesized production base stack shows the only change:The other cost types keep their defaults. Budgets treats every omitted
CostTypesfield as its default, so tax, refunds, support and the rest still count.Right after the deploy the alerts may read $0 for a while. AWS resets a budget's calculated spend when the budget is updated, and recomputes it as fresh usage data arrives (UpdateBudget). So don't count on either alert until the budgets show spend again.
docs/adr/ADR-0012-credential-free-execution-service.mdnamed only the $300 budget. It now names both, and says they count usage before credits.How it was verified
vitest run apps/infra/src/stacks.test.ts: 8 passed. The budget case now also pinsCostTypes: { IncludeCredit: false }on both budgets.cdk synthof the example production stacks, shown above.Release impact
Infrastructure only: one cost-type setting on each of the two production budgets.
Made by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, running in T3 Code.