fix(monitoring): unify source/identity cells with multi-key disambiguation#413
Merged
Conversation
Prefer multi-key OpenAI-compatible source names (e.g. "kuaileshifu #1") over bare provider/channel labels in the realtime source cell and account overview identity cell so multi-key providers no longer collapse to a single generic channel. What changed: - sourceDisplay: add isKeyDisambiguatedLabel/isRedundantMonitoringLabel; treat xai/x-ai/grok/codex as generic provider labels so primary stays the masked email or ordinal key; rewrite buildMonitoringSourceDisplay primary/meta selection. - realtimeSourceDisplay: reuse the same helpers so realtime cells match account overview identity. - eventRows: resolve sourceLabel with key disambiguation before channel fallbacks; relocate channelMeta lookup. - accountOverviewState/Presentation: suppress redundant secondary labels when the primary is already a multi-key disambiguation of the candidate. Why: previously realtime source cells and account overview secondaries showed the bare provider name under its multi-key primary, hiding which API key produced each row and making multi-key providers look like a single account. Impact/Risk: display-only change in monitoring surfaces; covered by new sourceDisplay tests plus regression tests in eventRows and accountOverviewState. No API or backend contract change.
Add demo auth files, accountStats rows, apiKeyHash entries, and recent events for the new monitoring identity variants surfaced by the previous fix: xai/codex OAuth-style email identities, multi-key kuaileshifu OpenAI-compatible provider, and anyrouter.top #1 channel that already contains an ordinal. What changed: - demoAuthFiles: add codex-email-user, xai-email-user, kuai-auth-1/2, anyrouter-auth-1; populate email/account_snapshot and bump total 13 -> 18. - demoApiAliases: add aliases for the new email/multi-key rows. - buildMonitoringAnalytics: extend accountStats (multi-key kuaileshifu, anyrouter #1, codex/xai email) plus matching authIndexRows and apiKeyHashRows; shift the trailing edge entry's accountStats index. - recentEvents: append rows for the new auth files so the realtime and event panels render the new identities. Why: without demo coverage the new monitoring identity behavior is invisible to reviewers and the demo build; these fixtures make the disambiguation rules inspectable end-to-end. Impact/Risk: demo fixtures only; no production data or API contract changes. Index shift in accountStats is internal to the demo builder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Realtime source cells and account overview identity now prefer multi-key OpenAI-compatible source names (e.g.
aaaa #1) over bare provider/channel labels and treatxai/x-ai/grok/codexas generic provider labels so the primary stays the masked email or ordinal key.Scope
Changes
sourceDisplay: addisKeyDisambiguatedLabel/isRedundantMonitoringLabel; extendGENERIC_PROVIDER_LABELSwithxai/x-ai/grok; rewritebuildMonitoringSourceDisplayprimary/meta selection.realtimeSourceDisplay: reuse helpers so realtime cells match account overview identity.eventRows: resolvesourceLabelvia key disambiguation before channel fallbacks; relocatechannelMetalookup.accountOverviewState/accountOverviewPresentation: suppress redundant secondary candidates when the primary is already a multi-key disambiguation of the candidate.demoFixtures: add demo auth files + analytics rows for xai/codex email identities, multi-keyaaaaaa, andaaaaaa.top #1to exercise the new paths.User Impact
Multi-key OpenAI-compatible providers no longer collapse to a single generic channel in monitoring. xAI / codex OAuth email accounts display the masked email as primary instead of the bare
xai/codexlabel.Compatibility / Runtime Notes
Display-only change in monitoring surfaces; no API or backend contract change.
Data / Security Notes
N/A — display layer only, no SQLite / admin key / auth file / raw usage changes.
Risk / Rollback
Risk level: Low
Rollback: revert the two commits; no data migration.
Verification
vitest run src/features/monitoring/model/sourceDisplay.test.ts src/features/monitoring/accountOverviewState.test.ts src/features/monitoring/model/eventRows.test.ts→ 3 files, 42 tests passed.Commands / evidence:
Screenshots / Recordings
N/A — display change; demo fixtures added so the new identity cells are visible in the demo build.
Docs
Related
N/A