Skip to content

Commit ffaa092

Browse files
Merge pull request #58 from NVIDIA-NeMo/fix-nemo-relay-dependency
fix(nemo-relay): bound dependency, migrate intercept API, fix concurrent scopes
2 parents f2831fd + 61d7057 commit ffaa092

14 files changed

Lines changed: 783 additions & 565 deletions

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Rust toolchain (installed for nemo_flow PyO3 build)
1+
# Rust toolchain (installed for nemo_relay PyO3 build)
22
.cargo/
33
.rustup/
44

@@ -296,7 +296,7 @@ agents/**/traces/
296296
.config/
297297
.local/
298298

299-
# Rust toolchain (installed by rustup for nemo-flow build)
299+
# Rust toolchain (installed by rustup for nemo-relay build)
300300
.cargo/
301301
.rustup/
302302

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A progressive tour of the framework. Each step is a standalone, copy-paste-runna
1818
| 9 | Automatic history summarization | [`09_summarization.py`](quickstart/09_summarization.py) |
1919
| 10 | Skills | [`10_skills.py`](quickstart/10_skills.py) |
2020
| 11 | MCP tools | [`11_mcp.py`](quickstart/11_mcp.py) |
21-
|| Sandbox, memory, multimodal, NeMo Flow | see the [Advanced](#advanced-topics) section |
21+
|| Sandbox, memory, multimodal, NeMo Relay | see the [Advanced](#advanced-topics) section |
2222

2323
---
2424

examples/quickstart/15_nemo_relay.py

Lines changed: 69 additions & 75 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ nooa-bench = { workspace = true }
6161
[tool.uv]
6262
# Extra index URLs to search for packages (in addition to PyPI)
6363
# Ignore packages uploaded less than 7 days ago to mitigate supply-chain attacks
64-
exclude-newer = "2026-07-03T00:00:00Z"
64+
exclude-newer = "2026-07-23T00:00:00Z"
6565
# Match the package's supported Python range and LiteLLM's stable releases.
6666
environments = [
6767
"python_full_version >= '3.12' and python_full_version < '3.14'",
@@ -120,11 +120,22 @@ sandbox = [
120120
mcp = [
121121
"mcp>=1.0.0",
122122
]
123-
# NeMo Flow integration (guardrails, intercepts, event subscribers, ATIF
124-
# export). The upstream package was renamed from nemo-flow to nemo-relay.
125-
# See src/nooa/nemo_flow_middleware.py and examples/quickstart/15_nemo_relay.py.
123+
# NeMo Relay integration (guardrails, intercepts, event subscribers, ATIF
124+
# export).
125+
# See src/nooa/nemo_relay_middleware.py and examples/quickstart/15_nemo_relay.py.
126+
#
127+
# Floor is 0.6: LLM request intercepts must return `LLMRequestInterceptOutcome`
128+
# (0.5+) rather than a `(request, annotated)` tuple, and that type does not
129+
# exist in 0.4 — so there is no single callback shape that spans 0.4 and 0.6.
130+
#
131+
# Ceiling is <0.7: 0.7 changes the LLM sanitizer contract to the two-argument
132+
# form `(payload, directional_context) -> payload | None` with no compatibility
133+
# shim, and makes an implicit `return` mean "omit the payload" (fail-closed).
134+
# Our library code (nemo_relay_middleware.py) registers no sanitizers and is
135+
# unaffected, but tests/test_nemo_relay_middleware.py does — see the sanitizer
136+
# registrations there before lifting this bound.
126137
nemo-relay = [
127-
"nemo-relay>=0.4.0",
138+
"nemo-relay>=0.6,<0.7",
128139
]
129140

130141
# CLI ships as a separate package: `uv add nooa-cli`.

skills/nooa-middleware-hooks/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Verified semantics:
5252
- On a context-window error the runtime archives events, rebuilds messages, and retries — so `llm_call` middleware can run more than once per logical turn; keep it idempotent.
5353
- The tracing `on_messages_built` hook fires inside the innermost core, so traces show the **post-middleware** messages.
5454

55-
Worked production example: `src/nooa/nemo_flow_middleware.py` installs all three kinds to route calls through NeMo Flow (guardrails/ATIF); `nemo_flow_scope(agent, name)` wraps install/uninstall. Runnable: `examples/quickstart/13_nemo_flow.py`. Test patterns (mutate/short-circuit/ordering): `tests/test_event_middleware.py`.
55+
Worked production example: `src/nooa/nemo_relay_middleware.py` installs all three kinds to route calls through NeMo Relay (guardrails/ATIF); `nemo_relay_scope(agent, name)` wraps install/uninstall. Runnable: `examples/quickstart/13_nemo_relay.py`. Test patterns (mutate/short-circuit/ordering): `tests/test_event_middleware.py`.
5656

5757
## Observers (`on`)
5858

Lines changed: 170 additions & 80 deletions
Large diffs are not rendered by default.

tests/test_nemo_flow_middleware_no_dep.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)