Skip to content

Bug: VectorStoreFile.PollStatus fails with 400 Bad Request #538

@gbrlmza

Description

@gbrlmza

Description

The VectorStoreFile.PollStatus method is calling the underlying Get method with parameters in the wrong order, causing API requests to fail with 400 Bad Request errors.

Current Behavior

When calling PollStatus, the internal Get call uses swapped parameters (fileID, vectorStoreID instead of vectorStoreID, fileID), which generates an incorrect URL path like /vector_stores/{fileID}/files/{vectorStoreID} instead of the correct /vector_stores/{vectorStoreID}/files/{fileID}.

Expected Behavior

The Get method should be called with parameters in the correct order to generate the proper API endpoint path.

Steps to Reproduce

  1. Call VectorStoreFile.PollStatus with a valid vector store ID and file ID
  2. The method will fail with a 400 Bad Request error due to the malformed URL path

Impact

Any code using PollStatus(NewAndPoll and UploadAndPoll) will fail, as these methods cannot successfully poll the file status.

Fix

Swap the parameter order in the Get call within PollStatus from r.Get(ctx, fileID, vectorStoreID, opts...) to r.Get(ctx, vectorStoreID, fileID, opts...) as proposed in #537 that also includes a unit test

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