Skip to content

Tighten TTS directive parsing, disable Bolt ignoreSelf for socket mode, and recognize bundled provider IDs in validation#1

Merged
yejiming merged 1 commit intomainfrom
jimmy/find-suitable-entry-point-for-contribution
Mar 29, 2026
Merged

Tighten TTS directive parsing, disable Bolt ignoreSelf for socket mode, and recognize bundled provider IDs in validation#1
yejiming merged 1 commit intomainfrom
jimmy/find-suitable-entry-point-for-contribution

Conversation

@yejiming
Copy link
Copy Markdown
Owner

Motivation

  • Prevent accidental parsing of inline TTS directive examples and ensure directives are only recognized when on their own lines.
  • Ensure Slack socket mode receives reaction events by disabling Bolt's ignoreSelf middleware so the app-level filtering is used instead.
  • Treat bundled provider auto-enable plugin IDs as known during config validation to avoid spurious warnings.

Description

  • Updated parseTtsDirectives in src/tts/directives.ts to only match block and [[tts:...]] directives when placed on their own lines, preventing inline examples from being treated as directives.
  • Adjusted TTS-related tests in src/plugins/contracts/tts.contract.test.ts to reflect the stricter directive parsing and added a test that inline literal directive examples remain plain text.
  • Set ignoreSelf: false in the Slack socket-mode App options in extensions/slack/src/monitor/provider.ts and added a comment explaining the change.
  • Extended the Slack test harness in extensions/slack/src/monitor.test-helpers.ts to capture the last App constructor options via getLastSlackAppOptions so tests can assert socket-mode options, and added a corresponding test in extensions/slack/src/monitor.tool-result.test.ts to verify socketMode and ignoreSelf settings.
  • Included BUNDLED_AUTO_ENABLE_PROVIDER_PLUGIN_IDS into the known plugin ID set in src/config/validation.ts and added a unit test src/config/config.plugin-validation.test.ts to ensure bundled provider auto-enable plugin IDs are treated as known during validation.

Testing

  • Ran the unit test suite (Vitest) covering Slack monitor tests, TTS directive tests, and config validation tests; all modified and related tests passed.
  • Verified the new Slack test asserts socketMode and ignoreSelf via the added getLastSlackAppOptions helper and test, which succeeded.
  • Confirmed the updated TTS parsing tests (including the inline-literal example) pass under the stricter matching rules.

Codex Task

@yejiming yejiming merged commit 1be000a into main Mar 29, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1928898565

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/tts/directives.ts

const blockRegex = /\[\[tts:text\]\]([\s\S]*?)\[\[\/tts:text\]\]/gi;
const blockRegex =
/(?:^|\n)[ \t]*\[\[tts:text\]\][ \t]*(?:\n|$)([\s\S]*?)(?:\n|^)[ \t]*\[\[\/tts:text\]\][ \t]*(?=\n|$)/gi;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept CRLF in standalone TTS directive matching

The new standalone-line regexes only recognize \n boundaries, so directives are silently missed when text uses Windows-style \r\n newlines. In that case parseTtsDirectives leaves hasDirective false and skips provider/text overrides even when directives are on their own lines, which is a regression from the previous parser behavior for the same content with CRLF line endings.

Useful? React with 👍 / 👎.

// Slack Bolt's default ignoreSelf middleware can suppress reaction
// events on bot-authored messages (item_user is the bot). Keep it
// disabled and rely on OpenClaw's explicit message-level filtering.
ignoreSelf: false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter bot reaction events after disabling Bolt ignoreSelf

Setting ignoreSelf: false in socket mode allows the app's own reaction events through, but the reaction handler path does not exclude event.user === ctx.botUserId. When messages.ackReaction is enabled, OpenClaw can process its own ack reactions as inbound reaction events and enqueue extra system-event prompts ("reaction added"), creating noisy or misleading follow-up context in normal channel traffic.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant