Skip to content

Remove deprecated empty-session-on-missing behavior from GET working-memory #136

@abrookins

Description

@abrookins

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:

  1. Client PUTs working memory with namespace=default, user_id=default
  2. Client GETs with namespace=default but no user_id
  3. Server looks for different key, doesn't find it
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions