#4562: fix(nostr): use dispatchReplyFromConfig for inbound messages
channel: nostr
Cluster:
Signal and Discord Fixes
The Nostr channel was calling a non-existent handleInboundMessage method on the plugin runtime. This refactors the onMessage handler to use the correct API pattern:
- Build proper MsgContext with all required fields
- Finalize context with finalizeInboundContext
- Record session metadata with recordInboundSession
- Create reply dispatcher with createReplyDispatcherWithTyping
- Dispatch to agent with dispatchReplyFromConfig
This follows the same pattern used by Matrix, MS Teams, and Mattermost channel extensions.
Fixes #4547
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the Nostr inbound DM handler to follow the standard channel pipeline used by other extensions: resolve an agent route, build/finalize an inbound `MsgContext`, record session metadata, create a reply dispatcher (with no-op typing hooks for Nostr), and dispatch via `dispatchReplyFromConfig` instead of calling a non-existent `handleInboundMessage` API.
Overall the refactor aligns Nostr with Matrix/Mattermost/Teams patterns and should restore inbound message handling; the main area to double-check is the `MsgContext` addressing fields (`To`/`OriginatingTo`) to ensure routing/session keys and reply targeting behave as intended for DMs.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge, with one DM addressing detail to verify.
- Change is localized to Nostr inbound handling and follows established patterns from other channel extensions; the main risk is subtle behavior changes if `MsgContext.To`/`OriginatingTo` are expected to reference the peer/room rather than the bot account id, which could affect session routing or replies.
- extensions/nostr/src/channel.ts (verify `To`/`OriginatingTo` semantics for Nostr DMs)
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#4878: fix: string/type handling and API fixes (#4537, #4380, #4373, #4547...
by lailoo · 2026-01-30
80.7%
#21778: Nostr: enforce inbound DM policy and command authorization
by chansuke · 2026-02-20
79.8%
#16507: feat(nostr): refactor channel dispatch logic (AI-assisted)
by tanujbhaud · 2026-02-14
79.6%
#11898: Fix for issue #11895
by rerickardjr · 2026-02-08
79.5%
#7562: fix: nostr plugin filter double-wrapping in subscribeMany
by kaigritun · 2026-02-03
75.1%
#7353: fix: prevent silent message drops after config.patch restart
by 18-RAJAT · 2026-02-02
74.5%
#19274: feat(mattermost): enable threaded replies in channels
by rockinyp · 2026-02-17
74.3%
#16570: feat(mattermost): add replyToMode threading support
by FBartos · 2026-02-14
74.1%
#15863: fix: route agent-to-agent Slack messages to bound sessions
by MisterGuy420 · 2026-02-14
73.8%
#9051: fix(sessions): respect dmScope config in CLI agent commands
by benleavett · 2026-02-04
73.3%