Skip to content

docs: fix inaccurate statement about nested asyncio loop support#1822

Open
octo-patch wants to merge 1 commit into
NVIDIA-NeMo:developfrom
octo-patch:fix/issue-1445-nested-async-doc-inaccuracy
Open

docs: fix inaccurate statement about nested asyncio loop support#1822
octo-patch wants to merge 1 commit into
NVIDIA-NeMo:developfrom
octo-patch:fix/issue-1445-nested-async-doc-inaccuracy

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Apr 26, 2026

Fixes #1445

Problem

The troubleshooting documentation incorrectly stated:

This issue is being discussed by the Python core team and, most likely, support will be added

However, both the referenced CPython issue (#66435, 11 years old) and the PR (#93338, 3 years old) have been closed without adding support for nested event loops. The statement should reflect that support will not be added.

Solution

Changed "support will be added" to "support will not be added" to accurately reflect the current state of the CPython discussion and the closed references.

Testing

Documentation-only change; no code is affected.

Signed-off-by: Octopus liyuan851277048@icloud.com

Summary by CodeRabbit

  • Documentation
    • Updated the "Nested AsyncIO Loop" troubleshooting guide with clarified information regarding Python's support for nested event loops.

NVIDIA-NeMo#1445)

The troubleshooting doc incorrectly stated that Python core team would
"most likely" add support for nested event loops. Both the referenced
CPython issue (#66435, 11 years old) and PR (#93338, 3 years old) are
closed without action, indicating support will not be added.

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
Signed-off-by: octo-patch <octo-patch@github.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR corrects a factual error in the troubleshooting documentation: the statement that Python's asyncio would eventually gain nested event loop support is updated to reflect that the relevant CPython issue (#66435) and PR (#93338) were both closed without adding that support. The change is a single-word insertion ("not") with no code impact.

Confidence Score: 5/5

Safe to merge — documentation-only fix with no code changes.

Single-word correction to a factual statement in docs; no code, tests, or configuration is touched. The fix accurately reflects the current state of the upstream CPython discussion.

No files require special attention.

Important Files Changed

Filename Overview
docs/troubleshooting.md Documentation-only fix: corrects inaccurate claim about nested asyncio loop support being added in CPython — changed "will be added" to "will not be added" to reflect the closed CPython issue and PR.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Caller uses blocking API] --> B[nemoguardrails sync wrapper]
    B --> C{nest_asyncio patched?}
    C -- Yes --> D[asyncio.run in existing loop\nvia nest_asyncio]
    C -- No / DISABLE_NEST_ASYNCIO=True --> E[asyncio.run fails\nRuntimeError: nested event loop]
    D --> F[Async core logic executes]
    E --> G[Caller must use async API directly]
Loading

Reviews (1): Last reviewed commit: "docs: fix inaccurate statement about nes..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown
Contributor

Documentation preview

https://nvidia-nemo.github.io/Guardrails/review/pr-1822

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

📝 Walkthrough

Walkthrough

A single documentation update in the troubleshooting guide clarifies that Python will not add support for nested event loops, correcting a previous statement that suggested support would "most likely" be added.

Changes

Cohort / File(s) Summary
Documentation
docs/troubleshooting.md
Updated "Nested AsyncIO Loop" section to clarify that Python will not add support for nested event loops, replacing "most likely" with "not" in the explanation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing an inaccurate statement in documentation about nested asyncio loop support.
Linked Issues check ✅ Passed The PR directly addresses the requirement in linked issue #1445 by changing the troubleshooting documentation to state that nested asyncio event loop support will not be added.
Out of Scope Changes check ✅ Passed The PR contains only documentation changes to the nested asyncio loop troubleshooting text, which is directly aligned with the scope of linked issue #1445.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Test Results For Major Changes ✅ Passed This PR is a documentation-only change consisting of a single-word correction in troubleshooting.md with no code modifications, functional changes, or impacts on numerics, convergence, or performance. Per custom check criteria, test documentation is required only for major changes; this minor change qualifies for exemption.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/troubleshooting.md`:
- Line 7: Update the sentence phrasing from present continuous to past tense to
reflect the closed status of the CPython discussion: replace "is being discussed
by the Python core team" with "was discussed by the Python core team" (and
optionally change "most likely, support will not be added" to "support was
deemed unlikely" or similar) in the paragraph that references "support will not
be added" and the GitHub issue/PR numbers so the tense is consistent with the
closed issue.
🪄 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: CHILL

Plan: Enterprise

Run ID: 2f7e6715-b65d-4579-91a4-cd7e641f5399

📥 Commits

Reviewing files that changed from the base of the PR and between 543e1d4 and 978a747.

📒 Files selected for processing (1)
  • docs/troubleshooting.md

Comment thread docs/troubleshooting.md
## Nested AsyncIO Loop

NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue is being discussed by the Python core team and, most likely, support will be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)).
NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue is being discussed by the Python core team and, most likely, support will not be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check the status of CPython issue `#66435` and PR `#93338`

echo "Checking CPython issue `#66435`..."
gh api repos/python/cpython/issues/66435 --jq '{state: .state, closed_at: .closed_at, title: .title}'

echo -e "\nChecking CPython PR `#93338`..."
gh api repos/python/cpython/pulls/93338 --jq '{state: .state, closed_at: .closed_at, merged: .merged, title: .title}'

Repository: NVIDIA-NeMo/Guardrails

Length of output: 335


Update tense for consistency with closed issue status.

The statement "support will not be added" is factually accurate—the referenced CPython issue #66435 and PR #93338 are both closed (as of March 2024), with the PR not merged. However, the sentence uses present continuous tense ("is being discussed") which contradicts the closed status. Change to past tense for consistency:

-This issue is being discussed by the Python core team and, most likely, support will not be added
+This issue was discussed by the Python core team and, most likely, support will not be added
📝 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
NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue is being discussed by the Python core team and, most likely, support will not be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)).
NeMo Guardrails is an async-first toolkit, i.e., the core functionality is implemented using async functions. To provide a blocking API, the toolkit must invoke async functions inside synchronous code using `asyncio.run`. However, the current Python implementation for `asyncio` does not allow "nested event loops". This issue was discussed by the Python core team and, most likely, support will not be added (see [GitHub Issue 66435](https://github.com/python/cpython/issues/66435) and [Pull Request 93338](https://github.com/python/cpython/pull/93338)).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/troubleshooting.md` at line 7, Update the sentence phrasing from present
continuous to past tense to reflect the closed status of the CPython discussion:
replace "is being discussed by the Python core team" with "was discussed by the
Python core team" (and optionally change "most likely, support will not be
added" to "support was deemed unlikely" or similar) in the paragraph that
references "support will not be added" and the GitHub issue/PR numbers so the
tense is consistent with the closed issue.

@Pouyanpi Pouyanpi force-pushed the develop branch 4 times, most recently from a6be550 to c69efe5 Compare May 6, 2026 16:01
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.

doc: nested-async-loop contains an inaccurate statement

1 participant