Skip to content

Show agent name and ID in Slack modal dropdowns#2281

Merged
amikofalvy merged 1 commit intomainfrom
feat/slack-modal-agent-name-id
Feb 24, 2026
Merged

Show agent name and ID in Slack modal dropdowns#2281
amikofalvy merged 1 commit intomainfrom
feat/slack-modal-agent-name-id

Conversation

@amikofalvy
Copy link
Copy Markdown
Collaborator

Summary

  • Show both agent name and ID (e.g. "Inkeep QA Graph (facts-agent)") in Slack modal dropdown options instead of just the name or ID alone
  • Agent names are not guaranteed unique across a project, so including the ID makes selection unambiguous
  • Applied consistently in both buildAgentSelectorModal and buildMessageShortcutModal

Test plan

  • pnpm typecheck passes (14/14 tasks)
  • pnpm test in agents-work-apps passes (434/434 tests, including 14 modal tests)
  • Manually verify in Slack that agent dropdown shows "Name (id)" format
  • Verify agents without a name still show just the ID as fallback

🤖 Generated with Claude Code

Agent names are not guaranteed unique. Show both name and ID
(e.g. 'Inkeep QA Graph (facts-agent)') in the dropdown to make
selection unambiguous.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 24, 2026 2:46am
agents-docs Ready Ready Preview, Comment Feb 24, 2026 2:46am
agents-manage-ui Ready Ready Preview, Comment Feb 24, 2026 2:46am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: ed1f29d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@inkeep/agents-work-apps Patch
@inkeep/agents-api Patch
@inkeep/agents-manage-ui Patch
@inkeep/agents-cli Patch
@inkeep/agents-core Patch
@inkeep/agents-mcp Patch
@inkeep/agents-sdk Patch
@inkeep/ai-sdk-provider Patch
@inkeep/create-agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(0) Total Issues | Risk: Low

This is a clean, well-scoped PR that consistently applies a disambiguation pattern across both Slack modal builders. The change is straightforward and the rationale (agent names aren't unique within a project) is sound.

💭 Consider (2) 💭

💭 1) modals.ts:82,328 Cross-surface display format divergence

Issue: The Slack modal now uses Name (id) inline format, while the Management UI Slack configuration components (bulk-select-agent-bar.tsx, workspace-default-section.tsx, channel-agent-cell.tsx) use a two-line format with name on top and project name below.

Why: This creates different agent display conventions depending on where the user is selecting agents. However, this is justified by Slack Block Kit constraints — plain_text option text in select menus only supports single-line display.

Fix: The divergence is acceptable given the platform constraint. The Name (id) pattern also has precedent in traces/observability UI (timeline-item.tsx, conversation-list-item.tsx). No change needed, but worth being aware of for future consistency considerations.

Refs:

💭 2) modals.test.ts Display format test coverage

Issue: Existing tests verify initial_option.value (the JSON payload) but don't assert on the text property that now contains the new Name (id) format.

Why: Adding assertions for the display text would catch regressions if the format logic changes. This is minor since the change is straightforward and tests pass.

Fix: Consider adding test cases that verify:

  • When agent.name exists → text is ${name} (${id})
  • When agent.name is null → text falls back to just id

Refs:


✅ APPROVE

Summary: Clean implementation that applies the disambiguation pattern consistently to both modal builders. The Name (id) format aligns with existing traces UI patterns and is justified by Slack's single-line display constraint. Ship it! 🚀

Reviewers (3)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-standards 0 0 0 0 0 0 0
pr-review-consistency 2 0 1 0 0 0 1
pr-review-product 2 0 1 0 0 0 1
Total 4 0 2 0 0 0 2

Note: The INFO-level findings about pattern alignment with traces UI were merged with the consistency concern (counted once in Consider). The LOW-confidence finding about multi-persona coherence was merged with the cross-surface consistency finding.

Discarded (2)
Location Issue Reason Discarded
modals.ts:82,328 INFO: Pattern aligns with traces UI Informational, not an issue — merged into the consistency consideration
modals.ts:82 INFO: Display format differs from Manage UI LOW confidence, duplicative of consistency finding — merged

@github-actions github-actions Bot deleted a comment from claude Bot Feb 24, 2026
@itoqa
Copy link
Copy Markdown

itoqa Bot commented Feb 24, 2026

Ito Test Report ✅

17 test cases ran. 17 passed.

All tests verified the PR changes that update Slack modal dropdowns to display agents in "Name (id)" format instead of just the name or ID. The core functionality was validated through unit tests for both buildAgentSelectorModal and buildMessageShortcutModal functions. Edge cases for null names, empty strings, special characters, and large agent lists all passed. The Manage UI Slack configuration page loaded successfully without JavaScript errors, confirming no regressions.

