{"record":{"id":"2e0497128fcb6b83","repo":"langchain-ai/deepagents","slug":"themeentry-label-must-be-a-non-empty-string","errorCode":null,"errorMessage":"ThemeEntry.label must be a non-empty string","messagePattern":"ThemeEntry\\.label must be a non-empty string","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/theme.py","lineNumber":439,"sourceCode":"    colors: ThemeColors\n    \"\"\"Resolved color set.\"\"\"\n\n    custom: bool = True\n    \"\"\"Whether this theme must be registered with Textual via `register_theme()`.\n\n    `True` for LangChain-branded themes and user-defined themes.\n    `False` for Textual built-in themes that Textual already knows about.\n    \"\"\"\n\n    def __post_init__(self) -> None:\n        \"\"\"Validate that the label is a non-empty string.\n\n        Raises:\n            ValueError: If `label` is empty or whitespace-only.\n        \"\"\"\n        if not self.label.strip():\n            msg = \"ThemeEntry.label must be a non-empty string\"\n            raise ValueError(msg)\n\n\n# Curated labels for Textual built-in themes. Themes not listed here fall back\n# to a humanized version of the slug (e.g. `ansi-dark` → `Ansi Dark`), so newly\n# shipped Textual themes appear in the picker without code changes.\n_TEXTUAL_THEME_LABELS: Mapping[str, str] = MappingProxyType(\n    {\n        \"textual-dark\": \"Textual Dark\",\n        \"textual-light\": \"Textual Light\",\n        \"ansi-dark\": \"Terminal ANSI Dark\",\n        \"ansi-light\": \"Terminal ANSI Light\",\n        \"catppuccin-frappe\": \"Catppuccin Frappé\",\n        \"rose-pine\": \"Rosé Pine\",\n        \"rose-pine-dawn\": \"Rosé Pine Dawn\",\n        \"rose-pine-moon\": \"Rosé Pine Moon\",\n        \"tokyo-night\": \"Tokyo Night\",\n    }\n)","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/theme.py#L421-L457","documentation":"ThemeEntry.label must contain at least one non-whitespace character; __post_init__ rejects empty or whitespace-only labels with ValueError. Labels are shown in the theme picker, so blank labels would render unusable UI rows.","triggerScenarios":"Creating ThemeEntry(label=\"\") or ThemeEntry(label=\"   \"), or deserializing a theme entry from config where the label key is missing/blank.","commonSituations":"Empty string defaults in hand-written theme files, YAML/TOML entries with `label = \"\"`, or code that derives labels from an empty user-supplied name.","solutions":["Provide a non-empty label string when constructing ThemeEntry.","If the label may be absent, fall back to a humanized slug (e.g. 'ansi-dark' -> 'Ansi Dark') before construction.","Trim user input and check `label.strip()` before building the entry."],"exampleFix":"// before\nThemeEntry(slug=\"solarized\", label=\"\")\n// after\nThemeEntry(slug=\"solarized\", label=\"Solarized\")","handlingStrategy":"validation","validationCode":"label = raw_label.strip() or humanize(slug)\nif not label:\n    raise ValueError(\"theme label required\")\nentry = ThemeEntry(slug=slug, label=label)","typeGuard":"def has_label(label: object) -> TypeGuard[str]:\n    return isinstance(label, str) and bool(label.strip())","tryCatchPattern":"try:\n    entry = ThemeEntry(slug=slug, label=raw_label)\nexcept ValueError:\n    entry = ThemeEntry(slug=slug, label=humanize(slug))","preventionTips":["Default missing labels to a humanized slug instead of empty string.","Strip whitespace from config-sourced labels before use.","Validate theme files in CI with a schema check."],"tags":["validation","theme","config"],"backgroundTag":"empty-required-field","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}