Skip to content

Conversation

@timon0305
Copy link

@timon0305 timon0305 commented Jan 21, 2026

Summary

Fixes #1390 - Remote conversation OTEL session ID not respected in Laminar tracing.

Problem:
For remote conversations, the OTEL/Laminar observability span was being started on the client side (remote_conversation.py), but LLM calls happen on the server side (conversation_service.py). Since OTEL context doesn't propagate across HTTP/WebSocket boundaries, traces were not properly associated with the conversation session.

Solution:

  • Add start_active_span() in conversation_service.py when starting a conversation on the server
  • Add end_active_span() in conversation_service.py when deleting a conversation
  • Remove client-side span calls in remote_conversation.py since they created orphan traces

Files changed:

  • openhands-agent-server/openhands/agent_server/conversation_service.py
  • openhands-sdk/openhands/sdk/conversation/impl/remote_conversation.py

Checklist

  • If the PR is changing/adding functionality, are there tests to reflect this?
  • If there is an example, have you run the example to make sure that it works?
  • If there are instructions on how to run the code, have you followed the instructions and made sure that it works?
  • If the feature is significant enough to require documentation, is there a PR open on the OpenHands/docs repository with the same branch name?
  • Is the github CI passing?

Copy link
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has critical concurrency issues with the global span manager that will cause span corruption in production. The span lifecycle is also mismatched between start and delete operations.

@timon0305 timon0305 changed the title fix: remote conversation OTEL session ID not respected (#1390) fix: remote conversation OTEL session ID not respected Jan 21, 2026
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.

remote conversation with agent server does not respect session id in laminar (OTEL, tracing)

2 participants