Skip to content

fix: forward Relay logging variables to the Claude child - #385

Open
mnajafian-nv wants to merge 1 commit into
NVIDIA:mainfrom
mnajafian-nv:fix/claude-adapter-relay-env
Open

mnajafian-nv wants to merge 1 commit into
NVIDIA:mainfrom
mnajafian-nv:fix/claude-adapter-relay-env

Conversation

@mnajafian-nv

@mnajafian-nv mnajafian-nv commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Preserve the parent's NeMo Relay logging configuration in Claude Code child processes. The adapter currently blanks inherited variables outside its allowlist, and Relay rejects empty logging values. This causes every Relay hook to fail and the run to end with claude_relay_atif_timeout.

Other inherited variables, including NEMO_RELAY_CLIENT_TOKEN, remain filtered. No breaking changes or dependency changes.

Details

  • Allowlist NEMO_RELAY_LOG, NEMO_RELAY_LOG_CONFIG_PATH, NEMO_RELAY_LOG_STDERR, and NEMO_RELAY_LOG_STDERR_FORMAT.
  • Test that logging values are forwarded while the Relay client token and unrelated secrets remain blanked.
  • Document the inherited logging variables in the Claude adapter README.

Validation

  • Claude adapter tests: 63 passed. Claude-related tests: 102 passed, 11 skipped; five Relay E2E cases remain blocked by the machine's Relay 0.9 and system-policy mismatch, as on main.
  • Pre-commit passed on the changed files.
  • A real Claude Code run through Relay 0.10 succeeded and produced ATOF and ATIF artifacts. The same setup without this fix failed with claude_relay_atif_timeout. The full Python suite was not run locally; CI covers it.

Where should the reviewer start?

Start with INHERITED_ENV_NAMES in the Claude adapter, then test_build_options_relay_logging_environment_set_forwards_parent_values.

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

  • Relates to: none.

  • 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.

The Claude adapter hides every inherited variable outside its allowlist
by overriding it with an empty string, because ClaudeAgentOptions.env can
only override os.environ, not remove from it. NeMo Relay rejects an empty
NEMO_RELAY_LOG, NEMO_RELAY_LOG_CONFIG_PATH, NEMO_RELAY_LOG_STDERR, or
NEMO_RELAY_LOG_STDERR_FORMAT, so when Fabric starts from a shell that sets
any of them, every Relay hook-forward call exits with a configuration
error. No lifecycle hook reaches the gateway, and a run whose model call
succeeded fails with claude_relay_atif_timeout.

Keep these four logging settings from the parent environment. They hold
log levels and a log config path, not credentials. Other variables,
including NEMO_RELAY_CLIENT_TOKEN, stay blanked; Relay treats an empty
client token as unset.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NeMo-Fabric/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 5f76aab1-245a-4318-9a21-929d3cb283dd



📥 Commits

Reviewing files that changed from the base of the PR and between a17f316 and 7ecf958.




📒 Files selected for processing (3)
  • adapters/python/claude/README.md
  • adapters/python/claude/src/nemo_fabric_adapters/claude/adapter.py
  • tests/adapters/test_claude_adapter.py



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




📜 Recent review details
⏰ Context from checks skipped due to timeout. (26)
  • GitHub Check: Preview docs
  • GitHub Check: Test (Python 3.14, linux-amd64)
  • GitHub Check: Test (Python 3.12, linux-amd64)
  • GitHub Check: Test (Python 3.13, linux-amd64)
  • GitHub Check: Test (Python 3.11, linux-amd64)
  • GitHub Check: Cline E2E
  • GitHub Check: Test (Python 3.14, macos-arm64)
  • GitHub Check: Test adapters (Node 24)
  • GitHub Check: Test (Python 3.14, windows-amd64)
  • GitHub Check: Test adapters (Node 22.19.0)
  • GitHub Check: Test (Python 3.11, windows-amd64)
  • GitHub Check: Test (Python 3.13, windows-amd64)
  • GitHub Check: Qwen Code E2E
  • GitHub Check: Test (Python 3.11, macos-arm64)
  • GitHub Check: Test (Python 3.14, linux-arm64)
  • GitHub Check: Test (Python 3.13, macos-arm64)
  • GitHub Check: Test (Python 3.12, windows-amd64)
  • GitHub Check: Hermes adapter (upstream Relay 0.9, Python 3.14)
  • GitHub Check: Test (Python 3.13, linux-arm64)
  • GitHub Check: Test (Python 3.12, macos-arm64)
  • GitHub Check: Test (Python 3.12, linux-arm64)
  • GitHub Check: Test (Python 3.11, linux-arm64)
  • GitHub Check: Test (x86_64)
  • GitHub Check: OpenCode E2E
  • GitHub Check: Test (arm64)
  • GitHub Check: Pre-commit



