{"record":{"id":"2a7ff87bce642aea","repo":"langchain-ai/deepagents","slug":"unknown-keys-in-generalpurposesubagentprofile-dict","errorCode":null,"errorMessage":"Unknown keys in GeneralPurposeSubagentProfile dict: {sorted(unknown)}","messagePattern":"Unknown keys in GeneralPurposeSubagentProfile dict: (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"libs/deepagents/deepagents/profiles/harness/harness_profiles.py","lineNumber":175,"sourceCode":"    @classmethod\n    def from_dict(cls, data: Mapping[str, Any]) -> GeneralPurposeSubagentProfile:\n        \"\"\"Construct a sub-profile from a plain dict.\n\n        Args:\n            data: Mapping with any subset of `enabled`, `description`, and\n                `system_prompt` keys.\n\n        Returns:\n            A new `GeneralPurposeSubagentProfile`.\n\n        Raises:\n            TypeError: If `data` contains unknown keys, or if any value has\n                the wrong type.\n        \"\"\"\n        unknown = set(data.keys()) - _GENERAL_PURPOSE_SUBAGENT_KEYS\n        if unknown:\n            msg = f\"Unknown keys in GeneralPurposeSubagentProfile dict: {sorted(unknown)}\"\n            raise TypeError(msg)\n        enabled = data.get(\"enabled\")\n        description = data.get(\"description\")\n        system_prompt = data.get(\"system_prompt\")\n        if enabled is not None and not isinstance(enabled, bool):\n            msg = f\"`enabled` must be bool or None, got {type(enabled).__name__}\"\n            raise TypeError(msg)\n        if description is not None and not isinstance(description, str):\n            msg = f\"`description` must be str or None, got {type(description).__name__}\"\n            raise TypeError(msg)\n        if system_prompt is not None and not isinstance(system_prompt, str):\n            msg = f\"`system_prompt` must be str or None, got {type(system_prompt).__name__}\"\n            raise TypeError(msg)\n        return cls(enabled=enabled, description=description, system_prompt=system_prompt)\n\n\n@dataclass(frozen=True)\nclass HarnessProfileConfig:\n    \"\"\"Declarative harness-profile config for YAML/JSON-backed profiles.","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/deepagents/deepagents/profiles/harness/harness_profiles.py#L157-L193","documentation":"GeneralPurposeSubagentProfile.from_dict only accepts the fixed key set _GENERAL_PURPOSE_SUBAGENT_KEYS (enabled, description, system_prompt). Any other key in the dict raises TypeError, protecting users from silently ignored typos.","triggerScenarios":"Passing a dict with misspelled or extra keys, e.g. {'systemPrompt': ...}, {'prompt': ...}, or a whole unrelated config block, to from_dict via _coerce_general_purpose_subagent.","commonSituations":"YAML/JSON harness config with camelCase instead of snake_case; leftover keys from an older schema version; nesting a provider config under the subagent block by mistake.","solutions":["Remove unknown keys; keep only enabled, description, system_prompt.","Fix key spelling to snake_case ('system_prompt' not 'systemPrompt').","Check the schema/version expected by the installed deepagents release."],"exampleFix":"// before\nfrom_dict({\"systemPrompt\": \"...\", \"verbose\": True})\n// after\nfrom_dict({\"system_prompt\": \"...\"})","handlingStrategy":"validation","validationCode":"ALLOWED = {\"enabled\", \"description\", \"system_prompt\"}\nunknown = set(data.keys()) - ALLOWED\nif unknown:\n    raise ValueError(f\"unexpected keys: {sorted(unknown)}\")","typeGuard":"def is_subagent_dict(v: object) -> bool:\n    return isinstance(v, dict) and set(v) <= {\"enabled\", \"description\", \"system_prompt\"}","tryCatchPattern":"try:\n    profile = GeneralPurposeSubagentProfile.from_dict(data)\nexcept TypeError as e:\n    logging.error(\"invalid subagent profile config: %s\", e)\n    profile = GeneralPurposeSubagentProfile()","preventionTips":["Use snake_case keys matching the dataclass fields","Validate YAML/JSON against the documented schema before loading","Pin and read the docs for your installed deepagents version"],"tags":["python","profiles","schema-validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}