Skip to content

Detach a file from vector store will Detach the file from all vector stores #1710

@yusufmsabeh

Description

@yusufmsabeh

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

I am encountering an unexpected behavior when trying to detach a file from a specific Vector Store using the Node SDK ("openai": "^4.96.2").

Observed Behavior:
When a file is attached to multiple Vector Stores (e.g., VS_A, VS_B, and VS_C), calling the delete function for a single Vector Store ID results in the file being detached from ALL of them.

Function Used:

const response = await openai().vectorStores.files.delete(
  "VS_A_ID", // Deleting the file from VS_A
  "file-xxx",
);

Result: The file "file-xxx" is successfully detached from VS_A, VS_B, and VS_C.

Expected: The file should only be detached from the Vector Store specified in the function call (VS_A_ID). It should remain attached to VS_B and VS_C.

Additional Context:
The underlying file object itself is not deleted from the main /v1/files endpoint, which is the correct behavior.

The issue is that the removal from one Vector Store seems to have a global effect on all attachments of that file.

This appears to be a bug, as deleting a specific vector_store_file object should be scope-limited to the provided vectorStoreId.

To Reproduce

1- upload a file to OpenAI
2- Use the file_id to attach the file to different vector stores
3- Detach a file from one vector store
The file will be detached from all vector stories

Code snippets

OS

windows 11

Node version

Node v22.19.0

Library version

openai 4.96.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions