Skip to content

fix(discord): support applied_tags for forum thread creation#30358

Merged
steipete merged 1 commit intoopenclaw:mainfrom
pushkarsingh32:fix/discord-forum-thread-tags
Mar 2, 2026
Merged

fix(discord): support applied_tags for forum thread creation#30358
steipete merged 1 commit intoopenclaw:mainfrom
pushkarsingh32:fix/discord-forum-thread-tags

Conversation

@pushkarsingh32
Copy link
Contributor

Summary

  • Forum channels that require tags fail with A tag is required to create a forum post in this channel because there was no way to pass tag IDs during thread creation.
  • Added appliedTags parameter (string array of tag IDs) to the thread-create action, passed as Discord API's applied_tags field on forum/media thread creation requests.
  • Tag IDs are already discoverable via channel-list which returns available_tags.

Closes #30309

Change Type

  • Feature

Scope

  • Integrations

Files Changed

  • src/discord/send.types.ts — added appliedTags?: string[] to DiscordThreadCreate
  • src/discord/send.messages.ts — pass applied_tags in request body for forum/media threads
  • src/agents/tools/message-tool.ts — added appliedTags to thread schema
  • src/channels/plugins/actions/discord/handle-action.ts — read and forward appliedTags param
  • src/agents/tools/discord-actions-messaging.ts — read and forward appliedTags param
  • src/discord/send.creates-thread.test.ts — added tests for forum tag passing and non-forum exclusion

Test plan

  • New unit tests verify applied_tags is included in forum thread creation body
  • New unit test verifies applied_tags is omitted for non-forum channels
  • All 24 existing thread tests continue to pass

Forum channels that require tags fail with "A tag is required" when
creating threads because there was no way to pass tag IDs. Add
appliedTags parameter to the thread-create action so forum posts can
include required tags from the channel's available_tags list.
@openclaw-barnacle openclaw-barnacle bot added channel: discord Channel integration: discord agents Agent runtime and tooling size: S labels Mar 1, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 1, 2026

Greptile Summary

Added support for appliedTags parameter to enable tag selection when creating forum/media threads in Discord. The parameter accepts an array of tag IDs that are passed to Discord's applied_tags API field.

Key changes:

  • Added appliedTags?: string[] field to DiscordThreadCreate type with proper documentation
  • Tags are conditionally included in the request body only for forum/media channels (not regular text channels)
  • Parameter properly threaded through all action handlers (message-tool.ts, handle-action.ts, discord-actions-messaging.ts)
  • Added comprehensive tests verifying tags are sent for forum channels and omitted for non-forum channels

Implementation details:

  • Uses existing readStringArrayParam helper for consistent parameter parsing
  • Channel type detection via Discord API to determine if tags should be included
  • Falls back gracefully when channel lookup fails (lets Discord validate)
  • Handles empty arrays correctly by treating them as no tags

The implementation is clean, type-safe, and follows existing patterns in the codebase.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a straightforward additive feature with clear implementation, proper type safety, comprehensive test coverage, and no breaking changes. The code follows existing patterns and handles edge cases appropriately.
  • No files require special attention

Last reviewed commit: b09a595

@steipete steipete merged commit 7f4d1b7 into openclaw:main Mar 2, 2026
30 checks passed
@steipete
Copy link
Contributor

steipete commented Mar 2, 2026

Landed via temp rebase onto main.

  • Gate: bunx vitest run src/discord/send.creates-thread.test.ts src/agents/tools/message-tool.test.ts
  • Land commit: 6afac0f
  • Merge commit: 7f4d1b7

Thanks @pushkarsingh32!

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

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord forum thread-create: support applied_tags parameter

2 participants