Skip to content

fix(daytona): classify DaytonaNotFoundError as file_not_found - #666

Open
Paul (paul-atx) wants to merge 1 commit into
langchain-ai:mainfrom
paul-atx:fix/daytona-maperror-enoent
Open

fix(daytona): classify DaytonaNotFoundError as file_not_found#666
Paul (paul-atx) wants to merge 1 commit into
langchain-ai:mainfrom
paul-atx:fix/daytona-maperror-enoent

Conversation

@paul-atx

Copy link
Copy Markdown

Summary

DaytonaSandbox.#mapError classified filesystem errors purely from the error-message text, checking msg.includes("directory") before matching file-not-found. The Daytona SDK maps a 404 to a typed DaytonaNotFoundError, so a missing path could be misclassified as is_directory depending on the message wording.

Callers that treat file_not_found as expected — e.g. the optional memory files in the deepagents fs middleware, which skip on file_not_found but throw on any other code — would then throw Failed to download <path>: is_directory instead of degrading gracefully.

The modal provider already classifies missing paths by type (error instanceof SandboxFilesystemNotFoundErrorfile_not_found); this aligns daytona with it.

Changes

  • Check error instanceof DaytonaNotFoundError first → file_not_found (robust to message wording, mirrors modal).
  • Align the message fallback with modal: match "no such file", and narrow the directory check from "directory" to "is a directory".

Test plan

  • Classification-only change; no behavior change beyond the error mapping.
  • I didn't test this locally; CI runs the @langchain/daytona unit tests.

@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4715ed9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/daytona Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

Paul (@paul-atx) 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 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

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

deepagents

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

@langchain/sandbox-standard-tests

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

@langchain/daytona

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

@langchain/deno

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

@langchain/modal

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

@langchain/node-vfs

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

@langchain/quickjs

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

commit: 4715ed9

DaytonaSandbox.#mapError relied on error-message substrings and checked
`msg.includes("directory")` before a file-not-found match, so a missing
path could be misclassified as `is_directory`. The Daytona SDK maps a 404
to a typed DaytonaNotFoundError, so check that directly (mirroring the modal
provider's SandboxFilesystemNotFoundError check), and align the message
fallback with modal ("no such file" -> file_not_found, and narrow the
directory check to "is a directory"). Callers that treat file_not_found as
expected (e.g. optional memory files in the deepagents fs middleware) then
degrade gracefully instead of throwing.
@paul-atx
Paul (paul-atx) force-pushed the fix/daytona-maperror-enoent branch from 3fb2ac5 to 4715ed9 Compare July 12, 2026 17:53
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