fix(sdk): tolerate orphaned tool observations - #4592
Draft
jstar0 wants to merge 1 commit into
Draft
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
5 tasks
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.
HUMAN:
AGENT:
Why
ToolCallMatchingProperty.manipulation_indicesraisedKeyErrorwhen crash recovery left an observation-like event without its matching action. This could permanently prevent a conversation from continuing after restart recovery.Summary
tool_call_idhas no action in the current view.View-level regression coverage.Issue Number
Fixes #4591
How to Test
uv run pytest tests/sdk/context/viewuv run pre-commit run --files openhands-sdk/openhands/sdk/context/view/properties/tool_call_matching.py tests/sdk/context/view/properties/test_tool_call_matching.py tests/sdk/context/view/test_view_manipulation_indices.pyThe focused view suite passes 150 tests. The regression tests cover both an orphaned
AgentErrorEventand a duplicate observation; the latter remains a strict pairing error.Video/Screenshots
Not applicable for this SDK-only behavior fix. The regression is covered by deterministic tests using an in-memory event sequence.
Type
Notes
This change does not alter persisted event formats or public APIs.