{"record":{"id":"bcfc2453fb4746fb","repo":"langchain-ai/deepagents","slug":"assistant-id-is-required","errorCode":null,"errorMessage":"assistant id is required","messagePattern":"assistant id is required","errorType":"validation","errorClass":"TalonConfigError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/config.py","lineNumber":72,"sourceCode":"            base_home: Optional base directory for assistant state. Tests and\n                embedding hosts can supply this to avoid the user home directory.\n\n        Returns:\n            Runtime configuration with a validated assistant id and namespaced home.\n\n        Raises:\n            TalonConfigError: If the assistant id is empty or unsafe for a path segment.\n        \"\"\"\n        values = os.environ if env is None else env\n        assistant_id = _first_present(\n            values,\n            \"DEEPAGENTS_TALON_ASSISTANT_ID\",\n            \"AGENT_ASSISTANT_ID\",\n            default=\"default\",\n        )\n        if assistant_id is None:\n            msg = \"assistant id is required\"\n            raise TalonConfigError(msg)\n        _validate_assistant_id(assistant_id)\n\n        if base_home is None:\n            configured_home = values.get(\"DEEPAGENTS_TALON_HOME\")\n            root = Path(configured_home) if configured_home else Path.home() / \".deepagents\"\n        else:\n            root = base_home\n\n        model = _first_present(values, \"DEEPAGENTS_TALON_MODEL\", \"AGENT_MODEL\", default=None)\n        return cls(\n            assistant_id=assistant_id,\n            home=root.expanduser() / assistant_id,\n            model=model,\n            env={key: value for key, value in values.items() if _is_runtime_env(key)},\n        )\n\n    def ensure_home(self) -> Path:\n        \"\"\"Create the per-assistant home directory with restrictive permissions.","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/config.py#L54-L90","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\n# (no assistant id in env)\n# after\nexport DEEPAGENTS_TALON_ASSISTANT_ID=my-assistant","handlingStrategy":"validation","validationCode":"import os\nif not (os.environ.get(\"DEEPAGENTS_TALON_ASSISTANT_ID\") or os.environ.get(\"AGENT_ASSISTANT_ID\")):\n    raise RuntimeError(\"Set DEEPAGENTS_TALON_ASSISTANT_ID before starting Talon\")","typeGuard":"def assistant_id_configured(env: dict[str, str]) -> bool:\n    return bool(env.get(\"DEEPAGENTS_TALON_ASSISTANT_ID\") or env.get(\"AGENT_ASSISTANT_ID\"))","tryCatchPattern":"try:\n    config = TalonConfig.from_env(os.environ)\nexcept TalonConfigError as exc:\n    logging.error(\"invalid Talon configuration: %s\", exc)\n    raise SystemExit(1)","preventionTips":["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"],"tags":["configuration","env-var","assistant-id"],"backgroundTag":"missing-env-var","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}