Skip to content

fix(hermes-agent): create entry span from session source#216

Draft
sipercai wants to merge 1 commit into
mainfrom
liuyu/fix-hermes-entry-source
Draft

fix(hermes-agent): create entry span from session source#216
sipercai wants to merge 1 commit into
mainfrom
liuyu/fix-hermes-entry-source

Conversation

@sipercai

Copy link
Copy Markdown
Collaborator

Summary

  • Keep the latest Hermes official CLI, IM/gateway, TUI, and API Server paths covered by explicit AIAgent.platform ENTRY spans.
  • Mirror Hermes session source resolution for platform-less AIAgent calls: platform, then HERMES_SESSION_SOURCE, then cli.
  • Change no-platform top-level Hermes runs from AGENT-only to ENTRY -> AGENT, with tests and docs for the behavior.

Verification

  • PYTHONPATH="instrumentation-loongsuite/loongsuite-instrumentation-hermes-agent/src:util/opentelemetry-util-genai/src:opentelemetry-api/src:opentelemetry-sdk/src:opentelemetry-semantic-conventions/src:opentelemetry-instrumentation/src" python -m pytest instrumentation-loongsuite/loongsuite-instrumentation-hermes-agent/tests/test_telemetry_spec.py -q (34 passed)
  • git diff --check --cached
  • python /Users/sipercai/project/ai_loop/team-skills/loongsuite-github-pipeline/scripts/check_loongsuite_pr_readiness.py --repo .
  • tox -e precommit
  • Latest Hermes acd7932 offline smoke:
    • no-platform AIAgent.platform=None produced ENTRY -> AGENT
    • API Server _create_agent() produced platform=api_server and ENTRY -> AGENT

Notes

EntryInvocation currently has no session-source field, so this PR only aligns ENTRY creation with Hermes's session source decision. It does not add a new custom span attribute for source labeling.

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

5 participants