Skip to content

Support '!' prefix in broker messages as inline interrupt#180

Closed
scion-gteam[bot] wants to merge 2 commits into
mainfrom
scion/interrupt-prefix-feature
Closed

Support '!' prefix in broker messages as inline interrupt#180
scion-gteam[bot] wants to merge 2 commits into
mainfrom
scion/interrupt-prefix-feature

Conversation

@scion-gteam

@scion-gteam scion-gteam Bot commented Jun 8, 2026

Copy link
Copy Markdown

Summary

  • Messages arriving via the broker (Telegram, webhooks, direct messages) that start with ! are now treated as interrupt messages
  • The ! prefix is stripped from the message body before delivery
  • The message is delivered with urgent=true / interrupt semantics, equivalent to --interrupt on the CLI
  • Detection happens in deliverToAgent in the message broker proxy, before persistence and dispatch, so both the stored message and the delivered message reflect the stripped content and urgent flag

Test plan

  • TestMessageBrokerProxy_InterruptPrefix — verifies !-prefixed message is stripped and dispatched with interrupt=true
  • TestMessageBrokerProxy_InterruptPrefixNotStrippedWithoutBang — verifies normal messages are unaffected
  • TestMessageBrokerProxy_InterruptPrefixPersistence — verifies the persisted message has stripped content and urgent=true
  • All existing message broker tests continue to pass

Messages arriving via the broker (Telegram, webhooks, direct messages)
that start with "!" are now treated as interrupt messages: the "!" is
stripped and the message is delivered with urgent/interrupt semantics,
equivalent to --interrupt on the CLI.
deliverToAgent mutates msg.Msg and msg.Urgent in place, but at the
direct-subscriber call site the pointer comes from the event bus and is
shared across all matching subscribers. Shallow-copy before mutating so
the original bus message stays intact.
@ptone ptone closed this Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant