Skip to content

fix(core): replace expect() with proper error handling#9

Merged
lostmygithubaccount merged 1 commit intomainfrom
cody/ws-sfharden
Apr 4, 2026
Merged

fix(core): replace expect() with proper error handling#9
lostmygithubaccount merged 1 commit intomainfrom
cody/ws-sfharden

Conversation

@lostmygithubaccount
Copy link
Copy Markdown
Member

Summary

  • Replace .expect() with Result return types in all three wire format build_request functions (completions, responses, messages) to prevent panics in library code
  • Propagate errors through wire_formats::build_request dispatch and all client.rs call sites
  • Add Python unit tests for wire format validation, message building, and health check error paths (5 → 10 unit tests)

🤖 Generated with Claude Code

All three wire format build_request functions used .expect() which would
panic on serialization failure. Now they return Result<Value, Error> and
propagate errors to callers. Also adds Python unit tests for wire format
validation, message building, and health check error paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount merged commit 48fb8c6 into main Apr 4, 2026
1 check passed
@lostmygithubaccount lostmygithubaccount deleted the cody/ws-sfharden branch April 4, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant