Skip to content

fix(ui): match usage conversation search against NFC queries - #189834

Closed
huwei-xydt wants to merge 5 commits into
openclaw:mainfrom
huwei-xydt:fix/usage-details-query-nfc
Closed

huwei-xydt wants to merge 5 commits into
openclaw:mainfrom
huwei-xydt:fix/usage-details-query-nfc

Conversation

@huwei-xydt

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Usage details conversation search hid matching messages when the query and log text used different Unicode canonical forms. A composed münchen notes query did not find a message stored with decomposed text, and the reverse mismatch also failed.

User Impact

Users typing normal composed text in the Usage conversation filter could miss messages whose content came from decomposed sources. ASCII queries were unaffected.

Why This Change Was Made

The conversation filter lowercased both operands for case-insensitivity but left Unicode canonical forms unequal. Local comparison copies need NFC on both the query and cleaned log content, matching the Logs, activity, chat, and skills filters already fixed on main.

Evidence

Red/green unit tests in ui/src/pages/usage/view-details.test.ts:

  • On base, the new case fails: NFC query vs NFD log content yields zero .session-log-entry rows.
  • With this fix, the full file is 20/20 green under test/vitest/vitest.ui.config.ts.
  • Production change is comparison-only on filters.query and entry.cleanContent. No Gateway, export, or persistence changes.

Merge danger

Two-way door: a revert restores earlier lowercase-only matching. Blast radius is local Usage conversation list filtering. Faulty comparison could hide or show unexpected messages; it cannot alter stored usage records or Gateway writes.

huwei-xydt and others added 5 commits October 31, 2026 22:47
LogsView compared lowercase filter text without Unicode normalization, so
NFC queries missed NFD log lines.

Co-Authored-By: Claude Code <[email protected]>
Lowercase then NFC-normalize the usage details query and clean log content
on the comparison side so composed searches find decomposed messages.

Co-Authored-By: Claude Code <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S labels Oct 31, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Normalize search queries and candidate text to NFC before matching in Usage conversations and Logs.

Example: Search Usage conversations for composed “münchen notes” when a message contains decomposed “München notes opened”.

  • Before: The matching message is hidden.
  • After: The message appears with its original text preserved.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and source-supported, but the required runtime evidence is absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Visually equivalent search text can hide an existing conversation message because its Unicode representation differs.
Reason: The narrow comparison repair restores useful search behavior and follows the already merged Logs precedent without changing settings or stored data.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: it fixes a current Usage conversation search bug with a focused change, and no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 9dc7f9f4b6f71fb1d629a881fc140d23599a4a99

Before merge

  • Add real behavior proof - The Usage SessionLogs owner is exercised through component mounting and reported red/green tests, but no supplied screenshot, recording, browser output, or runtime logs show this change through the shipped Usage route; add a sanitized runtime capture and redact IPs, API keys, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Low-value test ui/src/pages/usage/view-details.test.ts: Remove the additional NFD-query/NFD-content mount: it passes with the original lowercase-only matcher and adds no distinct failure beyond the two cross-form cases.
  • Missing end-to-end proof: Show both NFC-query/NFD-message and NFD-query/NFC-message searches through the running Usage conversation UI, with the original displayed text preserved.
Agent review details

How this fits together

The Control UI filters Gateway-provided conversation entries locally, passing matching entries to the existing conversation list renderer.

flowchart LR
  A[Gateway conversation entries] --> B[Existing log parser]
  B --> C[Usage conversation filter]
  D[Search input] --> C
  C --> E[NFC comparison copies]
  E --> F[Original matching entries]
  F --> G[Conversation list]
Loading

Technical review

Best possible solution:

Keep canonical normalization inside the existing conversation filter and preserve original message text throughout rendering and storage.

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

Current-main source directly exposes the NFC-query/NFD-content mismatch, and the contributor reports a regression that fails on base; this read-only review did not run it.

Is this the best way to solve the issue?

Normalizing both comparison copies is the smallest complete repair: it uses the existing owner without introducing helpers, state, compatibility paths, or data mutation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7232a8de67ef.

Provenance checked

  • Usage conversation comparison changes intended behavior with a stated reason (unknown: The current comparison was carried through the Solid migration and the behavior-preserving presentation refactor in refactor: deslop gateway, channels and UI owner surfaces #185157; path history and symbol searches did not establish the original introduction before unavailable older blobs.)
  • Logs canonical comparison keeps the original intent (fix(ui): match logs filter against NFC queries #189473: The merged repair intentionally normalizes comparison copies while preserving raw records, display, exports, and log identities.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +6, Tests +49, Docs +4. Total +59 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 10 4 +6
Tests 2 54 5 +49
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 68 9 +59

Labels

Label changes:

  • add P2: Canonical Unicode mismatches hide matching conversation entries in a local search flow with limited blast radius.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: Canonical Unicode mismatches hide matching conversation entries in a local search flow with limited blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Provide the Usage runtime capture described in the proof assessment.
  • Remove the redundant same-form test mount.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 31, 2026, 7:07 PM ET / 23:07 UTC.

obviyus added a commit that referenced this pull request Nov 1, 2026
…9874)

fix(ui): match config, Usage and dashboard searches across Unicode normalization forms

Three more Control UI searches compared text without Unicode normalization, so a name stored in one form (NFC or NFD, for example `Café` saved on macOS) didn't match a query typed in the other:
- the config editor form search;
- Usage conversation search;
- the dashboards gallery search.

Each now lowercases and NFC-normalizes both sides for the local comparison only. Raw values are unchanged, and dashboard agent scoping is untouched.

Evidence: built Gateway and Control UI in real Chromium. Each surface missed both directions twice on main and found the expected result twice with this change. ASCII controls behaved the same on both refs. Details and screenshots: #189874 (comment).

Includes the fixes from #189829, #189834 and #189853, with their commits kept.

Co-authored-by: 胡伟0668000622 <[email protected]>
Co-authored-by: Claude Code <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
@obviyus

obviyus commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks @huwei-xydt. Your fix landed in #189874 (f121a7f), which keeps your commit. I'm closing this one as included.

@obviyus obviyus closed this Nov 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…nclaw#189874)

fix(ui): match config, Usage and dashboard searches across Unicode normalization forms

Three more Control UI searches compared text without Unicode normalization, so a name stored in one form (NFC or NFD, for example `Café` saved on macOS) didn't match a query typed in the other:
- the config editor form search;
- Usage conversation search;
- the dashboards gallery search.

Each now lowercases and NFC-normalizes both sides for the local comparison only. Raw values are unchanged, and dashboard agent scoping is untouched.

Evidence: built Gateway and Control UI in real Chromium. Each surface missed both directions twice on main and found the expected result twice with this change. ASCII controls behaved the same on both refs. Details and screenshots: openclaw#189874 (comment).

Includes the fixes from openclaw#189829, openclaw#189834 and openclaw#189853, with their commits kept.

Co-authored-by: 胡伟0668000622 <[email protected]>
Co-authored-by: Claude Code <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants