Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .agents/skills/dailybot/conversation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ Participants can be named three ways — the CLI resolves them for you:
> The bot is added automatically — you do **not** pass the bot as a participant.
> One human participant already makes a valid group with the bot.

### Participant limit

Slack group DMs (MPIMs) support **at most 8 total members**. The Dailybot bot
always occupies one slot, so you can pass **at most 7 user UUIDs / emails /
names**. The CLI rejects more than 7 before making the API call; the server also
validates and returns `400 conversation_too_many_participants` if the limit is
exceeded.

---

## Step 3 — Open the Conversation (idempotent)
Expand Down Expand Up @@ -170,6 +178,7 @@ Match on the machine-readable `code` (with `--json`), never the prose `detail`.
|------|--------|------------------------|
| 406 | `open_conversation_not_supported` | Org is not on Slack. Tell the developer group DMs are Slack-only; stop. |
| 403 | — | Caller is not an org admin. Explain the command needs admin rights. |
| 400 | `conversation_too_many_participants` | More than 7 users passed (8 total including the bot). Reduce the list. |
| 400 | `one_or_more_users_not_found` | A participant isn't an active org user. Re-check the names/UUIDs. |
| 400 | `no_valid_users` | The list contained invalid UUIDs. Fix the identifiers. |
| 400 | `params_validation_error` | `users_uuids` wasn't a list — a CLI usage error; re-run with `-u`. |
Expand Down
21 changes: 21 additions & 0 deletions dailybot_cli/commands/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)

GROUP_CHAT_TYPE: str = "group_chat"
MAX_CONVERSATION_PARTICIPANTS: int = 7 # Slack MPIM limit: 8 total, minus the bot


def _split_identifiers(values: tuple[str, ...]) -> list[str]:
Expand Down Expand Up @@ -67,6 +68,11 @@ def _exit_for_conversation_error(exc: APIError, json_mode: bool) -> NoReturn:
message = "One or more users were not found or aren't active in your organization."
elif code == "no_valid_users":
message = "The participant list contains invalid user UUIDs."
elif code == "conversation_too_many_participants":
message = (
f"Too many participants. Slack group DMs support at most "
f"{MAX_CONVERSATION_PARTICIPANTS} users plus the Dailybot bot (8 total)."
)
elif code == "conversation_can_not_be_opened":
message = "Slack rejected the request. A participant may be deactivated on the Slack side."
elif exc.status_code == 403:
Expand Down Expand Up @@ -147,6 +153,14 @@ def conversation_open(
print_error("Provide at least one participant with --user (UUID, email, or name).")
raise SystemExit(1)

if len(identifiers) > MAX_CONVERSATION_PARTICIPANTS:
print_error(
f"Too many participants ({len(identifiers)}). "
f"Slack group DMs support at most {MAX_CONVERSATION_PARTICIPANTS} "
"users plus the Dailybot bot (8 total)."
)
raise SystemExit(1)

client: DailyBotClient = require_auth()
try:
participants: list[tuple[str, str]] = _resolve_participants(client, identifiers)
Expand All @@ -155,6 +169,13 @@ def conversation_open(
raise SystemExit(1)

uuids: list[str] = [uuid for uuid, _name in participants]
if len(uuids) > MAX_CONVERSATION_PARTICIPANTS:
print_error(
f"Too many participants ({len(uuids)}). "
f"Slack group DMs support at most {MAX_CONVERSATION_PARTICIPANTS} "
"users plus the Dailybot bot (8 total)."
)
raise SystemExit(1)
try:
with console.status("Opening group conversation..."):
result: dict[str, Any] = client.open_conversation(uuids)
Expand Down