{"record":{"id":"80bef0d20cdf4863","repo":"github/copilot-sdk","slug":"missing-required-field-isauthenticated-in-getaut","errorCode":null,"errorMessage":"Missing required field 'isAuthenticated' in GetAuthStatusResponse","messagePattern":"Missing required field 'isAuthenticated' in GetAuthStatusResponse","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/copilot/client.py","lineNumber":932,"sourceCode":"        return result\n\n\n@dataclass\nclass GetAuthStatusResponse:\n    \"\"\"Response from auth.getStatus\"\"\"\n\n    isAuthenticated: bool  # Whether the user is authenticated\n    authType: str | None = None  # Authentication type\n    host: str | None = None  # GitHub host URL\n    login: str | None = None  # User login name\n    statusMessage: str | None = None  # Human-readable status message\n\n    @staticmethod\n    def from_dict(obj: Any) -> GetAuthStatusResponse:\n        assert isinstance(obj, dict)\n        isAuthenticated = obj.get(\"isAuthenticated\")\n        if isAuthenticated is None:\n            raise ValueError(\"Missing required field 'isAuthenticated' in GetAuthStatusResponse\")\n        authType = obj.get(\"authType\")\n        host = obj.get(\"host\")\n        login = obj.get(\"login\")\n        statusMessage = obj.get(\"statusMessage\")\n        return GetAuthStatusResponse(\n            isAuthenticated=bool(isAuthenticated),\n            authType=authType,\n            host=host,\n            login=login,\n            statusMessage=statusMessage,\n        )\n\n    def to_dict(self) -> dict:\n        result: dict = {}\n        result[\"isAuthenticated\"] = self.isAuthenticated\n        if self.authType is not None:\n            result[\"authType\"] = self.authType\n        if self.host is not None:","sourceCodeStart":914,"sourceCodeEnd":950,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/python/copilot/client.py#L914-L950","documentation":"GetAuthStatusResponse.from_dict requires the 'isAuthenticated' key in the auth-status payload and raises ValueError when it is absent or None. Optional fields (authType, host, login, statusMessage) are tolerated, but the boolean auth flag is mandatory for decoding.","triggerScenarios":"Server/proxy returns auth status without 'isAuthenticated'; a payload uses a different key like 'authenticated' or nests it under 'status'; mocks omit the field.","commonSituations":"Custom auth middleware reshaping the response; older server builds with a different auth-status schema; hand-written test fixtures; key-casing mismatches after JSON transformations.","solutions":["Ensure the payload contains 'isAuthenticated' (camelCase) before calling from_dict","Remap alternate key names in an adapter, e.g. obj.setdefault('isAuthenticated', obj.get('authenticated'))","Upgrade/align the server so the auth-status schema matches the client's expectations","Fix test fixtures to include isAuthenticated"],"exampleFix":"// before\nresp = GetAuthStatusResponse.from_dict({\"authType\": \"oauth\"})\n// after\npayload = {\"authType\": \"oauth\", \"isAuthenticated\": False}\nresp = GetAuthStatusResponse.from_dict(payload)","handlingStrategy":"type-guard","validationCode":"def has_auth_flag(obj) -> bool:\n    return isinstance(obj, dict) and obj.get(\"isAuthenticated\") is not None","typeGuard":"def is_auth_status_payload(obj: object) -> bool:\n    return isinstance(obj, dict) and \"isAuthenticated\" in obj","tryCatchPattern":"try:\n    auth = GetAuthStatusResponse.from_dict(payload)\nexcept ValueError as e:\n    if \"Missing required field 'isAuthenticated'\" in str(e):\n        payload.setdefault(\"isAuthenticated\", payload.get(\"authenticated\", False))\n        auth = GetAuthStatusResponse.from_dict(payload)\n    else:\n        raise","preventionTips":["Watch for snake_case/camelCase key renames in middleware","Keep auth-status fixtures in sync with the server schema","Treat optional fields (authType, host, login) as such; only rely on isAuthenticated"],"tags":["python","deserialization","auth","schema"],"backgroundTag":"missing-required-argument","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}