Registry Mirror
Skip to content

Conversation

@saphid

@saphid saphid commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

In Usage → All environments → Model prices, clearing an existing mapping can demand an input price on another selected environment that already uses automatic pricing. The row error disables Save changes even though the unmapped environment needs no write.

Deterministic repro on origin/main (54e81819cbe825bfa36808c783c84758890e4ca0)

  • Run vp test run apps/web/src/components/usage/usagePriceTable.test.ts -t "clears a mapping across mapped and automatically priced environments". The fixture has two available targets with prices: {}: Env A has aliases: { example: "example-model" }, and Env B has aliases: {}. It calls usagePriceTableErrors with both targets and [{ id: "model:example", model: "example", isNew: false, alias: "", values: {} }].
  • In the real app, save a mapping for example on only one of two writable environments. With both selected, type the alias into the Map to field showing Mixed, then erase it without entering prices. UsagePriceOverrides stages the blank alias and renders the result of usagePriceTableErrors on the row and in the Save button's disabled state.
  • Observed: The test receives Map { "model:example" => "Input is required on Env B." }. The dialog shows the error and disables Save changes.
  • Expected: No validation error. Save removes only the existing mapping ({ model: "example", alias: null }) and leaves the automatically priced environment unchanged.

Change

After planning any existing alias removal, skip price validation for an existing row's mapping clear when the target has no custom price and the draft contains no nonblank price edits. This fixes the dialog in both web and the shared Electron renderer; new rows and actual price edits still validate.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • The focused test failed on the pinned base with Input is required on Env B. and passed with the fix. vp run check:changed exited 0, including all 12 price-table tests.
  • The same Chromium scenario ran against two isolated T3 servers on each revision: base showed the error and disabled Save changes; head enabled Save, saved successfully, and removed the custom row. Before, after, and saved captures with the scratch scenario.
  • Not shown: Electron shell, native mobile, or relay/tunnel connections.

Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change updates how usagePriceTableChanges handles alias clearing and price validation. A new test checks the results across mapped and automatically priced environments.

Changes: Model alias clearing

Layer / File(s) Summary
Alias clearing and validation
apps/web/src/components/usage/usagePriceTable.ts, apps/web/src/components/usage/usagePriceTable.test.ts
usagePriceTableChanges clears a current alias before checking whether to skip price parsing. The test verifies that clearing an alias produces no validation errors, removes the alias in the mapped environment, and makes no changes in the automatically priced environment.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 9805e

This fixes a bug where clearing a model mapping across environments could wrongly require a price and disable saving. The change is small and covered by a focused test, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: clearing a model mapping across environments no longer requires prices on unmapped environments. The raw summary and objectives both describe skipping price validation when…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, the reproduction steps, and expected and observed behavior. The Chang…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: clearing a model mapping across environments no longer requires prices on unmapped environments. The raw summary and objectives both describe skipping price validation when an existing mapping is cleared with no custom price, so the title matches the main change. It follows the conventional commit form with a plain-language description.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, the reproduction steps, and expected and observed behavior. The Change section explains the fix and that it applies to web and the shared Electron renderer. The Scope section states this is a small bug fix and that no issue is needed. The Verification section lists a focused failing-then-passing test, a full changed-files check, and a Chromium before/after scenario, and it names what was not checked (Electron shell, native mobile, relay/tunnel). The template's optional agent-model line is filled in. The description is complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between dff224d and 9805ea2.

Files selected for processing: 2

  • apps/web/src/components/usage/usagePriceTable.test.ts
  • apps/web/src/components/usage/usagePriceTable.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — Clearing a model mapping across environments no longer requires prices in environments already using automatic pricing. Those environments generate no settings change, keeping the additional exposure limited.

Needs human approval because:

  • Macroscope's correctness review did not reach a verdict

Notes:

  • The correctness review was unavailable. Eligibility was assessed without its result.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 1280×800, light theme; fresh databases and two writable real servers labelled Scenario.

Pair two writable environments. Open Usage → All environments → Model prices. Select only one environment, add example → example-model without prices, and save. Select All environments, fill Map to with example-model, select all and Backspace without editing prices. Inspect Save changes; on head, save and verify both environments have no example alias or price override.

Scenario: Clearing a mixed mapping keeps automatic prices

Proven: the scenario fails on base ab091dfedd and passes on head 53d0013010.

Base ab091dfedd Head 53d0013010
Result ❌ failed
ASSERTION_FAILED: expect.toBeEnabled failed
locator: getByRole("dialog") >> getByRole("button", name: "Save changes")
expected: enabled
observed: states: disabled (match count 1)
✅ passed
mapping cleared with automatic prices Base ab091dfedd: mapping cleared with automatic prices Head 53d0013010: mapping cleared with automatic prices
mapping clear saved Head 53d0013010: mapping clear saved

| Interaction recording (⅓ speed) | Before | After |

Scenario source. The automatic failure screenshot was taken after second-server teardown; the paired screenshot above captures the actual assertion state.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 2, 2026
@juliusmarminge
juliusmarminge merged commit 36614ae into pingdotgg:main Dec 2, 2026
36 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants