{"record":{"id":"852543d399bb476e","repo":"github/copilot-sdk","slug":"invalid-field-entry-there-is-no-bare-wildca-852543","errorCode":null,"errorMessage":"invalid {field} entry '*': there is no bare wildcard. Use ToolSet().add_builtin('*'), .add_mcp('*'), or .add_custom('*') to target a specific source.","messagePattern":"invalid (.+?) entry '\\*': there is no bare wildcard\\. Use ToolSet\\(\\)\\.add_builtin\\('\\*'\\), \\.add_mcp\\('\\*'\\), or \\.add_custom\\('\\*'\\) to target a specific source\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/copilot/_mode.py","lineNumber":135,"sourceCode":"        return None\n    if isinstance(value, ToolSet):\n        return value.to_list()\n    if isinstance(value, str):\n        raise TypeError(\n            \"tool filter must be a ToolSet or list[str], not str. \"\n            'Pass a single-element list (e.g. [\"builtin:bash\"]) or a '\n            \"ToolSet (e.g. ToolSet().add_builtin('bash')).\"\n        )\n    return list(value)\n\n\ndef _validate_tool_filter_list(field: str, items: list[str] | None) -> None:\n    \"\"\"Reject bare ``\"*\"`` entries (must use ``builtin:*``/``mcp:*``/``custom:*``).\"\"\"\n    if items is None:\n        return\n    for entry in items:\n        if entry == \"*\":\n            raise ValueError(\n                f\"invalid {field} entry '*': there is no bare wildcard. \"\n                \"Use ToolSet().add_builtin('*'), .add_mcp('*'), or \"\n                \".add_custom('*') to target a specific source.\"\n            )\n\n\ndef _system_message_for_mode(\n    mode: CopilotClientMode | None,\n    supplied: Any,\n) -> Any:\n    \"\"\"Apply empty-mode environment_context stripping to a system message dict.\n\n    The caller passes the already-normalized wire payload (a ``dict`` with\n    ``mode`` / ``content`` / ``sections``) or ``None``. The caller's value\n    wins if it already specifies an ``environment_context`` override.\n    \"\"\"\n    if mode != \"empty\":\n        return supplied","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/python/copilot/_mode.py#L117-L153","documentation":"When validating a tool filter list, a bare \"*\" entry is rejected because there is no cross-source wildcard — each source (builtin, mcp, custom) must be targeted explicitly. Use 'builtin:*', 'mcp:*', or 'custom:*' (or the equivalent ToolSet methods) to mean 'all tools of that source'.","triggerScenarios":"Calling create_session(available_tools=[\"*\"]) or resume_session(tools=[\"*\"]) — passing the wildcard without a source prefix into _validate_tool_filter_list.","commonSituations":"Developers assume \"*\" means 'all tools' (as it does inside ToolSet.add_builtin('*')) and use it directly in a plain list; config files contain tools: [\"*\"] intending to allow everything.","solutions":["Use ToolSet().add_builtin('*').add_mcp('*').add_custom('*') to allow all tools from every source","Or pass a list of source-qualified wildcards: ['builtin:*', 'mcp:*', 'custom:*']","Or list the specific tools you want instead of a global wildcard","Fix config files that contain a bare '*' tool entry to use source-qualified values"],"exampleFix":"// before\nclient.create_session(available_tools=[\"*\"])\n\n// after\nclient.create_session(\n    available_tools=ToolSet().add_builtin(\"*\").add_mcp(\"*\").add_custom(\"*\").to_list()\n)","handlingStrategy":"validation","validationCode":"if any(entry == \"*\" for entry in (items or [])):\n    raise ValueError('use \"builtin:*\", \"mcp:*\", or \"custom:*\" instead of bare \"*\"')","typeGuard":"def has_bare_wildcard(items) -> bool:\n    return items is not None and \"*\" in items","tryCatchPattern":"try:\n    session = client.create_session(available_tools=items)\nexcept ValueError as e:\n    if \"bare wildcard\" in str(e):\n        items = [\"builtin:*\", \"mcp:*\", \"custom:*\"]\n        session = client.create_session(available_tools=items)","preventionTips":["Prefer ToolSet builders — they make wildcard scope explicit via the method used","Search config for bare \"*\" tool entries and replace with source-qualified wildcards","Remember: inside a source, '*' means all tools of that source; in a raw list it is invalid","Validate tool filter lists in one shared function before any create_session call"],"tags":["validation","python","tools","wildcard"],"backgroundTag":"invalid-argument-value","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}