Skip to content

fix: improve Vector Stores OpenAI API conformance#5398

Draft
leseb wants to merge 10 commits intollamastack:mainfrom
leseb:fix-vector-stores-conformance
Draft

fix: improve Vector Stores OpenAI API conformance#5398
leseb wants to merge 10 commits intollamastack:mainfrom
leseb:fix-vector-stores-conformance

Conversation

@leseb
Copy link
Copy Markdown
Collaborator

@leseb leseb commented Apr 1, 2026

Summary

Fix schema issues in the Vector Stores API to improve OpenAI conformance from 61.3% to ~87%.

Supersedes #5394 (which was too broad, mixing embeddings + vector stores + OpenAPI generator changes).

Key changes

  • Add VectorStoreExpirationAfter model with anchor/days fields
  • Add VectorStoreStatus literal type and VectorStoreFileBatchFileEntry model
  • Make required fields non-optional to match OpenAI spec (name, usage_bytes, status, has_more)
  • Fix object fields to use Literal types with correct values
  • Add missing error codes (unsupported_file, invalid_file)
  • Make metadata nullable to match OpenAI spec
  • Add description field to vector store create request

Files changed (6 source + regenerated specs)

  • src/llama_stack_api/vector_io/models.py - schema fixes
  • src/llama_stack/core/routers/vector_io.py - pass newly required fields
  • src/llama_stack/providers/utils/memory/openai_vector_store_mixin.py - pass newly required fields
  • 3 test files updated for new required fields

Test plan

  • Unit tests pass (27 tests)
  • Mypy passes
  • Pre-commit passes
  • API spec codegen clean

🤖 Generated with Claude Code

leseb and others added 2 commits April 1, 2026 11:27
Fix schema issues in the Vector Stores API to improve OpenAI conformance
from 61.3% to 87.1%.

Key changes:
- Add VectorStoreExpirationAfter model with anchor/days fields
- Add VectorStoreStatus and VectorStoreFileBatchFileEntry types
- Make required fields non-optional (name, usage_bytes, status, etc.)
- Fix object literal types to match OpenAI spec
- Add missing error codes (unsupported_file, invalid_file)
- Make metadata nullable to match OpenAI spec

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

✱ Stainless preview builds

This PR will update the llama-stack-client SDKs with the following commit message.

fix: improve Vector Stores OpenAI API conformance

Edit this comment to update it. It will appear in the SDK's changelogs.

llama-stack-client-go studio · conflict

Your SDK build had at least one new note diagnostic, which is a regression from the base state.

New diagnostics (13 note)
💡 Model/Recommended: `#/components/schemas/VectorStoreExpirationAfter` could potentially be defined as a [model](https://www.stainless.com/docs/guides/configure#models) within `#/resources/vector_stores`.
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
💡 Schema/EnumHasOneMember: This enum schema has just one member, so it could be defined using [`const`](https://json-schema.org/understanding-json-schema/reference/const).
llama-stack-client-python studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/llama-stack-client-python/81c0134b4b95d2069e775ea4912070d1fa8ebd02/llama_stack_client-0.7.0a2-py3-none-any.whl
New diagnostics (1 note)
💡 Model/Recommended: `#/components/schemas/VectorStoreExpirationAfter` could potentially be defined as a [model](https://www.stainless.com/docs/guides/configure#models) within `#/resources/vector_stores`.
llama-stack-client-openapi studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️

New diagnostics (1 note)
💡 Model/Recommended: `#/components/schemas/VectorStoreExpirationAfter` could potentially be defined as a [model](https://www.stainless.com/docs/guides/configure#models) within `#/resources/vector_stores`.
llama-stack-client-node studio · conflict

Your SDK build had at least one new note diagnostic, which is a regression from the base state.

New diagnostics (1 note)
💡 Model/Recommended: `#/components/schemas/VectorStoreExpirationAfter` could potentially be defined as a [model](https://www.stainless.com/docs/guides/configure#models) within `#/resources/vector_stores`.

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-04-02 09:11:40 UTC

@franciscojavierarceo
Copy link
Copy Markdown
Collaborator

Nice

leseb and others added 8 commits April 1, 2026 16:15
Fix vector_store.files_batch typo to vector_store.file_batch (matching
OpenAI spec). Add missing usage_bytes field to test constructors after
making it required.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
… fix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
The usage_bytes field was made required but many code paths construct
VectorStoreFileObject and VectorStoreObject without setting it, causing
500 errors during file search operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Making usage_bytes optional is intentional - the runtime doesn't always
have this value available (e.g. during file search operations).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
The name field was changed from optional to required, but stored
vector stores may have name=null. Default to empty string to prevent
validation errors when loading existing data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants