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
This old PR targets dev/v0.2 and still has the original investigative/manual test coverage. The new PR is rebased onto main, keeps the same behavioral fix, removes the noisy manual SDK investigation test, and includes the current validation results plus a live reproduction of the remaining failure on main.
Leaving this PR open for traceability, but #64 is the one to review for getting the fix into main.
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.
Summary\n- prevent mixed content in tool_result user messages by only summarizing orphaned tool_results when no valid tool_results remain\n- truncate context before sanitization (token estimation + fallback content truncation) to avoid creating orphaned tool blocks\n- normalize Anthropic SSE errors and expand coverage\n- add missing tests/fixtures package marker; minor lint/mypy compliance tweaks\n\n## Testing\n- PYTHONPATH=. pytest tests/test_tool_result_sanitization.py tests/plugins/claude_api/unit/test_native_anthropic_sanitization.py tests/unit/llms/test_context_window_management.py tests/unit/llms/test_truncation_creates_orphans.py tests/unit/streaming/test_deferred_stream_errors.py tests/plugins/claude_sdk/integration/test_sdk_compaction_behavior.py