Skip to content

fix(ui): usage filters hide sessions when multiple providers are selected - #129482

Merged
steipete merged 3 commits into
mainfrom
codex/ui-usage-filter-repair
Aug 25, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/ui-usage-filter-repair

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where operators selecting multiple providers, models, tools, or channels on the Usage dashboard would unexpectedly see no matching sessions. Session labels containing spaces also could not be found with quoted searches, and changing another filter could split or corrupt an existing quoted search.

Why This Change Was Made

The existing Usage query owner now groups alternatives within each multi-select category while continuing to intersect separate categories, numeric thresholds, and has: requirements. One quote-aware tokenizer is reused for filtering, suggestions, adding/removing filter chips, and category replacement so every query surface preserves complete quoted terms.

User Impact

Selecting multiple providers means sessions from any selected provider remain visible; narrowing by another category or threshold still works predictably. Searches such as label:"Team Planning" match the intended session and remain intact while other filters or suggestions are edited.

Evidence

Before the fix, focused owner-boundary tests reproduced six independent failures: multiple selected providers returned zero rows; quoted labels were split and failed to match; adding, removing, and suggesting filters corrupted quoted terms. A subsequent browser screenshot exposed the related stale-suggestion branch, which was added as another authentic failing regression before repairing its canonical owner.

Selecting both providers now retains both sessions:

Usage dashboard with both OpenAI and Anthropic selected while two matching sessions remain visible

Searching a quoted label now retains the one matching session:

Usage dashboard matching exactly one session for a quoted multi-word label

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/pages/usage/helpers.node.test.ts ui/src/pages/usage/query.test.ts — 28 passed, including every formerly failing case.
  • OPENCLAW_UI_E2E_RECORD=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/usage-cost-analysis.e2e.test.ts — 5 Chromium scenarios passed; actual UI interactions select both providers and search a quoted session label.
  • Changed-file formatting and lint pass.

Production LOC: +23/-10 (net +13); tests: +191/-3.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 17:05
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 2:03 PM ET / 18:03 UTC.

ClawSweeper review

What this changes

The branch makes repeated Usage dashboard category filters alternatives and preserves quoted query terms while filtering, editing chips, and accepting suggestions.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR remains necessary: current main still intersects repeated provider terms and splits keyed quoted values. The patch repairs both behaviors in the shared query owner, with no blocking correctness finding found; exact-head CI is still in progress and the branch is behind main.

Priority: P2
Reviewed head: f410363d5f61d17939ff136e8017e40f1a51758b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with strong targeted coverage; exact-head CI and the current-main merge result remain to be confirmed.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this repository-member PR; its body additionally supplies UI screenshots and recorded browser-E2E results.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this repository-member PR; its body additionally supplies UI screenshots and recorded browser-E2E results.
Evidence reviewed 4 items Current-main defect: Current main still tokenizes only whole quoted tokens and evaluates every repeated filter independently, so label:"Team Planning" splits and two single-provider sessions cannot satisfy both provider terms.
Owner-boundary repair: The branch changes the shared tokenizer and groups only multi-select category terms before the single filtering pass; query mutation helpers reuse that tokenizer rather than duplicating parsing.
Caller and regression coverage: The Usage view consumes the same helper for displayed sessions, chips, dropdown filters, and suggestions; focused node tests cover OR-within-category/AND-across-category and E2E drives both provider selection and a quoted label.
Findings None None.
Security None None.

Live Verification

Command: OPENCLAW_UI_E2E_RECORD=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/usage-cost-analysis.e2e.test.ts

Result: FAIL (failed) — step 1 run OPENCLAW_UI_E2E_RECORD=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/usage-cost-analysis.e2e.test.ts: previous terminal command was still running after 30 seconds: "OPENCLAW_UI_E2E_RECORD=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/usage-cost-analysis.e2e.test.ts"

RUN  v4.1.10 /tmp/clawsweeper-live-proof-129482-4J24lh/target

[vitest] still running with no output for 30000ms.

Assertions:

  • FAIL expect_output: keeps selected provider alternatives visible and finds quoted session labels

How this fits together

The Usage dashboard receives Gateway session-usage records and filters them locally before rendering operator-visible sessions. Its query helper also feeds filter chips and suggestions, so token parsing must stay consistent across matching and editing.

flowchart LR
A[Gateway usage sessions] --> B[Usage dashboard]
B --> C[Query tokenizer]
C --> D[Category and text filters]
D --> E[Visible sessions]
C --> F[Suggestions and filter chips]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind main and exact-head checks are still running; refresh the merge result and required UI checks before landing.
  • Resolve merge risk (P1) - Production code grows by 13 net lines for a bug fix; the grouping map is justified as the single owner of category-level OR semantics, but should not be duplicated in dropdown or view code.
  • Complete next step (P2) - No repair lane is needed because no discrete defect was found in the submitted patch; the remaining action is normal exact-head validation and maintainer handling.
