mcp: gate parent_event_id threading on NIP-10 markers#281
mcp: gate parent_event_id threading on NIP-10 markers#281thomaspblock wants to merge 1 commit intomainfrom
Conversation
|
@codex review please |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc68a56f6e
ℹ️ 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".
| if !parent_event_has_nip10_markers(parent_tags) { | ||
| tracing::info!( | ||
| parent_event_id = parent_event_id, | ||
| "resolve_thread_ref_if_thread_context: parent event has no NIP-10 root/reply markers; ignoring thread context" | ||
| ); |
There was a problem hiding this comment.
Preserve direct replies when parent has no NIP-10 tags
resolve_thread_ref_if_thread_context drops parent_event_id whenever the parent lacks e tags with root/reply, but top-level messages normally have no NIP-10 markers. That means replying to a root message now produces a new top-level post in both send_message and send_diff_message, so MCP clients can no longer start a thread from a non-threaded message (a behavior that worked before this commit). Treating markerless parents as a direct reply (root == parent) avoids this regression while still handling nested thread ancestry.
Useful? React with 👍 / 👎.
Prevents accidental thread creation for stream messages when parent_event_id references a root message without explicit NIP-10 root/reply markers. Forum comments are unaffected.\n\n- Only touches crates/sprout-mcp/src/server.rs\n- Adds unit tests for the NIP-10 marker detection helper\n\nTest: cargo test -p sprout-mcp