feat(notify): Add support for sending plain text messages - #929
Merged
Conversation
added 5 commits
February 1, 2026 17:36
Documentation showed shorthand syntax 'work notify send TASK-001 to alerts' but implementation only accepted full syntax 'work notify send where <query> to <target>'. Changes: - Modified src/cli/commands/notify/send.ts to support both syntaxes - Removed fixed arg definitions, using strict=false for flexible parsing - Added argv parsing to detect shorthand vs full syntax - Shorthand 'TASK-001 to alerts' is converted to 'id=TASK-001' - Added test case for shorthand syntax in notify-workflow.test.ts - Updated examples to show shorthand first Fixes #853
Prevent malformed query 'id=' when task ID is empty. Addresses code review feedback.
…tion targets Users can now send arbitrary multi-line messages directly to notification targets without creating work items. This extends notify send with a third syntax: `work notify send "message" to <target>` alongside existing work item notification methods. Changes: - Add message syntax detection in notify/send command (spaces/newlines trigger message mode) - Implement WorkEngine.sendPlainNotification() method - Add NotificationService.sendPlainNotification() using special marker work item - Extend TelegramTargetHandler with formatPlainMessage() for 📬 formatted output - Add e2e test validating plain message delivery Pattern: Uses __plain_message__ marker work item to signal plain text mode Decision: Marker approach avoids breaking TargetHandler interface changes Related: Bash handler automatically supports plain messages via JSON passthrough Testing: 389 tests passing including new e2e telegram plain message test Implementation verified against current Telegram Bot API standards (HTML escaping, parse_mode, character limits) and oclif strict=false best practices.
Resolved conflicts in src/cli/commands/notify/send.ts: - Main branch added shorthand syntax support (PR #853) - This branch adds message syntax support - Merged to support all three syntaxes: message, shorthand, where clause
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Currently, the
work notify sendcommand only supports sending notifications about existing work items via query syntax (where <query> to <target>orTASK-001 to <target>). Users cannot send arbitrary messages like status updates, announcements, or free-form notifications without creating a work item first.Solution
Extended the
work notify sendcommand to accept a third syntax:work notify send "message content" to <target>. The command parser detects quoted message strings and bypasses the work item query path, formatting and sending the message directly to the specified target.Detection heuristic: Messages containing spaces or newlines are treated as plain messages; single-word inputs are treated as task IDs.
Implementation approach: Uses a special marker work item (
__plain_message__ID) to signal plain message mode to handlers, avoiding breaking changes to theTargetHandlerinterface.Changes
Core Implementation
src/cli/commands/notify/send.ts: Added third syntax branch for message detectionsrc/core/engine.ts: AddedsendPlainNotification()methodsrc/core/notification-service.ts: AddedsendPlainNotification()using marker work itemsrc/core/target-handlers/telegram-handler.ts: AddedformatPlainMessage()with 📬 icon formattingTesting
tests/e2e/telegram-notification.test.ts: Added e2e test for plain message deliveryDocumentation
.claude/PRPs/Testing
Validation Performed
Target Support
__plain_message__markerExample Usage
Implementation Details
Security & Best Practices
<,>,&) to prevent injectionstrict=falsebest practicesArchitecture Decisions
__plain_message__marker over interface extension for MVP simplicityNotes
TargetHandlerinterface method if neededRelated: Implementation of feature request for direct message notifications without work item dependency.