🧰 Additional context used
📚 Code guidelines (2)
.agents/skills/contribute-adapter/SKILL.md — configured
.agents/skills/contribute-docs/SKILL.md — configured

📓 Path-based instructions (6)
Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter.

⚙️ CodeRabbit configuration file

Files:

  • adapters/python/claude/README.md

Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public NeMo Fabric contracts.

⚙️ CodeRabbit configuration file

Files:

  • adapters/python/claude/src/nemo_fabric_adapters/claude/adapter.py
  • adapters/python/claude/README.md

Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.

⚙️ CodeRabbit configuration file

Files:

  • tests/adapters/test_claude_adapter.py

Source excerpt: Follow these repository-specific requirements after applying the public skill: Place a Python adapter under `adapters/python//` with `LICENSE -> ../../../LICENSE`, `README.md`, `.fabric-adapter.json`, Python pack...

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

Files:

  • adapters/python/claude/src/nemo_fabric_adapters/claude/adapter.py
  • adapters/python/claude/README.md

Source excerpt: [ ] Relevant adapter or example `README.md` files updated when examples or adapters have changed.

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

Files:

  • adapters/python/claude/README.md

Source excerpt: Follow these repository-specific requirements after applying the public skill: Give each Python leaf adapter a small base installation, a `harness` extra for package-installable target packages, and a `full` extra for packag...

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

Files:

  • adapters/python/claude/src/nemo_fabric_adapters/claude/adapter.py
  • adapters/python/claude/README.md




🔇 Additional comments (2)
adapters/python/claude/src/nemo_fabric_adapters/claude/adapter.py (1)

82-87: LGTM!


adapters/python/claude/README.md (1)

121-124: LGTM!






Walkthrough

The Claude adapter now forwards four NeMo Relay logging variables from the parent environment to Claude. Documentation lists the variables, and a parameterized test checks that their values are preserved while the Relay client token and an unrelated secret are blanked.

Changes

Claude Relay logging environment

Layer / File(s) Summary
Inherit Relay logging variables
adapters/python/claude/src/nemo_fabric_adapters/claude/adapter.py, tests/adapters/test_claude_adapter.py, adapters/python/claude/README.md
The adapter adds four NeMo Relay logging variables to the inherited environment. The test checks value preservation and secret blanking. The README lists the retained variables.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 7ecf9

The adapter forwards Relay logging settings while continuing to exclude the client token. The reported test-environment leak is prevented by automatic cleanup, leaving no concrete merge-blocking risk.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check Passed The title uses valid Conventional Commits syntax with the allowed lowercase type fix, stays under 72 characters, has no trailing period, and accurately summarizes forwarding Relay logging variables …
Description check Passed The description includes the required overview, reviewer starting point, related-issues section, contribution confirmation, and duplicate-check confirmation. It also provides relevant implementation a…

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 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.

@github-actions

Copy link
Copy Markdown

@mnajafian-nv
mnajafian-nv marked this pull request as ready for review October 10, 2026 18:05
@mnajafian-nv
mnajafian-nv requested a review from a team as a code owner October 10, 2026 18:05
@mnajafian-nv mnajafian-nv self-assigned this Oct 10, 2026

This branch was successfully deployed

1 active deployment
fern — 7ecf9584 Deployed Oct 10, 2026 by copy-pr-bot[bot] via Preview docs #1988
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.

1 participant