Skip to content

fix(apollo-react): cost badges are opt-in, not a picker default - #1045

Open
denispetre wants to merge 2 commits into
mainfrom
fix/cost-badges-opt-in
Open

fix(apollo-react): cost badges are opt-in, not a picker default#1045
denispetre wants to merge 2 commits into
mainfrom
fix/cost-badges-opt-in

Conversation

@denispetre

Copy link
Copy Markdown
Contributor

The picker stamped cost-tier chips itself whenever the DTO carried cost data, using hardcoded $1/M and $5/M thresholds. That made a product decision — what counts as expensive — in the design system, where no product could configure it. Its own doc comment said the picker did NOT do this; the code did.

The picker now stamps nothing unless the product passes badgesFor. defaultCostTier stays as the example classifier, documented as such — copy it and tune the thresholds, or classify on something else. The pool badge kinds are the shared contract; the classifier is not.

104 tests. The "stamps by default" test is now "does not stamp unless opted in"; badgesFor([]) suppression is its own case.

denispetre and others added 2 commits August 5, 2026 19:24
…its i18n catalogs

Everything a product needs to integrate the shared picker without
re-implementing platform behaviour. Driven by Agent Builder's adoption
(UiPath/Agents#5858), but none of it is agent-specific.

Region mapping moves in. `homeRegion` accepts the raw OMS organization
region as PortalShell serves it ("UnitedStates", "Japan") as well as a
geography code, so hosts stop maintaining their own tables - the first
one already had JP/SG where the gateway uses JA/SI, silently disabling
out-of-region chips. GLOBAL resolves to no home region: it is a routing
target, not a place an org lives.

Modality is a product decision. The picker renders whatever Discovery
serves; `modelType` is on the DTO and `isTextGenerationModel` is exported
as an opt-in filter. An indexing surface picks embeddings from the same
catalog, so excluding them centrally would break it. Only
`isBlockedByPolicy` is still dropped unconditionally.

Selection resolves by modelId OR modelName - for `value` and for the
recommended/preview override lists. Hosts persist names and author those
lists from Model Hub config, which also carries names.

The picker performs the BYO configuration DELETE itself against
api/byo/product/llm-configurations/{id}, a platform route it already holds
credentials for, and reports failures with the gateway's own message.
`onModelDeleted` lets hosts reconcile what the picker cannot see - chiefly
choosing a replacement selection, which stays a product decision.
`onDeleteModel` still works as the opt-out, so no consumer breaks.

`loadModelPickerMessages(locale)` replaces the 14 literal dynamic imports
every host would otherwise hand-write. It cannot be a template-literal
import - a consumer's bundler cannot resolve that through the package
exports map - and the symptom of getting it wrong reads like a translation
bug rather than a bundling one.

104 tests, up from 78.

Squashed from nine commits and rebased onto main so the branch carries no
merge commits: this repo merges by rebase, and a plain "Merge branch main"
commit pushed via Update branch fails commit-message validation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The picker stamped cost-tier chips itself whenever the DTO carried cost data,
using hardcoded $1/M and $5/M thresholds. That made a product decision - what
counts as expensive - in the design system, where no product could configure
it. Its own doc comment said the picker did NOT do this; the code did.

The picker now stamps nothing unless the product passes badgesFor.
defaultCostTier stays as the example classifier, documented as such - copy it
and tune the thresholds, or classify on something else. The pool badge kinds
are the shared contract; the classifier is not.

104 tests. The "stamps by default" test is now "does not stamp unless opted
in"; badgesFor([]) suppression is its own case.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 12, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Aug 12, 2026, 04:33:44 AM
apollo-docs Ready Preview · Logs Aug 12, 2026, 04:33:44 AM
apollo-landing Ready Preview · Logs Aug 12, 2026, 04:33:44 AM
apollo-vertex Ready Preview · Logs Aug 12, 2026, 04:33:44 AM

@github-actions github-actions Bot added pkg:apollo-react size:XXL 1,000+ changed lines. labels Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1950 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1720
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.2 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core 43.84 MB 57.45 MB ±0
@uipath/apollo-react 39.5% 100.0% (1/1) 7.52 MB 28.92 MB −76 B
@uipath/apollo-wind 420.8 KB 2.73 MB +11 B
@uipath/ap-chat 85.8% 43.46 MB 56.06 MB −271 B

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 26 changed (of 244 compared, 218 unchanged). View report

Baseline is the deployed main Storybook, so changes merged to main after this branch was last updated can also appear here. Logs

Updated (PT): Aug 12, 2026, 04:43:32 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:XXL 1,000+ changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants