docs: clarify middleware callback error semantics - #613
Conversation
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (8)**/*.mdx📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
Files:
**/*.{md,mdx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{md,markdown,mdx}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
{docs,examples}/**/*📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Files:
**/*📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Files:
docs/**/*📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Files:
**/*.{md,mdx,py,go,js,ts}📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
Files:
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (2)
WalkthroughThe documentation defines fail-closed behavior for conditional guardrails and request or execution intercepts. It covers synchronous and asynchronous callback failures, managed error propagation, callback prevention, and the limits of reversing work after ChangesMiddleware error handling
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/about-nemo-relay/concepts/middleware.mdx`:
- Around line 109-113: Update the middleware failure semantics in the
conditional-execution guardrails and request or execution intercepts section to
distinguish callback failures from guardrail rejection: describe callback errors
as returning a failure result, and separately state that a conditional-execution
guardrail may return its documented rejection message to block execution as
normal control flow.
- Around line 114-116: Update docs/reference/migration-guides.mdx at lines 54-55
to document the continuation lifetime rule: if an execution intercept fails
after invoking next, Relay cannot undo completed downstream work, rejects
unfinished calls, and rejects calls started after the interceptor settles. No
direct change is required in docs/about-nemo-relay/concepts/middleware.mdx lines
114-116 because it already documents this behavior.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: addcb14c-07a8-4cb3-b611-fd9b75abebc1
📒 Files selected for processing (2)
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (8)
**/*.mdx
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)
In MDX files, top-of-file comments must use JSX comment delimiters (
{/*to open and*/}to close); do not use HTML comments for MDX SPDX headers
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Update
README.md,fern/, package READMEs, and binding-support notes when public behavior, package names, examples, or supported bindings change.
**/*.{md,mdx}: Prefer the documented public API, not internal shortcuts
Keep package names, repo references, and build commands current
Keep release-process and release-notes guidance in repo-maintainer docs such asRELEASING.md, not as user-facing docs pages orCHANGELOG.md
Keep stable user-facing wrappers atscripts/root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, andgrpc-v1protocol details on separate pagesIf links in documentation change, run
just docs-linkcheck.
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
**/*.{md,markdown,mdx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all Markdown/MDX documentation files using the HTML comment block form.
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
{docs,examples}/**/*
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update docs and examples.
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, usemaintain-dynamic-pluginsand include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
docs/**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If documentation examples or commands under
docs/change, run the targeted docs checks appropriate to the change.
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
**/*.{md,mdx,py,go,js,ts}
📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
Examples and documentation must use each exporter's documented flush/deregister order before shutdown.
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}
⚙️ CodeRabbit configuration file
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.
Files:
docs/about-nemo-relay/concepts/middleware.mdxdocs/reference/migration-guides.mdx
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
|
/merge |
Overview
Document the fail-closed exception contract for conditional-execution guardrails and request or execution intercepts in NeMo Relay 0.7.
Details
Promisevalues stop the middleware chain at the failing stage and surface to the managed caller.nextcontinuation that it already invoked.Validation:
just docspassed with 0 errors. Fern skipped the authenticated redirects check becauseFERN_TOKENwas unavailable.cargo-deny,go fmt, andgo vethooks could not run becausecargo-denyand Go are not installed in the local environment.Where should the reviewer start?
Start with the Callback Error Handling section in
docs/about-nemo-relay/concepts/middleware.mdx, then compare the matching upgrade guidance indocs/reference/migration-guides.mdx.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
next.