Repository navigation
📝 CodeRabbit Chat: Add ASCII flow to runtime surface docs - #33
Conversation
📝 WalkthroughWalkthroughThis 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. ChangesDocumentation Update
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Change it to mermaid and this should get rendered in the docs.
🧩 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
✅ Action performedThis 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. |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/runtime-surface.md (1)
31-90: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winLabel the diagram fence.
This block is still an unlabeled fenced code block, so
markdownlintwill flag it. Usetexthere 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
| 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. |
There was a problem hiding this comment.
🎯 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.
| 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.
Code changes was requested by @Agent-Hellboy.
The following files were modified:
docs/runtime-surface.mdSummary by CodeRabbit