Skip to content

fix(web): lower AMR low-balance warning threshold - #5349

Merged
AmyShang-alt merged 7 commits into
mainfrom
codex/amr-low-balance-threshold
Jul 9, 2026
Merged

fix(web): lower AMR low-balance warning threshold#5349
AmyShang-alt merged 7 commits into
mainfrom
codex/amr-low-balance-threshold

Conversation

@open-design-crew

@open-design-crew open-design-crew Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Why

While tuning the Open Design Cloud pre-run balance warning, the previous soft-warning threshold was too broad: users with a few dollars remaining were interrupted even though they could often still start a task. This PR narrows that reminder so it only appears when the wallet is closer to empty.

The pain addressed is unnecessary friction before launching an Open Design Cloud task. Hard blocks still protect accounts that cannot fund a run, while the dismissible warning now targets the lower-balance range. For free users, the soft warning should also point at the next best action: upgrading the plan rather than presenting top-up as the only primary path.

What users will see

Open Design Cloud users will only see the low-balance soft reminder when their balance is at or below $2.00. A balance of $2.01 or higher starts without that warning. The $0 hard-block behavior is unchanged.

When a free user hits the low-balance soft reminder, the primary CTA now reads "Upgrade plan" and opens the plans view. Paid users still see the existing top-up CTA.

