feat(users-page): show openclaw channel + username columns#1
Merged
alexanderkreidich merged 1 commit intoApr 16, 2026
Merged
Conversation
Surfaces OpenClaw trace metadata on the Users page so channel (telegram, mattermost, ...) and a human-readable sender name appear alongside userId. Username prefers openclaw_sender_username, falls back to openclaw_sender_name, then openclaw_sender_label; never shows raw sender IDs. Values are derived from existing trace metadata in the ClickHouse traces table - no persistence-schema changes. Extends the existing getUserMetrics query to aggregate with anyIf(x != '') over the two new computed columns and propagates them through users.metrics tRPC and the Users table columns. Adds backend integration tests covering the coalesce priority and the null-metadata case. Refs: 2BB-284
|
@claude review |
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
Surfaces OpenClaw trace metadata on the Users page so operators can see which channel a user came from (telegram, mattermost, …) and a human-readable sender name next to the raw userId.
Two new columns are added between User ID and Environment:
metadata['openclaw_channel']openclaw_sender_username, falls back toopenclaw_sender_name, thenopenclaw_sender_label(raw sender IDs are never used)Why now
LiteLLM just started producing Mattermost OpenClaw metadata (see 2bb-dev/litellm#5). With that in place, the Users page today shows the hashed
trace_user_id(mattermost:pwanex3ne3fx58nr5oaxg4j54w) with no way to tell at a glance which platform the user is on or what their display name is. These two columns fix that.No persistence change
Channel + username are derived from existing
traces.metadataClickHouse Map values.getUserMetricsinpackages/shared/src/server/repositories/traces.tsaggregates them with:anyIf(t.openclaw_channel, t.openclaw_channel != '')coalesce(nullIf(username, ''), nullIf(name, ''), nullIf(label, ''))— priority-ordered…and propagates them through the
users.metricstRPC endpoint into the React DataTable. No new columns, no new indexes, no migrations.Tests
Backend integration tests added in `web/src/tests/server/users-ui-table.servertest.ts`:
These require ClickHouse (servertest pattern) — not runnable locally without docker, but work alongside the existing `getUserMetrics` tests in the same file.
Files changed
Test plan
Refs: 2BB-284 · Pairs with 2bb-dev/litellm#5
🤖 Generated with Claude Code