Skip to content

fix: recognize kind field for skill priming, add storage_session_id#108

Closed
joohan-lee wants to merge 3 commits into
usnavy13:devfrom
joohan-lee:fix/librechat-batch-compat
Closed

fix: recognize kind field for skill priming, add storage_session_id#108
joohan-lee wants to merge 3 commits into
usnavy13:devfrom
joohan-lee:fix/librechat-batch-compat

Conversation

@joohan-lee
Copy link
Copy Markdown

Description

Fixes two compatibility bugs in POST /upload/batch that cause LibreChat skill priming to fail completely.

Bug 1 — storage_session_id missing from response

LibreChat's batchUploadCodeEnvFiles (crud.js) validates the response:

if (!result.storage_session_id || !Array.isArray(result.files)) {
  throw new Error(`Unexpected batch upload response`)
}

The endpoint was returning session_id only. Added storage_session_id as an alias (same value) so LibreChat's validator passes. session_id is kept for backward compatibility.

Bug 2 — kind=skill not recognized; .xsd files rejected

LibreChat's appendCodeEnvFileIdentity() sends kind, id, version fields — never entity_id. The endpoint was checking only entity_id to set is_agent_file, so skill bundle files with non-standard extensions (39 .xsd schemas, etc.) were rejected by the extension whitelist, causing:

[primeSkillFiles] Partial upload failure for skill "pptx": 39 file(s) missing

Added recognition of kind=skill and kind=agent as agent-file uploads. The entity_id path is unchanged for backward compatibility.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added two integration tests:

  • test_kind_skill_marks_files_as_agent — verifies kind=skill sets is_agent_file=True
  • test_batch_response_includes_storage_session_id — verifies response field presence and value

All existing unit and integration tests pass.

usnavy13 added 2 commits May 7, 2026 10:52
Release: S3 migration, PTC bash, egress proxy, compose consolidation
docs: Add Star History section to README.md
@joohan-lee joohan-lee requested a review from usnavy13 as a code owner May 13, 2026 03:21
LibreChat's batchUploadCodeEnvFiles sends kind/id/version form fields
(not entity_id) and expects storage_session_id in the response.

Two bugs in upload_files_batch caused skill priming to always fail:
- is_agent_file checked only entity_id, so kind=skill uploads were
  treated as user files and .xsd schemas were rejected by the whitelist
- response returned session_id only; LibreChat throws if
  storage_session_id is absent

Add kind=skill/agent recognition alongside the existing entity_id path.
Add storage_session_id as an alias for session_id in the response.
Both changes are backward compatible.
@joohan-lee joohan-lee changed the title fix: support kind field for skill priming and add storage_session_id to batch response fix: recognize kind field for skill priming, add storage_session_id May 13, 2026
@joohan-lee joohan-lee force-pushed the fix/librechat-batch-compat branch from df051e3 to 4892181 Compare May 13, 2026 03:26
@djuillard
Copy link
Copy Markdown

I confirm that Librechat has modified the way to interface with LibreCodeInterpreter again in its latest dev image. I think this is needed to make it work again. Thanks

@usnavy13
Copy link
Copy Markdown
Owner

Thanks for this, we are already testing a fix for the storage session and the kind skill issue. will be pushing to dev soon

@usnavy13
Copy link
Copy Markdown
Owner

Thanks for the contribution! Both fixes from this PR (storage_session_id in batch response + kind=skill/agent recognition) have been incorporated into #109 which was just merged to dev. That PR also adds broader contract alignment: storage_session_id across all endpoints, resource_id/kind/version fields on request and response models, and scoped query params on the file listing endpoint. Closing as superseded — appreciate the report and the fix!

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.

3 participants