Repository navigation
test: Add comprehensive tests for events_to_messages conversions - #81
Merged
Merged
Conversation
- Add tests for single MessageEvent, ActionEvent, and ObservationEvent conversions - Add tests for parallel function calling with same llm_response_id - Add tests for sequential function calls with different llm_response_ids - Add tests for mixed event types in sequence - Add tests for complex scenarios with both parallel and sequential calls - Add error handling tests for invalid parallel call structures - All tests cover expected input/output patterns from LiteLLM docs - Fixes issue #50 Co-authored-by: openhands <openhands@all-hands.dev>
StressTestor
pushed a commit
to StressTestor/software-agent-sdk
that referenced
this pull request
Jun 1, 2026
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
This PR adds comprehensive tests for the
events_to_messagesconversions inopenhands/sdk/event/base.pyto address issue #50.Changes
tests/sdk/event/directory with proper__init__.pytest_events_to_messages.pywith 9 test methods covering:llm_response_id(following LiteLLM patterns)llm_response_idsTest Coverage
The tests cover the expected input/output patterns from the LiteLLM documentation, ensuring that:
llm_response_id) are correctly grouped into a single assistant message with multiple tool callsllm_response_ids) are converted to separate assistant messagesTesting
All tests pass successfully:
$ uv run pytest tests/sdk/event/test_events_to_messages.py -v ========== 9 passed in 1.35s ==========Pre-commit hooks also pass:
Fixes
Closes #50
@xingyaoww can click here to continue refining the PR