Skip to content

fix: Phoenix span is missing when telemetry contains OpenShell env placeho...#30

Open
arnavnagzirkar wants to merge 1 commit into
NVIDIA:mainfrom
arnavnagzirkar:fix-23
Open

fix: Phoenix span is missing when telemetry contains OpenShell env placeho...#30
arnavnagzirkar wants to merge 1 commit into
NVIDIA:mainfrom
arnavnagzirkar:fix-23

Conversation

@arnavnagzirkar

Copy link
Copy Markdown

Summary

Root Cause

NeMo Relay resolves strings matching openshell:resolve:* at ingest time. When LLM content, tool output, or prompt text contained a literal placeholder-shaped string (e.g. openshell:resolve:env:FAKE_TOKEN), the plugin forwarded it unchanged to NeMo Relay via client.post(..., json=payload). NeMo Relay attempted to resolve the placeholder, failed (since the env var doesn't exist), and silently dropped the span — so it never reached Phoenix.

Change Made

File: examples/personal-community-sentiment-triage/agents/hermes/plugins/nemo-relay/__init__.py

Added a _sanitize() function that recursively walks the payload and replaces any string matching openshell:resolve:* with <redacted:openshell-placeholder> using a compiled regex. Applied it in _forward() before calling client.post(...):

# Before
client.post(f"{url}/hooks/hermes", json=payload)

# After
client.post(f"{url}/hooks/hermes", json=_sanitize(payload))

The regex openshell:resolve:[^\s"'<>\\]* (case-insensitive) covers all openshell:resolve: sub-types, not just env:, matching the full placeholder syntax.

Issue

Fixes #23

Issue URL: #23

Changes

.../agents/hermes/plugins/nemo-relay/__init__.py   | 28 +++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

Testing

  • Agent ran relevant tests during development

  • Linting checks passed

  • Changes are minimal and focused on the issue

AI Assistance Disclosure

This pull request was prepared with the assistance of AI coding tools (GitHub Copilot). The change has been read, understood, and is owned by the human contributor submitting it, who will respond to review feedback.

…warding

Literal openshell:resolve:env:VARNAME strings in LLM content or tool
output were forwarded unchanged to NeMo Relay, which tries to resolve
them at ingest time. A failed resolution caused the span to be silently
dropped, resulting in missing Phoenix spans.

Add a _sanitize() pass in _forward() that recursively replaces any
openshell:resolve:* match with '<redacted:openshell-placeholder>' so the
payload is safe to ingest regardless of LLM output content.

Fixes NVIDIA#23

Signed-off-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Phoenix span is missing when telemetry contains OpenShell env placeholder

1 participant