test: increase test coverage from 88% to 99%#27
Open
jordanrburger wants to merge 2 commits into
Open
Conversation
Add 46 new tests covering previously untested code paths to ensure API contract changes in the Kai backend are caught by failing tests. Key areas covered: - V6 tool approval flow (send_tool_approval_response, approve/reject_tool) - SSE stream parsing edge cases (empty data, [DONE], comments, field types) - from_storage_api connection error handling - CLI interactive mode, v6 approval UI, display_tool_result_events - _parse_vote isUpvoted format, get_history ending_before pagination Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Coverage changes
client.pysse.pycli.pyexceptions.pymodels.pytypes.pyKey areas covered
client.py — v6 tool approval flow (
send_tool_approval_response,approve_tool,reject_tool),from_storage_apiconnection errors, lazy client init, non-JSON HTTP errors,_parse_voteisUpvoted format,ending_beforepaginationsse.py —
parse_sse_stream(empty data,[DONE]marker, SSE comments,event:/id:/retry:fields,StreamClosed,RemoteProtocolError), tool approval request parsing, approval metadata,consume_streamcli.py — v6 approval flow (auto-approve, user approve, user reject), interactive mode (exit/quit/empty input),
display_tool_result_eventswith errors and JSON, MCP dict format edge caseTest plan
🤖 Generated with Claude Code