✅ Passed (17)
Test Case Summary Timestamp Screenshot
ROUTE-1 Verified buildAgentSelectorModal displays agents as 'Name (id)' via unit tests: single agent shows 'Inkeep QA Graph (facts-agent)', multiple agents all formatted correctly, value JSON contains correct agentId/projectId 0:00 ROUTE-1_0-00.png
ROUTE-2 Verified buildMessageShortcutModal displays agents as 'Name (id)' via unit tests: single agent shows 'Agent B1 (agent-b1)', multiple agents all formatted correctly, value JSON contains correct agentId/projectId 0:03 ROUTE-2_0-03.png
ROUTE-3 Verified project change rebuilds agent dropdown with 'Name (id)' format: selectedProjectId produces correct format, switching projects maintains consistency, initial_option uses same format 0:09 ROUTE-3_0-09.png
ROUTE-4 Navigated to /default/work-apps/slack after bypassing NEXT_PUBLIC_ENABLE_WORK_APPS feature flag. Slack Integration page loaded successfully showing 'Slack Integration Admin' heading with 'No Slack connections' message and Install to Slack button. Zero JavaScript console errors detected. 3:26 ROUTE-4_3-26.png
EDGE-1 Verified that agents with name=null display only the agent ID without parentheses or 'null' text in both buildAgentSelectorModal and buildMessageShortcutModal. Unit tests confirm option text is 'my-agent' with no parentheses. 5:13 EDGE-1_5-13.png
EDGE-2 Verified that agents with name='' (empty string) display only the agent ID without parentheses in both buildAgentSelectorModal and buildMessageShortcutModal. Empty string is falsy so the ternary falls through to agent.id only. 5:14 EDGE-2_5-14.png
EDGE-3 Verified that combined text 'Name (id)' with long name (44 chars) and long ID (31 chars) produces 77-char string exceeding Slack 75-char plain_text limit. Both buildAgentSelectorModal and buildMessageShortcutModal produce the same result. No truncation is applied. 7:41 EDGE-3_7-41.png
EDGE-4 Verified that an agent with name='My Agent (test)' displays as 'My Agent (test) (my-agent)' in both modal builders. The parentheses in the name do not interfere with the ID parentheses appended by the format function. 5:15 EDGE-4_5-15.png
EDGE-5 Verified that two agents both named 'QA Agent' are displayed as 'QA Agent (qa-agent-v1)' and 'QA Agent (qa-agent-v2)' respectively, making them distinguishable. Tested in both buildAgentSelectorModal and buildMessageShortcutModal. 5:15 EDGE-5_5-15.png
EDGE-6 Verified that when a single agent is provided, the initial_option text uses 'Solo Agent (solo-agent)' format with type 'plain_text', and the value JSON contains correct agentId and projectId. Tested in both modal builders. 5:17 EDGE-6_5-17.png
EDGE-7 Verified that an agent with id='agent/v2.0-beta_test' displays as 'Test Agent (agent/v2.0-beta_test)' in both modal builders. The special characters (slash, dot, hyphen, underscore) are preserved in the display text and the JSON value remains valid. 5:17 EDGE-7_5-17.png
EDGE-8 Verified that when agents array is empty, both modal builders show a single option with value='none' and plain_text type, and no initial_option is set. The fallback behavior is preserved from before the PR changes. 5:18 EDGE-8_5-18.png
ADV-1 Verified that a 75-char name combined with ID produces 80-char text exceeding Slack's 75-char plain_text limit. No truncation logic exists in the code. Both buildAgentSelectorModal and buildMessageShortcutModal produce identical oversized output. 7:51 ADV-1_7-51.png
ADV-2 Verified XSS payload '<script>alert(1)</script>' is treated as literal text in Slack plain_text context. Output: '<script>alert(1)</script> (xss-agent)' with type 'plain_text'. No HTML rendering or injection risk in Slack Block Kit plain_text fields. 7:58 ADV-2_7-58.png
ADV-3 Verified newline characters in agent name produce 'Agent\nWith\nNewlines (ctrl-agent)'. Modal JSON remains structurally valid after JSON.stringify/parse roundtrip. Both buildAgentSelectorModal and buildMessageShortcutModal handle control characters identically. 8:04 ADV-3_8-04.png
ADV-4 Verified whitespace-only name ' ' (3 spaces) is truthy, so ternary takes the 'Name (id)' branch producing ' (ws-agent)'. This is a potential UX issue: Slack will display leading whitespace before the ID in parentheses. Both modal builders produce identical output. 8:11 ADV-4_8-11.png
ADV-5 Verified 100 agents all display correct 'Name (id)' format. Checked first (Agent 1), middle (Agent 50), and last (Agent 100) options. All 100 options match regex /^.+ (.+)$/ with type plain_text. Modal JSON is structurally valid. Both buildAgentSelectorModal and buildMessageShortcutModal handle 100 agents identically. 8:19 ADV-5_8-19.png
📋 View Recording

Screen Recording

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.

1 participant