Surface area

  • UI — new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack / tools-pr flag, or new OD_* env var
  • API / contract — new /api/* endpoint, new SSE event, or changed shape in packages/contracts
  • Extension point — new entry under skills/, design-systems/, design-templates, or craft/, or change to the skills protocol
  • i18n keys — added new translation keys (see TRANSLATIONS.md for the locale workflow)
  • New top-level dependency — adding any new entry to the root package.json (dependencies or devDependencies); workspace-package package.json files are out of scope. Include a paragraph on what we get vs. what bytes we ship (see CONTRIBUTING.md → Code style)
  • Default behavior change — changes what existing users experience without opting in (default model, default setting, file/SQLite schema, auto-network on startup, auto-install)
  • None — internal refactor, docs, tests, or translation update only

Screenshots

Not applicable. This changes when the existing low-balance dialog appears and which primary CTA free users see; it does not add a new UI surface.

Bug fix verification

  • Not a bug fix. This is a threshold and CTA tuning change covered by the existing AMR balance gate unit test plus the low-balance dialog component test.

Validation

  • PATH="/Users/mason/.nvm/versions/node/v24.15.0/bin:$PATH" corepack pnpm exec vitest run -c vitest.config.ts tests/components/AmrLowBalanceDialog.test.tsx tests/runtime/amr-balance-gate.test.ts — passed, 15 tests
  • PATH="/Users/mason/.nvm/versions/node/v24.15.0/bin:$PATH" corepack pnpm exec vitest run -c vitest.config.ts tests/components/ProjectView.run-isolation.test.tsx — passed, 41 tests
  • PATH="/Users/mason/.nvm/versions/node/v24.15.0/bin:$PATH" corepack pnpm --filter @open-design/web typecheck — passed
  • git diff --check — passed
  • PATH="/Users/mason/.nvm/versions/node/v24.15.0/bin:$PATH" corepack pnpm guard — failed on pre-existing unrelated guard violations: apps/landing-page/public/enhancers/cobe.js, apps/landing-page/public/enhancers/matter.min.js, tools/pr/, and tools/report/

@lefarcen
lefarcen requested a review from mrcfps July 9, 2026 09:10
@lefarcen lefarcen added size/XS PR changes <20 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix needs-validation Runtime change detected; needs human or /explore agent validation. labels Jul 9, 2026
@lefarcen

lefarcen commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🧪 This PR changes user-visible run gating behavior, so it needs a manual QA pass before merge. Please hold off self-merging for now; we'll loop QA in once it's merge-ready.

@mrcfps mrcfps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@app/open-design-crew I reviewed the changed AMR balance-gate threshold and its focused unit test updates. The runtime now warns at or below $2.00 and allows $2.01+, while the existing hard-block and opt-out paths remain covered by the surrounding tests. I could not rerun the focused Vitest file in this worktree because dependencies are not installed (vitest is missing from node_modules), but the diff itself is consistent and scoped. Thanks for tightening this warning behavior and keeping the boundary coverage clear.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@lefarcen lefarcen added size/M PR changes 100-300 lines and removed size/XS PR changes <20 lines labels Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Visual regression review

Head: cbccd93 · Base: b335680

10 changed · 43 unchanged · 0 new without baseline · 0 failed

Changed cases

Case Main PR Diff
visual-project-avatar-model-dropdown
4,602 px (0.36%)
main pr diff
visual-project-avatar-model-dropdown-popover
11,353 px (9.58%)
main pr diff
visual-settings-byok-model-dropdown
1,449 px (0.11%)
main pr diff
visual-settings-byok-model-dropdown-popover
1,128 px (0.73%)
main pr diff
visual-settings-local-cli-model-dropdown
1,165 px (0.09%)
main pr diff
visual-settings-local-cli-model-dropdown-popover
1,165 px (0.55%)
main pr diff
visual-topbar-byok-model-dropdown
1,239 px (0.10%)
main pr diff
visual-topbar-byok-model-dropdown-popover
1,239 px (1.57%)
main pr diff
visual-topbar-local-cli-model-dropdown
4,614 px (0.36%)
main pr diff
visual-topbar-local-cli-model-dropdown-popover
9,344 px (7.67%)
main pr diff
Unchanged cases
Case Main PR Diff
visual-avatar-local-agent-list
0 px (0.00%)
main pr diff
visual-avatar-local-agent-list-panel
0 px (0.00%)
main pr diff
visual-avatar-menu
0 px (0.00%)
main pr diff
visual-avatar-menu-panel
0 px (0.00%)
main pr diff
visual-avatar-open-design-account
0 px (0.00%)
main pr diff
visual-critical-settings
0 px (0.00%)
main pr diff
visual-critical-workspace
0 px (0.00%)
main pr diff
visual-critical-workspace-preview
0 px (0.00%)
main pr diff
visual-design-system-detail
0 px (0.00%)
main pr diff
visual-design-systems
0 px (0.00%)
main pr diff
visual-home
248 px (0.02%)
main pr diff
visual-home-catalog
0 px (0.00%)
main pr diff
visual-home-context-picker
0 px (0.00%)
main pr diff
visual-home-context-picker-popover
0 px (0.00%)
main pr diff
visual-home-plugin-filter
0 px (0.00%)
main pr diff
visual-home-plugin-use-staged
0 px (0.00%)
main pr diff
visual-home-plugin-use-with-query
0 px (0.00%)
main pr diff
visual-home-staged-attachment
0 px (0.00%)
main pr diff
visual-integrations
0 px (0.00%)
main pr diff
visual-integrations-mcp
0 px (0.00%)
main pr diff

Visual diff is advisory only and does not block merging.

@lefarcen
lefarcen requested a review from mrcfps July 9, 2026 10:03

@mrcfps mrcfps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@app/open-design-crew I reviewed the current head across the AMR low-balance threshold, free-plan CTA routing, dialog close controls, model capability tag rewrite, i18n key updates, and focused tests. The $2.00 soft-warning boundary is covered, the $0 hard block remains intact, free accounts route to the plans view while paid accounts keep the top-up path, and I did not find a changed-range correctness issue. I could not rerun the focused Vitest suites in this worktree because vitest is not installed in node_modules, but git diff --check is clean and the static pass found no stale model capability key references. Thanks for tightening the warning behavior and keeping the user-facing paths covered.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@lefarcen
lefarcen requested a review from AmyShang-alt July 9, 2026 10:16
@lefarcen lefarcen added size/XL PR changes 700-1500 lines and removed size/M PR changes 100-300 lines labels Jul 9, 2026
@AmyShang-alt AmyShang-alt added validated Runtime change validated (via /explore Pass or manual QA). and removed needs-validation Runtime change detected; needs human or /explore agent validation. labels Jul 9, 2026
@open-design-crew

Copy link
Copy Markdown
Contributor Author

No description provided.

@AmyShang-alt
AmyShang-alt added this pull request to the merge queue Jul 9, 2026
Merged via the queue into main with commit 28d8158 Jul 9, 2026
23 checks passed
@open-design-release-bot

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release/v0.14.1:

open-design-release-bot Bot added a commit that referenced this pull request Jul 9, 2026
* fix(web): lower AMR low-balance warning threshold

* fix(web): tailor low-balance CTA for free AMR users

* fix(web): tighten AMR low-balance dialog

* fix(web): add close buttons to AMR balance dialogs

* fix(web): simplify model quality tags

* fix(web): adjust model cost labels

* chore: trigger PR CI

---------


(cherry picked from commit 28d8158)

Co-authored-by: open-design-crew[bot] <299007234+open-design-crew[bot]@users.noreply.github.com>
Co-authored-by: bone3deep1962-collab <bone3deep1962@gmail.com>
xxiaoxiong pushed a commit to xxiaoxiong/open-design that referenced this pull request Jul 13, 2026
* fix(web): lower AMR low-balance warning threshold

* fix(web): tailor low-balance CTA for free AMR users

* fix(web): tighten AMR low-balance dialog

* fix(web): add close buttons to AMR balance dialogs

* fix(web): simplify model quality tags

* fix(web): adjust model cost labels

* chore: trigger PR CI

---------

Co-authored-by: bone3deep1962-collab <bone3deep1962@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Medium risk: regular code changes size/XL PR changes 700-1500 lines type/bugfix Bug fix validated Runtime change validated (via /explore Pass or manual QA).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants