LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithexperimentalsandboxWsRunOptions
Interface●Since v0.7

WsRunOptions

Options for the low-level WebSocket stream functions.

Copy
interface WsRunOptions

Properties

property
commandId: string
property
cwd: string

Working directory for command execution.

property
env: Record<string, string>

Environment variables to set for the command.

property
idleTimeout: number

Idle timeout in seconds. If the command has no connected clients for this duration, it is killed. Defaults to 300 (5 minutes). Set to -1 for no idle timeout.

property
killOnDisconnect: boolean

If true, kill the command immediately when the last client disconnects. Defaults to false (command continues running and can be reconnected to).

property
onStderr: (data: string) => void

Callback invoked with each stderr chunk during streaming execution. When provided, WebSocket streaming is used.

property
onStdout: (data: string) => void

Callback invoked with each stdout chunk during streaming execution. When provided, WebSocket streaming is used.

property
pty: boolean

If true, allocate a pseudo-terminal (PTY) for the command. Useful for commands that require a TTY (e.g., interactive programs, commands that use terminal control codes). Defaults to false.

property
shell: string

Shell to use for command execution. Defaults to "/bin/bash".

property
timeout: number
property
ttlSeconds: number

Maximum lifetime in seconds from creation. The sandbox is deleted after this duration. Must be a multiple of 60, or 0/undefined to disable or omit.

View source on GitHub