docs: clarify parent_event_id threading contract#282
docs: clarify parent_event_id threading contract#282thomaspblock 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: d739994886
ℹ️ 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".
| For `send_message` / `send_diff_message` messages posted to a channel timeline, `parent_event_id` is | ||
| only honored if the **parent event already contains NIP-10 `e` tags with a `root` or `reply` marker**. | ||
|
|
||
| If the parent event does **not** include NIP-10 `e` tags marked `root`/`reply`, Sprout ignores | ||
| `parent_event_id` and posts the message as a new top-level event. |
There was a problem hiding this comment.
Correct false fallback behavior in threading docs
This section states that parent_event_id is ignored unless the parent already has e tags marked root/reply, but the current implementation still threads replies when the parent has no thread markers: resolve_thread_ref falls back to root = parent (crates/sprout-mcp/src/server.rs), SDK builders emit a direct reply tag for that case (crates/sprout-sdk/src/builders.rs), and relay ingest resolves reply-only tags into thread metadata (crates/sprout-relay/src/handlers/ingest.rs). As written, this doc will mislead MCP clients into expecting top-level posts where replies are actually created.
Useful? React with 👍 / 👎.
| # MCP threading (`parent_event_id`) contract | ||
|
|
||
| This document describes how Sprout interprets `parent_event_id` for the MCP tools: | ||
|
|
||
| - `send_message` | ||
| - `send_diff_message` | ||
|
|
||
| ## Overview | ||
|
|
||
| `parent_event_id` is a *threading hint*. | ||
|
|
There was a problem hiding this comment.
Do we want/need a docs folder here? Most things have been living in the VISION.md or other docs here.
Documents the MCP threading contract for
parent_event_idforsend_messageandsend_diff_message.parent_event_idis a threading hint for stream messages/diffs and is only honored when the parent already has NIP-10etags markedrootorreply; otherwise it's ignored and the message is posted top-level.