Running ‘testthat.R’ [4s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(rlang)
  > library(GitAI)
  > 
  > test_check("GitAI")
  Saving _problems/test-process_repos-13.R
  Saving _problems/test-set_llm-36.R
  Saving _problems/test-set_llm-61.R
  Saving _problems/test-set_llm-89.R
  Saving _problems/test-set_llm-107.R
  [ FAIL 5 | WARN 0 | SKIP 5 | PASS 38 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • OPENAI_API_KEY env var is not configured (2): 'test-process_content.R:7:3',
    'test-set_llm.R:22:3'
  • On CRAN (3): 'test-add_files.R:20:1', 'test-process_content.R:16:3',
    'test-set_repos.R:2:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-process_repos.R:5:3'): process_repos() returns results with repo metadata ──
  Error: x No sufficient token found among: [GITHUB_PAT].
  i Check if you have correct token.
  ! Scope that is needed: [public_repo, read:org, read:user].
  Backtrace:
       ▆
    1. ├─GitAI::set_prompt(...) at test-process_repos.R:5:3
    2. ├─GitAI::set_llm(...)
    3. ├─GitAI::add_files(...)
    4. └─GitAI::set_github_repos(...)
    5.   └─GitStats::set_github_host(gitstats, ..., verbose = verbose)
    6.     └─gitstats$set_github_host(...)
    7.       └─GitHostGitHub$new(...)
    8.         └─GitStats (local) initialize(...)
    9.           └─super$initialize(...)
   10.             └─private$set_token(token = token, verbose = verbose)
   11.               └─private$set_default_token(verbose = verbose)
   12.                 └─cli::cli_abort(...)
   13.                   └─rlang::abort(...)
  ── Error ('test-set_llm.R:36:3'): setting LLM with default provider  ───────────
  Error in `(structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), name = "ProviderOpenAI", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), name = "ProviderOpenAICompatible", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, name = "Provider", parent = structure(function ()  {     .Call(S7_object_) }, name = "S7_object", properties = list(), abstract = FALSE, constructor = function ()  {     .Call(S7_object_) }, validator = function (self)  {     if (!is_S7_type(self)) {         "Underlying data is corrupt"     } }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), service_tier = structure(list(name = "service_tier", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), class = c("S7_class", "S7_object")))(name = "mock", base_url = "https://api.mocked.com/v1", model = "gpt-4o-mini", params = list(seed = 1014), extra_args = list(), api_key = "mocked_key")`: unused argument (api_key = "mocked_key")
  Backtrace:
      ▆
   1. └─GitAI::set_llm(my_project) at test-set_llm.R:36:3
   2.   ├─rlang::exec(provider_method, !!!provider_args)
   3.   └─GitAI (local) `<fn>`(model = "gpt-4o-mini", params = NULL, echo = "none")
   4.     └─GitAI:::mock_chat_method(...) at ./setup.R:50:3
   5.       └─rlang::exec(provider_class, name = "mock", !!!provider_args) at ./setup.R:24:3
  ── Error ('test-set_llm.R:60:3'): setting arguments for selected provider  ─────
  Error in `(structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), name = "ProviderOpenAI", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), name = "ProviderOpenAICompatible", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, name = "Provider", parent = structure(function ()  {     .Call(S7_object_) }, name = "S7_object", properties = list(), abstract = FALSE, constructor = function ()  {     .Call(S7_object_) }, validator = function (self)  {     if (!is_S7_type(self)) {         "Underlying data is corrupt"     } }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), service_tier = structure(list(name = "service_tier", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), class = c("S7_class", "S7_object")))(name = "mock", base_url = "https://api.mocked.com/v1", model = "model_mocked", params = list(seed = 1014), extra_args = list(), api_key = "mocked_key")`: unused argument (api_key = "mocked_key")
  Backtrace:
      ▆
   1. └─GitAI::set_llm(my_project, provider = "openai", model = "model_mocked") at test-set_llm.R:60:3
   2.   ├─rlang::exec(provider_method, !!!provider_args)
   3.   └─GitAI (local) `<fn>`(model = "model_mocked", params = NULL, echo = "none")
   4.     └─GitAI:::mock_chat_method(...) at ./setup.R:50:3
   5.       └─rlang::exec(provider_class, name = "mock", !!!provider_args) at ./setup.R:24:3
  ── Error ('test-set_llm.R:89:3'): setting LLM without system prompt ────────────
  Error in `(structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), name = "ProviderOpenAI", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), name = "ProviderOpenAICompatible", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, name = "Provider", parent = structure(function ()  {     .Call(S7_object_) }, name = "S7_object", properties = list(), abstract = FALSE, constructor = function ()  {     .Call(S7_object_) }, validator = function (self)  {     if (!is_S7_type(self)) {         "Underlying data is corrupt"     } }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), service_tier = structure(list(name = "service_tier", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), class = c("S7_class", "S7_object")))(name = "mock", base_url = "https://api.mocked.com/v1", model = "gpt-4o-mini", params = list(seed = 1014), extra_args = list(), api_key = "mocked_key")`: unused argument (api_key = "mocked_key")
  Backtrace:
      ▆
   1. └─GitAI::set_llm(initialize_project("gitai_test_project")) at test-set_llm.R:89:3
   2.   ├─rlang::exec(provider_method, !!!provider_args)
   3.   └─GitAI (local) `<fn>`(model = "gpt-4o-mini", params = NULL, echo = "none")
   4.     └─GitAI:::mock_chat_method(...) at ./setup.R:50:3
   5.       └─rlang::exec(provider_class, name = "mock", !!!provider_args) at ./setup.R:24:3
  ── Error ('test-set_llm.R:105:3'): setting system prompt ───────────────────────
  Error in `(structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), name = "ProviderOpenAI", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), name = "ProviderOpenAICompatible", parent = structure(function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, name = "Provider", parent = structure(function ()  {     .Call(S7_object_) }, name = "S7_object", properties = list(), abstract = FALSE, constructor = function ()  {     .Call(S7_object_) }, validator = function (self)  {     if (!is_S7_type(self)) {         "Underlying data is corrupt"     } }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  {     name     model     base_url     params     extra_args     extra_headers     credentials     new_object(S7_object(), name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials) }, class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL)  new_object(Provider(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials)), class = c("S7_class", "S7_object")), package = "ellmer", properties = list(name = structure(list(name = "name", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), model = structure(list(name = "model", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), base_url = structure(list(name = "base_url", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = function (value)  {     if (allow_null && is.null(value)) {         return()     }     if (length(value) != 1) {         paste0("must be a single string, not ", obj_type_friendly(value), ".")     }     else if (!allow_na && is.na(value)) {         "must not be missing."     } }, default = stop("Required")), class = "S7_property"), params = structure(list(name = "params", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_args = structure(list(name = "extra_args", class = structure(list(class = "list", constructor_name = "list", constructor = function (.data = list())  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), extra_headers = structure(list(name = "extra_headers", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), credentials = structure(list(name = "credentials", class = structure(list(classes = list(structure(list(class = "function", constructor_name = "fun", constructor = function (.data = function() NULL)  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), NULL)), class = "S7_union"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property"), service_tier = structure(list(name = "service_tier", class = structure(list(class = "character", constructor_name = "character", constructor = function (.data = character(0))  .data, validator = function (object)  {     if (base_class(object) != name) {         sprintf("Underlying data must be <%s> not <%s>", name, base_class(object))     } }), class = "S7_base_class"), getter = NULL, setter = NULL, validator = NULL, default = NULL), class = "S7_property")), abstract = FALSE, constructor = function (name = stop("Required"), model = stop("Required"), base_url = stop("Required"), params = list(), extra_args = list(), extra_headers = character(0), credentials = function() NULL, service_tier = character(0))  new_object(ProviderOpenAICompatible(name = name, model = model, base_url = base_url, params = params, extra_args = extra_args, extra_headers = extra_headers, credentials = credentials), service_tier = service_tier), class = c("S7_class", "S7_object")))(name = "mock", base_url = "https://api.mocked.com/v1", model = "gpt-4o-mini", params = list(seed = 1014), extra_args = list(), api_key = "mocked_key")`: unused argument (api_key = "mocked_key")
  Backtrace:
      ▆
   1. ├─GitAI::set_prompt(set_llm(my_project), system_prompt = "You always return only 'Hi there!'") at test-set_llm.R:105:3
   2. └─GitAI::set_llm(my_project)
   3.   ├─rlang::exec(provider_method, !!!provider_args)
   4.   └─GitAI (local) `<fn>`(model = "gpt-4o-mini", params = NULL, echo = "none")
   5.     └─GitAI:::mock_chat_method(...) at ./setup.R:50:3
   6.       └─rlang::exec(provider_class, name = "mock", !!!provider_args) at ./setup.R:24:3
  
  [ FAIL 5 | WARN 0 | SKIP 5 | PASS 38 ]
  Error:
  ! Test failures.
  Execution halted