fix: Phoenix span is missing when telemetry contains OpenShell env placeho...#30
Open
arnavnagzirkar wants to merge 1 commit into
Open
fix: Phoenix span is missing when telemetry contains OpenShell env placeho...#30arnavnagzirkar wants to merge 1 commit into
arnavnagzirkar wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 viaclient.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__.pyAdded a
_sanitize()function that recursively walks the payload and replaces any string matchingopenshell:resolve:*with<redacted:openshell-placeholder>using a compiled regex. Applied it in_forward()before callingclient.post(...):The regex
openshell:resolve:[^\s"'<>\\]*(case-insensitive) covers allopenshell:resolve:sub-types, not justenv:, matching the full placeholder syntax.Issue
Fixes #23
Issue URL: #23
Changes
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.