Skip to content

fix(deepagents): add ABAP/SAP extensions to MIME_TYPES - #650

Open
Renan Lalier (renanlalier) wants to merge 2 commits into
langchain-ai:mainfrom
renanlalier:fix/abap-mime-types
Open

Renan Lalier (renanlalier) wants to merge 2 commits into
langchain-ai:mainfrom
renanlalier:fix/abap-mime-types

Conversation

@renanlalier

Copy link
Copy Markdown

Problem

getMimeType() looks up file extensions in a fixed MIME_TYPES dictionary and
falls 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 not
in MIME_TYPES. As a result, isTextMimeType() returned false for all ABAP
source files, causing read_file to return a binary {"type":"file"} content
block instead of plain text.

This breaks any provider that does not support file content blocks. Concretely,
Bedrock via LiteLLM raises:

litellm.BadRequestError: BedrockException - 'file'

Solution

Add the missing ABAP/SAP extensions, all mapped to "text/plain":

Extension Description
.abap All ABAP source objects (covers *.clas.abap, *.prog.abap, *.fugr.abap, etc.)
.asddls CDS view definitions
.asdtmd CDS metadata extensions
.ddls Data Definition Language (CDS alternative)
.ddlx CDS access control extensions

Note: other abapGit object types (.doma, .dtel, .tabl, etc.) are always
paired with a .xml suffix in abapGit repos, so extname() resolves to .xml,
which is already mapped. No additional entries are needed for those.

Testing

New test cases added to utils.test.ts under getMimeType:

  • Simple .abap files
  • Compound abapGit names (*.clas.abap, *.prog.abap, *.fugr.abap)
  • CDS/DDL extensions (.asddls, .asdtmd, .ddls, .ddlx)
  • End-to-end: isTextMimeType(getMimeType("teste.clas.abap")) === true

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.
@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 518afdf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

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.

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

npm i https://pkg.pr.new/deepagents-acp@650

deepagents

npm i https://pkg.pr.new/deepagents@650

@langchain/sandbox-standard-tests

npm i https://pkg.pr.new/@langchain/sandbox-standard-tests@650

@langchain/daytona

npm i https://pkg.pr.new/@langchain/daytona@650

@langchain/deno

npm i https://pkg.pr.new/@langchain/deno@650

@langchain/modal

npm i https://pkg.pr.new/@langchain/modal@650

@langchain/node-vfs

npm i https://pkg.pr.new/@langchain/node-vfs@650

@langchain/quickjs

npm i https://pkg.pr.new/@langchain/quickjs@650

commit: 518afdf

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