Skip to content

fix: align gateway hook timeout with daemon execution - #1288

Merged
willkill07 merged 1 commit into
NVIDIA:release/0.10from
willkill07:fix/relay-1020-gateway-hook-timeout
Oct 12, 2026
Merged

willkill07 merged 1 commit into
NVIDIA:release/0.10from
willkill07:fix/relay-1020-gateway-hook-timeout

Conversation

@willkill07

@willkill07 willkill07 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Overview

Gateway hooks currently stop waiting after two seconds, even though daemon hook forwarding and generated Claude Code/Codex hook configs allow 30 seconds. This rejects LLM judge guardrails that need more than two seconds to evaluate. Use a shared 30-second hook forwarding limit across gateway and daemon/worker execution.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Share the 30-second timeout between authenticated gateway forwarding, HTTP gateway forwarding, daemon forwarding, and generated Claude Code/Codex hook configs for gateway and managed daemon clients.
  • Preserve existing CLI/configuration contracts, failure policies, and single-delivery behavior. No breaking changes.
  • Add regression coverage for responses taking 2.5 seconds, under both failure policies for HTTP delivery and through the authenticated gateway transport. Keep the timeout regression that verifies no duplicate delivery or recovery after an ambiguous response timeout.
  • Document the timeout and the need to leave transport time within the agent's hook budget.

Validation:

  • Focused gateway delayed-response test passed.
  • just test-rust: 5,796 of 5,798 tests passed; the two logging-related failures passed on isolated reruns with inherited logging overrides removed and an empty system config directory.
  • just docs-linkcheck passed; Fern could not check redirects against the published site because FDR returned 403.
  • uv run pre-commit run passed on the staged changes, including external documentation links, formatting, Clippy, Cargo checks, and dependency audits. The automatic commit-time repeat encountered GitHub HTTP 503/504 responses on two unchanged documentation links; only that duplicate link check was skipped for the commit. Binding suites were not run because their runtime/API contracts are unchanged.

Where should the reviewer start?

Start with crates/cli/src/hooks/mod.rs and crates/cli/src/hooks/delivery.rs for the shared timeout and its two gateway transports. Then review the delayed-response and no-retry regressions in crates/cli/tests/cli_tests.rs and crates/cli/tests/coverage/shared/installer_tests.rs.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • Bug Fixes
    • Hook forwarding now allows up to 30 seconds for requests across gateway and daemon modes, including generated Claude Code and Codex hooks. Slow requests can complete within this limit; delivery failures continue to follow each hook’s configured policy.
  • Documentation
    • Clarified hook timeout behavior, retry handling, and how to account for transport time when setting guardrail evaluation timeouts.

Use the existing 30-second daemon and agent hook budget for both gateway transports. Share the limit with generated hook configs and preserve failure policies and no-retry behavior.

Fixes RELAY-1020.

Signed-off-by: Will Killian <[email protected]>
@willkill07
willkill07 requested review from a team as code owners October 12, 2026 17:56
@github-actions github-actions Bot added size:S PR is small Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Oct 12, 2026
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NeMo-Relay/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: f09cc1f0-cf9d-4b4c-877b-df1c2459914d

📥 Commits

Reviewing files that changed from the base of the PR and between 933e362 and 3793ca6.


📒 Files selected for processing (9)
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/daemon/hook/mod.rs
  • crates/cli/src/daemon/managed/mod.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • docs/nemo-relay-cli/basic-usage.mdx

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📜 Recent review details
⏰ Context from checks skipped due to timeout. (14)
  • GitHub Check: Rust / Package (macos-arm64)
  • GitHub Check: Rust / Package (linux-arm64)
  • GitHub Check: Rust / Package (linux-musl-amd64)
  • GitHub Check: Rust / Package (linux-amd64)
  • GitHub Check: Rust / Package (windows-arm64)
  • GitHub Check: Check / Run
  • GitHub Check: Rust / Test (linux-arm64)
  • GitHub Check: Rust / Package (linux-musl-arm64)
  • GitHub Check: Rust / Test (windows-arm64)
  • GitHub Check: Rust / Test (linux-amd64)
  • GitHub Check: Rust / Test (windows-amd64)
  • GitHub Check: Rust / Package (windows-amd64)
  • GitHub Check: Rust / Test (macos-arm64)
  • GitHub Check: Preview docs

🧰 Additional context used
📚 Code guidelines (5)
.agents/skills/contribute-docs/SKILL.md — configured
.agents/skills/review-doc-style/SKILL.md — configured
CONTRIBUTING.md — configured
.agents/skills/prepare-code-freeze/SKILL.md — configured
.agents/skills/draft-release-notes/SKILL.md — configured

📓 Path-based instructions (8)
Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.

⚙️ CodeRabbit configuration file

