Skip to content

fix(dashboard): normalize Unicode correction keywords - #575

Merged
jeff-r2026 merged 2 commits into
Tencent:mainfrom
SaulMoro:fix/unicode-correction-keywords-573
Sep 16, 2026
Merged

jeff-r2026 merged 2 commits into
Tencent:mainfrom
SaulMoro:fix/unicode-correction-keywords-573

Conversation

@SaulMoro

@SaulMoro SaulMoro commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

A team keyword such as réessaye matched an NFC prompt but missed the same word written with a combining accent. This undercounted course corrections. The matcher now normalizes the prompt and keywords to NFC before case-insensitive matching. It preserves the original prompt summary, existing word boundaries and the 60-second window.

The English and Chinese usage guides and changelog describe the fix.

Type of change

  • Bug fix

Dashboard comparison

The real dashboards use the same three prompt and keyword scenarios, with events captured by each build's hooks.

Keyword / prompt form Main This PR
NFC / NFC 1 correction 1 correction
NFC / NFD 0 corrections 1 correction
NFD / NFC 0 corrections 1 correction

Before:
image

After:
image

Test plan

  • Added 13 regression tests for both normalization directions, uppercase input, long prompts, accent distinctions, word boundaries, the correction window and legacy events. Six of the initial regression cases failed before the fix.
  • npx tsc --noEmit passed.
  • npx vitest run passed with 226 files and 3,167 tests.
  • npm run build passed.
  • Real built CLI passed 180/180 scenarios. The matrix runs 15 scenarios across Claude, Codex, CodeBuddy and OpenCode with team configs declaring git, gitlab and github. Each scenario dispatches Stop and prompt-submit hooks, checks the persisted correction flag and original summary, then checks aggregate counts through the dashboard API. The same matrix against main had 120 passes and 60 failures.
  • Real built CLI passed 5/5 project-scope cases after teamai init --self --agent cursor --scope project. These cover both normalization directions through Cursor workspace_roots and Claude cwd, plus isolation from an unrelated directory.
  • The real dashboard shows the correction counts in the table above. No browser console or page errors were reported.
  • git diff --check passed.

Related issues

Fixes #573.

Follow-up to #567, which addressed the original issue #564.

Notes for reviewers

Normalization runs only during matching. Existing persisted correction flags are not recalculated. Legacy events without a flag still use the built-in keyword fallback, which now also normalizes Unicode.

The CLI matrix uses isolated local homes and local team configurations. It does not exercise live provider authentication or agent GUIs. Validation ran on macOS with Node 22.22.2.

@SaulMoro
SaulMoro marked this pull request as ready for review September 15, 2026 15:28
@jeff-r2026
jeff-r2026 merged commit 8efeaf7 into Tencent:main Sep 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dashboard): normalize Unicode when matching team correction keywords

2 participants