Describe the bug
I cannot delete a document if its document_id contains a forward slash (/), even though such documents can be created via retain and appear in listDocuments.
To Reproduce
- Create a memory with a path-like ID:
POST /v1/default/banks/test/memories
{
"content": "test",
"document_id": "folder/file.md"
}
- Verify it exists via
GET /v1/default/banks/test/documents (it returns id: "folder/file.md").
- Try to delete it via
DELETE /v1/default/banks/test/documents/{document_id}:
- Raw:
DELETE .../documents/folder/file.md -> 404 Not Found (Router mismatch)
- Encoded:
DELETE .../documents/folder%2Ffile.md -> 404 Not Found (Router mismatch)
- Double Encoded:
DELETE .../documents/folder%252Ffile.md -> 404 Document not found (App logic mismatch)
Expected behavior
The API should accept encoded slashes in the document_id path parameter and correctly resolve them to the stored ID, allowing deletion.
Context
- Hindsight Version: (Latest Docker image)
- Client: Custom CLI using generated TypeScript SDK.
- Impact: Forces clients to use ID encoding strategies (like Base64URL) to work around the API limitation for file-based synchronization, and prevents cleanup of existing legacy documents.
Describe the bug
I cannot delete a document if its
document_idcontains a forward slash (/), even though such documents can be created viaretainand appear inlistDocuments.To Reproduce
POST /v1/default/banks/test/memories { "content": "test", "document_id": "folder/file.md" }GET /v1/default/banks/test/documents(it returnsid: "folder/file.md").DELETE /v1/default/banks/test/documents/{document_id}:DELETE .../documents/folder/file.md->404 Not Found(Router mismatch)DELETE .../documents/folder%2Ffile.md->404 Not Found(Router mismatch)DELETE .../documents/folder%252Ffile.md->404 Document not found(App logic mismatch)Expected behavior
The API should accept encoded slashes in the
document_idpath parameter and correctly resolve them to the stored ID, allowing deletion.Context