Files:

  • docs/nemo-relay-cli/basic-usage.mdx

Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.

⚙️ CodeRabbit configuration file

Files:

  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/tests/cli_tests.rs

Source excerpt: In MDX files, top-of-file comments must use JSX comment delimiters: `{/*` to open and `*/}` to close.

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • docs/nemo-relay-cli/basic-usage.mdx

Source excerpt: Verify MDX files use JSX delimiters for top-of-file SPDX comments.

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Files:

  • docs/nemo-relay-cli/basic-usage.mdx

Source excerpt: **Formatting**: `cargo fmt` (rustfmt defaults) Source excerpt: **Linting**: `cargo clippy -- -D warnings` -- all warnings are treated as errors

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • crates/cli/src/daemon/managed/mod.rs
  • crates/cli/src/daemon/hook/mod.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs

Source excerpt: Search documentation source for references to the old version and update current-version install commands, package examples, and configuration examples to `` where appropriate: Review matches before changing th...

📄 CodeRabbit inference engine (.agents/skills/prepare-code-freeze/SKILL.md)

Files:

  • docs/nemo-relay-cli/basic-usage.mdx

Source excerpt: Use the naming conventions appropriate to each language: Rust `snake_case`, C FFI exports prefixed `nemo_relay_`, Go `PascalCase`, Node.js `camelCase`, Python `snake_case`.

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • crates/cli/src/daemon/managed/mod.rs
  • crates/cli/src/daemon/hook/mod.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs

Source excerpt: Preserve MDX front matter and the JSX SPDX comment.

📄 CodeRabbit inference engine (.agents/skills/draft-release-notes/SKILL.md)

Files:

  • docs/nemo-relay-cli/basic-usage.mdx


Walkthrough

Hook forwarding and generated hook configurations now use a shared 30-second timeout. Tests cover delayed hook responses, and the CLI documentation describes timeout behavior and failure policies.

Changes

Hook forwarding timeout

Layer / File(s) Summary
Shared timeout and hook configuration
crates/cli/src/hooks/*, crates/cli/src/daemon/hook/mod.rs, crates/cli/src/daemon/managed/mod.rs, crates/cli/src/agents/codex/launch.rs
A shared 30-second constant replaces local timeout declarations. Generated hook configurations use that constant, and send_hook_forward_request is visible to its parent module.
Delayed-response coverage and timeout guidance
crates/cli/tests/cli_tests.rs, crates/cli/tests/coverage/shared/installer_tests.rs, docs/nemo-relay-cli/basic-usage.mdx
Tests cover delayed responses and the CLI documentation describes the timeout, failure-policy behavior, and lack of retries.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 3793c

Hook forwarding can wait for the intended 30 seconds under the default configuration. Operators who set a shorter broker response limit retain that separate limit. No issue identified here prevents merge.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 8 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title uses the allowed lowercase type fix, includes a concise imperative summary, stays within 72 characters, and has no trailing period.
Description check Passed The description includes all required sections, completed contribution and duplicate-work confirmations, detailed change and validation information, reviewer guidance, and a valid Fixes issue refere…
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.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 8 files. (1 skipped: 1 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@willkill07 willkill07 self-assigned this Oct 12, 2026
@willkill07 willkill07 added this to the 0.10 milestone Oct 12, 2026
@github-actions

Copy link
Copy Markdown

@mnajafian-nv mnajafian-nv left a comment

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.

lgtm

@willkill07
willkill07 merged commit 398c68d into NVIDIA:release/0.10 Oct 12, 2026
46 checks passed
willkill07 added a commit that referenced this pull request Oct 12, 2026
#### Overview

Fail-closed hooks currently exit 1 on delivery errors, which does not
block Claude Code's permission-bearing hooks. Return exit 2 for these
errors across gateway and managed daemon execution, including hooks
routed through daemon workers.

- [x] I confirm this contribution is my own work, or I have the right to
submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does
not duplicate existing work.

#### Details

- Map the existing `HookDelivery` error to exit 2 and wrap gateway setup
failures consistently.
- Preserve fail-open behavior, structured guardrail rejections,
configuration defaults, and public APIs. No breaking API or
configuration changes.
- Cover connection errors under both policies, verified gateway
failures, response limits, timeouts, and a real `--require-worker`
daemon returning HTTP 503. Document the exit statuses.
- Verified a clean three-way merge with
`fix/relay-1020-gateway-hook-timeout` (#1288).

Validation: eight focused CLI tests passed. `just test-rust` ran 5,797
tests: 5,795 passed initially; the two diagnostic failures passed when
rerun with isolated configuration and inherited logging overrides
removed. `just docs` and staged `uv run pre-commit run` passed. Language
binding suites were not run because their contracts are unchanged.

#### Where should the reviewer start?

Start with `crates/cli/src/commands/mod.rs` for exit-status mapping and
`crates/cli/src/hooks/delivery.rs` for gateway setup error wrapping. The
strict-routing regression in `crates/cli/tests/cli_tests.rs` verifies
exit 2 when a required daemon worker is unavailable.

#### Related Issues: (use one of the action keywords Closes / Fixes /
Resolves / Relates to)

- Fixes
[RELAY-1021](https://linear.app/nvidia/issue/RELAY-1021/block-on-hook-delivery-failures)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Hook delivery failures now return exit code `2` when fail-closed
behavior is configured, including connection errors, timeouts, and HTTP
errors. Fail-open delivery failures continue to return `0`.
  * Guardrail rejections continue to return exit code `2`.
* **Documentation**
* Updated hook forwarding guidance to clarify exit codes for fail-open
and fail-closed policies across gateway and daemon hooks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Will Killian <[email protected]>
willkill07 added a commit that referenced this pull request Oct 14, 2026
#### Overview

Add 0.10.1 release notes covering the fifteen PRs merged into
`release/0.10` since `0.10.0`, plus the anticipated merge of #1317, with
matching patch-upgrade guidance. Preserve the 0.10.0 notes and follow
the NVIDIA documentation style guide.

- [x] I confirm this contribution is my own work, or I have the right to
submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does
not duplicate existing work.

#### Details

- Cover daemon-worker LLM middleware (#1281), the YAML dependency update
(#1282), hook timeout and failure-policy fixes (#1288, #1289, #1290),
and request-edit preservation (#1296).
- Cover Anthropic streaming storage (#1303), Python typed reconstruction
(#1304), Go native handle lifetimes (#1302), authenticated Pi hooks and
session ownership (#1306), dynamic plugin trust failures (#1305), and
verified native plugin loading (#1307).
- Cover Pi named-upstream restrictions (#1314), LangChain tool-schema
edits (#1316), and the configurable ChatGPT Codex endpoint (#1319).
- Assume #1317 will merge: document plugin HTTP error helpers and
prefixes, preservation of remote Guardrails and forwarded hook HTTP
error statuses, verified reporting identities, and streaming limits.
Verified against its current head
`b61bb7da0bc6de7b7d5d27a569981867b7b2fcb9`; its implementation is not
merged into this branch.
- Add upgrade guidance for hook credentials and registration, generated
hooks, daemon response behavior, request edits, Pi extensions and
private provider endpoints, native plugin dependencies, stored Python
typed values, ChatGPT endpoints, and HTTP error handling.
- Keep PR references and counts out of user-facing release notes.
Preserve the prior CodeRabbit corrections for MCP route registration,
forwarded-stream observation limits, sanitizer-only behavior, and 0.10.1
installation pins.
- Merge the latest `release/0.10` into the PR branch. Distinguish
personal hook refresh commands from administrator-managed daemon
bundles.

Validation: `just docs`, `uv run pre-commit run`, and `git diff --cached
--check` passed. Fern skipped the published redirect-history check
because FDR returned HTTP 403. Verified the merged release range against
source and public documentation, and the assumed #1317 behavior against
its current PR source and docs.
Language test suites were not run because the PR diff only updates
documentation prose and installation version pins. Package installation
commands, live daemon upgrades, plugin activations, and hook refreshes
were not executed. Validation runs on the current release branch; #1317
remains an explicit release-content assumption.

#### Where should the reviewer start?

Start with `Release 0.10.1` in
`docs/about-nemo-relay/release-notes/index.mdx`, then review `Update
from NeMo Relay 0.10.0 to 0.10.1` in
`docs/reference/migration-guides.mdx`. Review the new Pi endpoint,
ChatGPT endpoint, LangChain tool-edit, and HTTP error guidance,
including the #1317 merge assumption. Check matching version pins in
`docs/getting-started/installation.mdx`.

#### Related Issues: (use one of the action keywords Closes / Fixes /
Resolves / Relates to)

- Relates to: none


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Added NeMo Relay 0.10.0 and 0.10.1 release notes, including feature
highlights, compatibility updates, fixes, and known issues.
* Expanded migration guidance with upgrade steps and details on hook
credentials and delivery, daemon-worker middleware behavior, request
editing, plugin requirements, and Python value handling.
* Updated installation examples across supported platforms, packages,
and integrations to reference version 0.10.1.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Will Killian <[email protected]>
@willkill07
willkill07 deleted the fix/relay-1020-gateway-hook-timeout branch October 30, 2026 14:47

This branch was previously deployed

1 inactive deployment
fern — 3793ca65 Deployed Oct 12, 2026 by willkill07 via Clean up docs preview #5601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:S PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants