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=default but no user_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.
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
WorkingMemoryobject withnew_session: trueinstead 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:
namespace=default, user_id=defaultnamespace=defaultbut nouser_idThe warning log shows:
Proposed Change
Remove the deprecated behavior and return 404 for missing sessions. Clients should use
getOrCreateWorkingMemoryif they want create-on-read semantics.Related
This was discovered while investigating a bug where the JS client's
getWorkingMemorydidn't passuser_idas a query parameter, causing key mismatches.