Skip to content

feat(channels): support default audience request flag - #91

Merged
jacobo-doist merged 4 commits into
mainfrom
jacobo/sdk-default-audience-prompt
Oct 23, 2026
Merged

jacobo-doist merged 4 commits into
mainfrom
jacobo/sdk-default-audience-prompt

Conversation

@jacobo-doist

@jacobo-doist jacobo-doist commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The channel create and update request schemas already expose defaultGroups and defaultRecipients, which define the groups and individual users selected as a channel default audience. They were missing useDefaultRecipients, the flag that tells Comms whether to use those values instead of defaulting to everyone in the channel.

This adds the missing optional useDefaultRecipients field to CreateChannelArgs and UpdateChannelArgs, completing the existing default-audience request shape.

Behavior

  • useDefaultRecipients: true activates the audience in defaultGroups and defaultRecipients.
  • useDefaultRecipients: false defaults new threads to everyone in the channel.
  • Empty defaultGroups and defaultRecipients arrays clear the saved custom audience.

comms-cli use case

This is groundwork for a planned comms-cli default-audience feature. The CLI will be able to configure a custom channel audience by sending useDefaultRecipients: true with the selected groups and users, or reset the channel to everyone by sending useDefaultRecipients: false with empty arrays. With the complete request shape exported by the SDK, that implementation can use CreateChannelArgs and UpdateChannelArgs directly without a CLI-specific type workaround.

Once released, the CLI should adopt the expected @doist/comms-sdk@3.9.0 release.

@jacobo-doist
jacobo-doist marked this pull request as ready for review October 5, 2026 15:30
@jacobo-doist jacobo-doist added the 🙋 Ask PR requires passing checks and independent human review before merge. label Oct 5, 2026

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR adds an optional, nullable useDefaultRecipients flag to the channel create/update request schemas, with wire-serialization tests covering both true and false for create and update plus empty defaultGroups/defaultRecipients arrays, and a changelog entry — nice groundwork for the comms-cli default-audience feature. No inline issues were flagged; the new field follows the existing nullable/optional schema conventions, serialization through the shared snake-case transport is covered by tests that match the established per-client wire-serialization pattern, and the changelog entry fits the repo's keep-a-changelog style.

I also left one optional follow-up note in the details below.

Optional follow-up note (1)
  • P3 src/clients/channels-client.test.ts:24: The suffix tuple element is fully determined by method (createChannel → add, updateChannel → update), so the table carries redundant state and the two can drift apart. Derive suffix from method (or drop method and select the call from suffix) so there's a single source of truth.

Share Feedback • Review Logs

@jacobo-doist

Copy link
Copy Markdown
Contributor Author

@doistbot Fixed in 94064e0: removed the redundant endpoint suffix from the test matrix and now derive it from method, leaving a single source of truth.

@doistbot

doistbot commented Oct 6, 2026

Copy link
Copy Markdown
Member

Confirmed—94064e0 removes the redundant suffix from the test matrix and derives it from method, so that resolves my optional note. I couldn’t run the test because Vitest isn’t installed in the checkout.

@jacobo-doist
jacobo-doist requested a review from amix October 6, 2026 14:40

@amix amix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🚀

@jacobo-doist
jacobo-doist merged commit 0207cf1 into main Oct 23, 2026
5 checks passed
@jacobo-doist
jacobo-doist deleted the jacobo/sdk-default-audience-prompt branch October 23, 2026 15:46
doist-release-bot Bot added a commit that referenced this pull request Oct 23, 2026
## [3.9.0](v3.8.1...v3.9.0) (2026-10-23)

### Features

* **channels:** support default audience request flag ([#91](#91)) ([0207cf1](0207cf1))
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Ask PR requires passing checks and independent human review before merge. released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants