-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Summary
The deprecated behavior in GET /v1/working-memory/{session_id} that returns an empty working memory instead of 404 for missing sessions should be removed.
Current Behavior
When a session doesn't exist, the API returns a new empty WorkingMemory object with new_session: true instead of returning 404. This was kept for backward compatibility with older clients.
Problem
This behavior masks bugs where clients use mismatched parameters between PUT and GET:
- Client PUTs working memory with
namespace=default, user_id=default - Client GETs with
namespace=defaultbut nouser_id - Server looks for different key, doesn't find it
- Instead of 404, returns empty session - client thinks data was lost
The warning log shows:
Client version X using deprecated behavior. GET /v1/working-memory/{session_id} will return 404 for missing sessions in version 1.0.
Proposed Change
Remove the deprecated behavior and return 404 for missing sessions. Clients should use getOrCreateWorkingMemory if they want create-on-read semantics.
Related
This was discovered while investigating a bug where the JS client's getWorkingMemory didn't pass user_id as a query parameter, causing key mismatches.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels