Skip to content

fix: resolve real_name for Slack Connect users#57

Merged
AmethystLiang merged 1 commit intostablyai:mainfrom
jprichardson:fix/connect-user-real-name
Mar 8, 2026
Merged

fix: resolve real_name for Slack Connect users#57
AmethystLiang merged 1 commit intostablyai:mainfrom
jprichardson:fix/connect-user-real-name

Conversation

@jprichardson
Copy link
Contributor

Summary

  • toCompactUser reads real_name from the top-level users.info response, but for Slack Connect users (external org), the API only populates real_name inside profile.real_name
  • This causes agent-slack user get to return just the handle (e.g. "bob") instead of the full name (e.g. "Bob Smith") for Connect users
  • Fix: fall back to profile.real_name when the top-level field is missing

Change

One line in src/slack/users.ts:

-    real_name: getString(u.real_name) ?? undefined,
+    real_name: getString(u.real_name) ?? getString(profile.real_name) ?? undefined,

The profile variable is already extracted on the line above, so this is a minimal change.

How to reproduce

  1. Have a Slack Connect DM with someone from an external org
  2. Run agent-slack user get <connect-user-id>
  3. Notice real_name is missing — only name (the handle) is returned
  4. With this fix, real_name is correctly populated from profile.real_name

🤖 Generated with Claude Code

For Slack Connect users (external org), the `users.info` API response
does not include `real_name` at the top level — it only appears inside
`profile.real_name`. This causes `user get` to return only the handle
(e.g. "bob") instead of the full name (e.g. "Bob Smith").

Fall back to `profile.real_name` when the top-level field is missing.

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@AmethystLiang AmethystLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI code review: Approved. Clean, minimal one-line fix that correctly falls back to profile.real_name for Slack Connect users. The profile variable is already safely extracted, and the fallback chain is consistent with how other fields are read in toCompactUser. No concerns — ship it.

@AmethystLiang AmethystLiang merged commit 50768ed into stablyai:main Mar 8, 2026
1 check passed
@jprichardson jprichardson deleted the fix/connect-user-real-name branch March 8, 2026 21:44
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.

2 participants