Skip to content

fix: Align API contract with LibreChat client (storage_session_id, kind, resource fields)#109

Merged
usnavy13 merged 2 commits into
devfrom
fix-contract-gaps
May 13, 2026
Merged

fix: Align API contract with LibreChat client (storage_session_id, kind, resource fields)#109
usnavy13 merged 2 commits into
devfrom
fix-contract-gaps

Conversation

@usnavy13
Copy link
Copy Markdown
Owner

Summary

  • storage_session_id alias — Added storage_session_id to all file-related responses (/upload, /upload/batch, /files/{session_id}, /exec FileRef). The LibreChat agents lib expects this field for per-file storage identity. Requests accept both storage_session_id and session_id via AliasChoices.
  • kind=skill/kind=agent in batch upload — LibreChat sends kind (not entity_id) for skill-priming uploads. Without this, skill bundles with non-standard extensions (.xsd, .toml, .d.ts) were rejected by the extension whitelist. Supersedes fix: recognize kind field for skill priming, add storage_session_id #108.
  • resource_id, kind, version fields — Added to FileRef (response), RequestFile, and PTCFileInput (request) models to match the CodeEnvFile type from librechat-agents.
  • kind/id/version query params on GET /files/{session_id} — The agents lib's fetchSessionFiles() sends these for scoped file listing.

Test plan

  • 505 unit tests passing
  • 239 integration tests passing (3 new tests added for kind=skill, kind=agent, storage_session_id in batch response)
  • 86 functional tests passing against live HTTPS endpoint
  • All CI lint checks passing (flake8, black, mypy)
  • Manual client-side validation via LibreChat GUI — session persistence, file generation, and code execution confirmed working
  • Docker logs clean — zero errors/warnings

🤖 Generated with Claude Code

usnavy13 added 2 commits May 8, 2026 23:12
Updated the API responses and models to replace all instances of session_id with storage_session_id for consistency. This change includes updates to the upload, list, and batch file operations, as well as adjustments in the corresponding tests and documentation to reflect the new naming convention.
…support

Updated the upload_files_batch and list_files functions to include support for resource kind and version parameters. The upload logic now marks files as agent files based on the kind provided. Additionally, the RequestFile and FileRef models have been updated to accept resource_id, kind, and version fields, with corresponding tests added to validate these changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant