Skip to content

Commit b71276c

Browse files
Add Laminar tracing support for ACPAgent
- Initialize Laminar when ACPAgent module loads (maybe_init_laminar) - Add @observe decorator to step() method for tracing ACP agent calls - Consistent with regular Agent's Laminar integration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ae237b1 commit b71276c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

openhands-sdk/openhands/sdk/agent/acp_agent.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@
4747
from openhands.sdk.llm import LLM, Message, MessageToolCall, TextContent
4848
from openhands.sdk.tool.builtins.finish import FinishAction, FinishObservation
4949
from openhands.sdk.logger import get_logger
50+
from openhands.sdk.observability.laminar import maybe_init_laminar, observe
5051
from openhands.sdk.tool import Tool # noqa: TC002
5152

5253

54+
logger = get_logger(__name__)
55+
maybe_init_laminar()
56+
57+
5358
if TYPE_CHECKING:
5459
from openhands.sdk.conversation import (
5560
ConversationCallbackType,
@@ -59,8 +64,6 @@
5964
)
6065

6166

62-
logger = get_logger(__name__)
63-
6467
# Seconds to wait after prompt() for pending session_update notifications
6568
# to be processed. This is a best-effort workaround: the ACP protocol does
6669
# not currently signal when all notifications for a turn have been delivered,
@@ -636,6 +639,7 @@ async def _init() -> tuple[Any, Any, Any, str, str, str]:
636639
self._conn, self._process, self._filtered_reader, self._session_id, self._agent_name, self._agent_version = result
637640
self._working_dir = working_dir
638641

642+
@observe(name="acp_agent.step", ignore_inputs=["conversation", "on_event"])
639643
def step(
640644
self,
641645
conversation: LocalConversation,

0 commit comments

Comments
 (0)