You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support '!' prefix in broker messages as inline interrupt (#375)
* Support "!" prefix in broker messages as inline interrupt signal
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.
* Fix pointer mutation of event-bus message in interrupt prefix handling
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.
* Handle whitespace and empty-content edge cases in interrupt prefix
TrimSpace the message before checking for the "!" prefix so leading
whitespace (e.g. " !restart") is handled correctly. TrimSpace the
content after stripping the prefix so "! restart" works too. Default
to "interrupt" when the stripped content is empty (bare "!" or "! ")
to satisfy the Msg-required invariant in StructuredMessage.Validate.
Adds table-driven tests covering all edge cases.
* Fix CI failures: errcheck lint and no_sqlite build tag
- Use t.Cleanup with explicit error discard for eventbus Close() calls
in new test functions to satisfy the errcheck linter.
- Add //go:build !no_sqlite constraint to signing_key_shared_test.go
so newTestStore is available when `go vet -tags no_sqlite` runs.
* Fix gofmt struct field alignment in edge case test
---------
Co-authored-by: Scion Agent (fix-interrupt-prefix) <agent@scion.dev>
0 commit comments