Skip to content

📝 CodeRabbit Chat: Add ASCII flow to runtime surface docs - #33

Merged
Agent-Hellboy merged 1 commit into
codex/mcp-draft-supportfrom
coderabbitai/chat/fedb7de
Jul 3, 2026
Merged

Agent-Hellboy merged 1 commit into
codex/mcp-draft-supportfrom
coderabbitai/chat/fedb7de

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Code changes was requested by @Agent-Hellboy.

The following files were modified:

  • docs/runtime-surface.md

Summary by CodeRabbit

  • Documentation
    • Added a new section describing the draft stateless request flow end-to-end.
    • Clarified how stateless requests are processed, including required metadata checks, header validation, and error handling.
    • Documented the expected response characteristics for stateless requests, including sessionless behavior and returned response fields.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new documentation section to docs/runtime-surface.md describing the "Draft Stateless Request Flow" for protocol version 2026-07-28, covering metadata validation, header checks, error handling, and dispatcher middleware sequencing.

Changes

Documentation Update

Layer / File(s) Summary
Stateless request flow documentation
docs/runtime-surface.md
New section documents how draft stateless requests bypass initialize/sessions, require protocol/client metadata in params._meta, validate against HTTP headers, short-circuit on mismatch/protocol/version errors, trigger RequestMetadataError on malformed metadata, and describes the dispatcher middleware pipeline and resulting response fields (no MCP-Session-Id, resultType, ttlMs, cacheScope).

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: an ASCII flow was added to the runtime surface documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

Comment thread docs/runtime-surface.md

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.

Change it to mermaid and this should get rendered in the docs.

@Agent-Hellboy

Copy link
Copy Markdown
Collaborator

@coderabbitai

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
gh pr view 33 --repo Agent-Hellboy/py-mcp --json title,body,files
echo "---"
gh api repos/Agent-Hellboy/py-mcp/pulls/32/comments --jq '.[] | select(.id==3521448625 or (.body | contains("ASCII")))'
echo "---file---"
find . -iname "runtime-surface.md" -exec cat {} \;

Length of output: 28865


@Agent-Hellboy I see the ASCII flow diagram has been added to docs/runtime-surface.md under "Draft Stateless Request Flow," matching what was requested in the earlier review discussion. I'll go ahead and review the PR now.

✅ Action performed

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
docs/runtime-surface.md (1)

31-90: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Label the diagram fence.

This block is still an unlabeled fenced code block, so markdownlint will flag it. Use text here to keep the docs lint-clean.

Proposed fix
-```
+```text
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/runtime-surface.md` around lines 31 - 90, The runtime surface diagram is
still an unlabeled fenced code block, which will trip markdownlint. Update the
fence around the client/HTTP transport diagram in docs/runtime-surface.md to use
a text-labeled code block so the markdown stays lint-clean; keep the diagram
content unchanged and just adjust the fence markup.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/runtime-surface.md`:
- Around line 92-95: Update the runtime-surface documentation wording to match
the actual `_meta` contract: `validate_meta_value()` only rejects non-object
`_meta` values, while a missing `_meta` is treated as empty metadata. Replace
the “missing `_meta`” / `RequestMetadataError` wording with the correct
`MetaValidationError` terminology, and keep the description aligned with
`dispatch_stateless` and the `_meta` validation behavior shown in the runtime
snippets.

---

Duplicate comments:
In `@docs/runtime-surface.md`:
- Around line 31-90: The runtime surface diagram is still an unlabeled fenced
code block, which will trip markdownlint. Update the fence around the
client/HTTP transport diagram in docs/runtime-surface.md to use a text-labeled
code block so the markdown stays lint-clean; keep the diagram content unchanged
and just adjust the fence markup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6b31e8c-9fdb-4fe2-9803-0579d83fe4b2

📥 Commits

Reviewing files that changed from the base of the PR and between fedb7de and 95c6455.

📒 Files selected for processing (1)
  • docs/runtime-surface.md

Comment thread docs/runtime-surface.md
Comment on lines +92 to +95
Errors short-circuit at the HTTP layer (`HEADER_MISMATCH`,
`UNSUPPORTED_PROTOCOL_VERSION`) before ever reaching the dispatcher, and
`RequestMetadataError` short-circuits inside `dispatch_stateless` for
malformed or missing `_meta` fields.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Tighten the _meta error wording.

validate_meta_value() only rejects non-object _meta values; missing _meta is treated as empty metadata. The provided runtime snippets also raise MetaValidationError, so “missing _meta” / RequestMetadataError misstates the contract here.

Proposed fix
-`RequestMetadataError` short-circuits inside `dispatch_stateless` for malformed or missing `_meta` fields.
+`MetaValidationError` short-circuits inside `dispatch_stateless` for malformed `_meta` fields.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Errors short-circuit at the HTTP layer (`HEADER_MISMATCH`,
`UNSUPPORTED_PROTOCOL_VERSION`) before ever reaching the dispatcher, and
`RequestMetadataError` short-circuits inside `dispatch_stateless` for
malformed or missing `_meta` fields.
Errors short-circuit at the HTTP layer (`HEADER_MISMATCH`,
`UNSUPPORTED_PROTOCOL_VERSION`) before ever reaching the dispatcher, and
`MetaValidationError` short-circuits inside `dispatch_stateless` for
malformed `_meta` fields.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/runtime-surface.md` around lines 92 - 95, Update the runtime-surface
documentation wording to match the actual `_meta` contract:
`validate_meta_value()` only rejects non-object `_meta` values, while a missing
`_meta` is treated as empty metadata. Replace the “missing `_meta`” /
`RequestMetadataError` wording with the correct `MetaValidationError`
terminology, and keep the description aligned with `dispatch_stateless` and the
`_meta` validation behavior shown in the runtime snippets.

@Agent-Hellboy
Agent-Hellboy merged commit 58483a7 into codex/mcp-draft-support Jul 3, 2026
1 check passed
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.

1 participant