You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add trace, session, retriever to applies to - #637
Agent Control events can apply to LLM calls, tool calls, retriever calls, traces, or sessions. The SDK previously accepted only llm_call and tool_call, so the other supported values could fail enum conversion before a control span was emitted. This change adds the three missing values to the SDK and OpenAPI models, preserves trace, session, and parent IDs on control spans, and keeps unrelated values unsupported.
Tests:
Unit Tests Added
E2E Test Added (if it's a user-facing feature, or fixing a bug)
Focused tests: poetry run pytest tests/test_agent_control.py tests/test_agent_control_bridge.py -q (40 passed)
Extend Agent Control support to retriever, trace, and session events across SDK and OpenAPI models. Update ControlSpan and GalileoLogger.add_control_span to preserve applies_to, session, trace, and parent identifiers when emitting control spans.
Support all five Agent Control event types and preserve execution context on emitted control spans, including session, trace, parent, and applies_to identifiers.Modified files (4)
The reason will be displayed to describe this comment to others. Learn more.
Preserves stale session IDs in batch payload
Control events can send span.session_id from session A with request.session_id from session B or None if the logger changes before flush, and mixed-session batches have the same inconsistency; capture the session once at the trace/batch boundary and use it for both carriers, or prevent mixed-session batches.
Before applying, verify this suggestion against the current code. In
`src/galileo/logger/logger.py` around lines 1921-1924, update
`GalileoLogger.add_control_span` and its interaction with `_flush_batch` so control
spans and their enclosing request use the same captured session ID. Capture the session
at the trace/batch boundary rather than independently reading mutable `self.session_id`,
and ensure batches cannot combine spans from different sessions or cleared sessions.
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
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.
Shortcut: SAO-18190
Description:
Agent Control events can apply to LLM calls, tool calls, retriever calls, traces, or sessions. The SDK previously accepted only
llm_callandtool_call, so the other supported values could fail enum conversion before a control span was emitted. This change adds the three missing values to the SDK and OpenAPI models, preserves trace, session, and parent IDs on control spans, and keeps unrelated values unsupported.Tests:
poetry run pytest tests/test_agent_control.py tests/test_agent_control_bridge.py -q(40 passed)