Skip to content

fix(modal): pass explicit auth credentials to ModalClient#667

Open
Paul (paul-atx) wants to merge 1 commit into
langchain-ai:mainfrom
paul-atx:fix/modal-auth-credentials-ignored
Open

fix(modal): pass explicit auth credentials to ModalClient#667
Paul (paul-atx) wants to merge 1 commit into
langchain-ai:mainfrom
paul-atx:fix/modal-auth-credentials-ignored

Conversation

@paul-atx

Copy link
Copy Markdown

Summary

ModalSandbox validates auth credentials but never passes them to the client. initialize(), fromId(), and fromName() call getAuthCredentials(...) only to confirm credentials exist, discard the return value, and construct new ModalClient() with no arguments.

As a result, credentials supplied through the documented auth: { tokenId, tokenSecret } option are ignored — ModalClient falls back to MODAL_TOKEN_* env vars / .modal.toml. If no env/config profile is present, the first API call fails with "Profile is missing token_id or token_secret" despite valid credentials having been provided.

Changes

  • Capture the resolved credentials from getAuthCredentials(...) and pass them to new ModalClient({ tokenId, tokenSecret }) in initialize(), fromId(), and fromName().

Test plan

  • The auth option now reaches the Modal client; env-var auth is unchanged.
  • I didn't test this locally; CI runs the @langchain/modal unit tests.

@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7b54d91

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

This PR includes changesets to release 1 package
Name Type
@langchain/modal 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@667

deepagents

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

@langchain/sandbox-standard-tests

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

@langchain/daytona

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

@langchain/deno

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

@langchain/modal

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

@langchain/node-vfs

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

@langchain/quickjs

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

commit: 7b54d91

initialize(), fromId() and fromName() called getAuthCredentials() only to
validate that credentials exist, discarded the result, and constructed
`new ModalClient()` with no arguments. Credentials supplied through the
documented `auth: { tokenId, tokenSecret }` option were therefore ignored,
and the client fell back to env vars / .modal.toml, failing with "Profile
is missing token_id or token_secret" when no env/config profile is present.
Capture the resolved credentials and pass them to ModalClient.
@paul-atx Paul (paul-atx) force-pushed the fix/modal-auth-credentials-ignored branch from 20401a6 to 7b54d91 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