Agent review details

Security

None.

PR surface

Source +13, Tests +188. Total +201 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 23 10 +13
Tests 3 191 3 +188
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 214 13 +201

Review metrics

Metric Value Why it matters
Production versus test LOC production +13 (23 added, 10 removed); tests +188 (191 added, 3 removed) The production increase implements the shared category-grouping policy, while the test growth covers the owner boundary, token mutations, and browser interaction.

Stored data model

Persistent data-model change detected: migration/backfill/repair: ui/src/e2e/usage-cost-analysis.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep category-level OR grouping and quote preservation centralized in the query helper, then merge after the clean current-main result and exact-head UI checks are confirmed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep category-level OR grouping and quote preservation centralized in the query helper, then merge after the clean current-main result and exact-head UI checks are confirmed.

Do we have a high-confidence way to reproduce the issue?

Yes—source inspection gives a high-confidence current-main path: repeated provider terms are intersected in ui/src/pages/usage/helpers.ts:327, and keyed quoted values are split by the tokenizer at ui/src/pages/usage/helpers.ts:137.

Is this the best way to solve the issue?

Yes—the shared query helper is the narrowest owner because filtering, suggestions, chip removal, and category replacement all consume its terms; changing only the rendered dropdown would leave the other mutation paths inconsistent.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0ea03f3a3bcc.

Labels

Label changes:

  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is not_applicable.

Label justifications:

  • P2: This fixes a bounded but user-visible Usage dashboard filtering failure without core-runtime or data-loss impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this repository-member PR; its body additionally supplies UI screenshots and recorded browser-E2E results.

Evidence

What I checked:

  • Current-main defect: Current main still tokenizes only whole quoted tokens and evaluates every repeated filter independently, so label:"Team Planning" splits and two single-provider sessions cannot satisfy both provider terms. (ui/src/pages/usage/helpers.ts:137, 0ea03f3a3bcc)
  • Owner-boundary repair: The branch changes the shared tokenizer and groups only multi-select category terms before the single filtering pass; query mutation helpers reuse that tokenizer rather than duplicating parsing. (ui/src/pages/usage/helpers.ts:135, f410363d5f61)
  • Caller and regression coverage: The Usage view consumes the same helper for displayed sessions, chips, dropdown filters, and suggestions; focused node tests cover OR-within-category/AND-across-category and E2E drives both provider selection and a quoted label. (ui/src/pages/usage/view.ts:240, f410363d5f61)
  • Feature provenance: Blame attributes the current-main query parser, filter pass, and query mutation helpers to the same recent Usage surface; the history contains this focused repair as the only subsequent change to the owner. (ui/src/pages/usage/helpers.ts:135, bc4ce76db350)

Likely related people:

  • steipete: Current-main blame and shortlog identify Peter Steinberger as the sole available history contributor for the parser, filter owner, and query-editing helpers. (role: introduced and recently maintained the Usage query surface; confidence: medium; commits: bc4ce76db350, f410363d5f61; files: ui/src/pages/usage/helpers.ts, ui/src/pages/usage/query.ts, ui/src/pages/usage/view.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the required checks complete on the current head and refresh after any necessary rebase.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-25T17:12:23.060Z sha 21e7821abe1b7224b5731ae853ec51a9eed06dae :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/ui-usage-filter-repair branch from 21e7821 to f410363 Compare August 25, 2026 17:56
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Aug 25, 2026
@steipete
steipete force-pushed the codex/ui-usage-filter-repair branch from f410363 to 386d5fa Compare August 25, 2026 18:55
@openclaw-barnacle openclaw-barnacle Bot added r: skill Auto-close: skills should be published on ClawHub, not added to core. extensions: anthropic labels Aug 25, 2026
@steipete
steipete force-pushed the codex/ui-usage-filter-repair branch from 0e55120 to 5486c7c Compare August 25, 2026 19:50
@openclaw-barnacle openclaw-barnacle Bot removed the r: skill Auto-close: skills should be published on ClawHub, not added to core. label Aug 25, 2026
@steipete
steipete merged commit 99fbe22 into main Aug 25, 2026
127 checks passed
@steipete
steipete deleted the codex/ui-usage-filter-repair branch August 25, 2026 20:19
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
…cted (openclaw#129482)

* fix(ui): make usage multi-select and quoted filters work

* fix(anthropic): keep provider policy artifacts lightweight

* test(vitest): assign codex startup retry to its owner shard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui extensions: anthropic maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant