langchain-ai/deepagents · error · TalonConfigError
assistant id is required
Error message
assistant id is required
What it means
`TalonConfig.from_env` requires an assistant id and falls back to the value 'default' only when the env vars (`DEEPAGENTS_TALON_ASSISTANT_ID`, `AGENT_ASSISTANT_ID`) resolve to an empty string; if the resolved value is `None`, configuration is considered incomplete and `TalonConfigError` is raised. Every Talon runtime must be bound to an assistant id.
Source
Thrown at libs/talon/deepagents_talon/config.py:72
base_home: Optional base directory for assistant state. Tests and
embedding hosts can supply this to avoid the user home directory.
Returns:
Runtime configuration with a validated assistant id and namespaced home.
Raises:
TalonConfigError: If the assistant id is empty or unsafe for a path segment.
"""
values = os.environ if env is None else env
assistant_id = _first_present(
values,
"DEEPAGENTS_TALON_ASSISTANT_ID",
"AGENT_ASSISTANT_ID",
default="default",
)
if assistant_id is None:
msg = "assistant id is required"
raise TalonConfigError(msg)
_validate_assistant_id(assistant_id)
if base_home is None:
configured_home = values.get("DEEPAGENTS_TALON_HOME")
root = Path(configured_home) if configured_home else Path.home() / ".deepagents"
else:
root = base_home
model = _first_present(values, "DEEPAGENTS_TALON_MODEL", "AGENT_MODEL", default=None)
return cls(
assistant_id=assistant_id,
home=root.expanduser() / assistant_id,
model=model,
env={key: value for key, value in values.items() if _is_runtime_env(key)},
)
def ensure_home(self) -> Path:
"""Create the per-assistant home directory with restrictive permissions.View on GitHub (pinned to a1af029e6e)
Solutions
- Set DEEPAGENTS_TALON_ASSISTANT_ID=<your-assistant-id> in the environment or .env file used by the process.
- Alternatively set AGENT_ASSISTANT_ID, the legacy fallback variable.
- If you intend the default, verify why the fallback didn't apply — the lookup likely returned None rather than empty; export the var explicitly to be safe.
Example fix
# before # (no assistant id in env) # after export DEEPAGENTS_TALON_ASSISTANT_ID=my-assistant
Defensive patterns
Strategy: validation
Validate before calling
import os
if not (os.environ.get("DEEPAGENTS_TALON_ASSISTANT_ID") or os.environ.get("AGENT_ASSISTANT_ID")):
raise RuntimeError("Set DEEPAGENTS_TALON_ASSISTANT_ID before starting Talon") Type guard
def assistant_id_configured(env: dict[str, str]) -> bool:
return bool(env.get("DEEPAGENTS_TALON_ASSISTANT_ID") or env.get("AGENT_ASSISTANT_ID")) Try / catch
try:
config = TalonConfig.from_env(os.environ)
except TalonConfigError as exc:
logging.error("invalid Talon configuration: %s", exc)
raise SystemExit(1) Prevention
- Keep assistant id in your .env template and commit the template (not secrets)
- Fail fast at process start with an env-var presence check
- Document the variable names in your deployment runbook
- When scripting, pass an explicit env dict including the assistant id
When it happens
Trigger: Calling `TalonConfig.from_env` (directly or via `main`, `_run_import_fleet_command`) when `DEEPAGENTS_TALON_ASSISTANT_ID` / `AGENT_ASSISTANT_ID` are unset such that the resolved assistant id is None rather than the 'default' fallback.
Common situations: New developer machines without the .env loaded; CI jobs missing secrets/env injection; helper scripts constructing env dicts that omit the assistant id keys; migrations from other agent tooling that used a different variable name.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- Invalid {SERVER_ENV_PREFIX}ALLOW_FS_TOOLS value: unknown fil
- Invalid {SERVER_ENV_PREFIX}ALLOW_FS_TOOLS value: {raw!r}; ex
- {config.provider} exposure mode 'open' allows arbitrary send
- Telegram bot token is required (DEEPAGENTS_TALON_TELEGRAM_BO
- assistant id must be 1-128 characters and contain only lette
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/bcfc2453fb4746fb.
Report an issue: GitHub.