Skip to content

fix(web): effort bars fill the right way for high-to-low levels - #43509

Closed
iamshadmantaqi wants to merge 2 commits into
pingdotgg:mainfrom
iamshadmantaqi:fix/effort-bars-descending-levels
Closed

iamshadmantaqi wants to merge 2 commits into
pingdotgg:mainfrom
iamshadmantaqi:fix/effort-bars-descending-levels

Conversation

@iamshadmantaqi

Copy link
Copy Markdown
Contributor

Problem

When a provider advertises its reasoning levels high to low with the off level last (an ACP Registry agent listing ["xhigh", "high", "low", "none"]), the composer's effort bars are inverted: Extra High shows 1 of 4 bars filled and None shows 4 of 4. resolveEffortGlyph reads both the bar count and the fill from array position, so it assumes the list rises and that an off level, if any, comes first. The selected effort is applied correctly; only the glyph is wrong.

Change

resolveEffortGlyph now checks whether the levels are listed high to low (the off level is last, or the known ids minimal < low < medium < high < xhigh fall from first to last) and, if so, works on the reversed list. Everything after that is unchanged, so lists that already rise behave exactly as before.

For ["xhigh", "high", "low", "none"] this gives 3 bars: Extra High 3 filled, High 2, Low 1, None 0. That follows the existing convention that an off level is not a bar (the current test for ["off", "low", "high"] expects count: 2), rather than the 4-of-4 table in the issue.

Scope

Fixes #43496

Only the glyph in apps/web/src/components/chat/EffortGlyph.tsx changes. The picker menu still shows levels in the order the provider advertises them; the issue's second suggestion (normalising the advertised order for ACP providers) is left out to keep this to the indicator bug.

Verification

Added two cases to apps/web/src/components/chat/EffortGlyph.test.ts: the descending list above (plus a descending list with no off level), and an ascending list that starts at none, which must keep its current fill.

Without the fix (test commit only):

 FAIL  |unit| src/components/chat/EffortGlyph.test.ts > resolveEffortGlyph > fills bars by effort when a provider lists its levels high to low
AssertionError: expected { count: 4, filled: 1, …(2) } to deeply equal { count: 3, filled: 3, …(2) }

- Expected
+ Received

  {
-   "count": 3,
-   "filled": 3,
+   "count": 4,
+   "filled": 1,
    "label": "Xhigh",
    "special": null,
  }

 Test Files  1 failed (1)
      Tests  1 failed | 11 passed (12)

With the fix:

$ vp test run src/components/chat/EffortGlyph.test.ts
 Test Files  1 passed (1)
      Tests  12 passed (12)

vp run check:changed: format, lint, knip, typecheck (2 packages), tests (1 file) and the React compiler check (1 file) all pass.

Not verified: I did not run an ACP Registry agent that advertises descending levels, so the bars were not checked in the running app; the fix is covered by the unit tests on resolveEffortGlyph only.

Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 26, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for this. #43511 makes the same change and is the one being kept.

#43511 fixes the same reported inversion with a smaller change: it reverses the scale when None or Off comes last, without introducing a separate ranking heuristic.

Your additional coverage for descending lists without an off level remains useful, but it extends beyond the reported case. That behavior can be considered separately from the focused fix.

Closing as a duplicate.

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Composer effort bars are inverted when a provider advertises reasoning levels high→low

2 participants