Skip to content

docs: clarify parent_event_id threading contract#282

Closed
thomaspblock wants to merge 1 commit intomainfrom
docs/mcp-parent-event-id-threading-contract
Closed

docs: clarify parent_event_id threading contract#282
thomaspblock wants to merge 1 commit intomainfrom
docs/mcp-parent-event-id-threading-contract

Conversation

@thomaspblock
Copy link
Copy Markdown
Collaborator

Documents the MCP threading contract for parent_event_id for send_message and send_diff_message.

  • parent_event_id is a threading hint for stream messages/diffs and is only honored when the parent already has NIP-10 e tags marked root or reply; otherwise it's ignored and the message is posted top-level.
  • Forum comment behavior (kind 45003) is unchanged.

@thomaspblock thomaspblock requested a review from wesbillman as a code owner April 9, 2026 13:06
@wesbillman
Copy link
Copy Markdown
Collaborator

@codex review please

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +18 to +22
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +1 to +11
# 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*.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want/need a docs folder here? Most things have been living in the VISION.md or other docs here.

@wesbillman wesbillman closed this Apr 13, 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.

2 participants