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
JavaScriptlangsmithsandboxWsRunOptions
Interface●Since v0.8

WsRunOptions

Options for the low-level WebSocket stream functions.

Copy
interface WsRunOptions

Properties

View source on GitHub
property
commandId: string
property
cwd: string
property
env: Record<string, string>
property
headers: Record<string, string>
property
idleTimeout: number
property
killOnDisconnect: boolean
property
onStderr: (data: string) => void
property
onStdout: (data: string) => void
property
pty: boolean
property
shell: string
property
timeout: number
property
ttlSeconds: number

Working directory for command execution.

Environment variables to set for the command.

HTTP headers for the response that caused the error

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.

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

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

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

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.

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

How long (in seconds) a finished command's session is kept for reconnection. Defaults to 600 (10 minutes). Set to -1 to keep indefinitely.