fix(deepagents): add ABAP/SAP extensions to MIME_TYPES - #650
Open
Renan Lalier (renanlalier) wants to merge 2 commits into
Open
Renan Lalier (renanlalier) wants to merge 2 commits into
Renan Lalier (renanlalier) wants to merge 2 commits into
Conversation
path.extname() on compound abapGit filenames (e.g. ZCL_FOO.clas.abap) returns only the last segment (.abap), which was not in MIME_TYPES and fell through to "application/octet-stream". This caused read_file to return a binary content-block instead of plain text, breaking providers that do not support file blocks (e.g. Bedrock via LiteLLM). Adds .abap, .asddls, .asdtmd, .ddls, .ddlx mapped to text/plain.
|
|
Renan Lalier (@renanlalier) is attempting to deploy a commit to the LangChain Team on Vercel. A member of the Team first needs to authorize it. |
deepagents-acp
deepagents
@langchain/sandbox-standard-tests
@langchain/daytona
@langchain/deno
@langchain/modal
@langchain/node-vfs
@langchain/quickjs
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
getMimeType()looks up file extensions in a fixedMIME_TYPESdictionary andfalls back to
"application/octet-stream"for unknown extensions.path.extname()on compound abapGit filenames (e.g.ZCL_MY_CLASS.clas.abap,ZREPORT.prog.abap) returns only the last segment —.abap— which was notin
MIME_TYPES. As a result,isTextMimeType()returnedfalsefor all ABAPsource files, causing
read_fileto return a binary{"type":"file"}contentblock instead of plain text.
This breaks any provider that does not support file content blocks. Concretely,
Bedrock via LiteLLM raises:
Solution
Add the missing ABAP/SAP extensions, all mapped to
"text/plain":.abap*.clas.abap,*.prog.abap,*.fugr.abap, etc.).asddls.asdtmd.ddls.ddlxNote: other abapGit object types (
.doma,.dtel,.tabl, etc.) are alwayspaired with a
.xmlsuffix in abapGit repos, soextname()resolves to.xml,which is already mapped. No additional entries are needed for those.
Testing
New test cases added to
utils.test.tsundergetMimeType:.abapfiles*.clas.abap,*.prog.abap,*.fugr.abap).asddls,.asdtmd,.ddls,.ddlx)isTextMimeType(getMimeType("teste.clas.abap")) === true