Skip to content

Conversation

abrookins
Copy link
Collaborator

@abrookins abrookins commented Oct 1, 2025

We can't re-raise the original error because upstream, we expect a custom error, not the original.

@Copilot Copilot AI review requested due to automatic review settings October 1, 2025 07:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes client error handling by removing redundant raise statements after _handle_http_error calls. The _handle_http_error method already raises appropriate exceptions, so the additional raise statements were causing the original HTTPStatusError to be re-raised instead of the proper custom exceptions, breaking error handling flow.

  • Removes redundant raise statements from all HTTP error handling blocks in the client
  • Adds comprehensive test coverage for the get_or_create_working_memory method's 404 handling
  • Updates version from 0.12.2 to 0.12.3

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
agent-memory-client/agent_memory_client/client.py Removes redundant raise statements from HTTP error handling blocks across all API methods
agent-memory-client/tests/test_client.py Adds test to verify proper 404 error handling in get_or_create_working_memory method
agent-memory-client/agent_memory_client/init.py Updates package version to 0.12.3

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@abrookins abrookins changed the title Fix/fix client error handling Fix client error handling Oct 1, 2025
The _handle_http_error method raises exceptions but the code was
re-raising the original HTTPStatusError, preventing get_or_create_working_memory
from catching MemoryNotFoundError and creating new sessions.

Changes:
- Remove redundant raise statements after _handle_http_error calls
- Change _handle_http_error return type to NoReturn for mypy
- Add test to verify 404 handling works correctly
- Bump version to 0.12.3
@abrookins abrookins merged commit c038ad4 into main Oct 1, 2025
11 of 12 checks passed
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