Skip to content

Requesty fetchModel() does not send the API key, so authenticated catalogs fail #2030

Open

Description

@edelauna

Problem

RequestyHandler.fetchModel() calls getModels without the configured API key.

src/api/providers/requesty.ts:98:

this.models = await getModels({ provider: providerIdentifiers.requesty, baseUrl: this.baseURL }, this)

fetchModels then passes options.apiKey as undefined to getRequestyModels. The Requesty models endpoint needs the key for per-account catalogs.

Effects

  1. A user with a per-account catalog can get a failed or partial list. getModel() then falls back to requestyDefaultModelInfo, so model metadata is wrong.
  2. Requesty is key-scoped. Without the key, the cache key has no key discriminator. Two accounts on the same URL share one cache entry.
  3. The webview path (requestRouterModels) does pass the key. It writes under a different cache key from the one fetchModel() reads.

Scope

This is not a regression. The same code is in ecab519857. PR #1906 only moved where the cache scope is declared.

Proposed fix

Pass the key in fetchModel():

getModels({ provider: providerIdentifiers.requesty, baseUrl: this.baseURL, apiKey: this.options.requestyApiKey }, this)

Check that getModel() and any getModelsFromCache call use the same options, so the read key matches the write key.

Tests

  1. Add a requesty.spec.ts case. fetchModel() calls getModels with apiKey set to the configured key.
  2. Add a case with two keys on one URL. The two keys must produce two cache entries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions