block / block/berd

OpenRouter models never appear in model picker (supported-models ACP endpoint returns empty list)

Open
#304 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
909
Forks
116
Avg merge
1d 1h
Merged PRs (30d)
156

Description

### Before filing

- [x] I searched open and closed issues for duplicates.
- [x] I reproduced this on the latest release.
- [x] This is one bug, not several bundled together.

### Closest existing issue

#154 (closed, fixed in #163). While #154 addressed preventing an empty refresh from wiping existing cache entries, it did not address why OpenRouter returns an empty list in the first place.

### What's broken

Models for the OpenRouter provider never appear in Berd's model picker, even when OpenRouter is configured with a valid API key and active in Goose.

Berd populates the model picker via `fetchProviderSupportedModels` (`src/features/providers/stores/providerModelCacheStore.ts`), calling the backend ACP method `_goose/unstable/providers/supported-models/list` (`GooseUnstableProvidersSupportedModelsList`). In `goosed` (`crates/goose/src/acp/server/providers.rs`), this ACP call delegates to `provider.fetch_supported_models()`.

However, in `aaif-goose/goose`:
- `crates/goose-provider-types/src/base.rs` provides a default implementation for `fetch_supported_models` that returns `Ok(vec![])`.
- `crates/goose-providers/src/openrouter.rs` implements `fetch_recommended_models` (which calls OpenRouter's `/api/v1/models` and filters for tool support), but **does not implement `fetch_supported_models`**.

As a result, `_goose/unstable/providers/supported-models/list` for `openrouter` always returns `{"models": []}`. Because no models are ever returned, the model picker remains completely empty for OpenRouter.

### Steps to reproduce

1. Launch Berd.
2. Configure OpenRouter as the provider for Goose with a valid API key and a model (e.g. `google/gemini-3.8-flash` or `anthropic/claude-sonnet-4.5`).
3. Open a chat and verify that Goose functions with OpenRouter.
4. Open the model picker for Goose in Berd.
5. Search or browse for OpenRouter models.

### What you expected to happen

OpenRouter models supported by Goose (or returned by OpenRouter) appear in the model picker.

### What actually happened

Zero OpenRouter models are listed in the picker. Inspecting `localStorage` (`goose:providerModelCache:v1`) confirms `openrouter` has an empty models array: `{"providerId":"openrouter","models":[],"fetchedAt":...}`. Direct ACP queries to `_goose/unstable/providers/supported-models/list` with `{"providerId": "openrouter"}` also return `{"models": []}`.

### How often does it happen?

Every time — reliably reproducible

### Berd version

0.6.2 (and verified upstream code against latest 0.6.3 / main)

### Operating system

macOS (Apple Silicon)

### Model and provider

Goose agent, OpenRouter provider (e.g. `google/gemini-3.8-flash` or any OpenRouter model)

### Relevant log output

Direct query to bundled `goosed` via ACP:
```json
Request:
{"jsonrpc":"2.0","id":1,"method":"_goose/unstable/providers/supported-models/list","params":{"providerId":"openrouter"}}

Response:
{"jsonrpc":"2.0","id":1,"result":{"models":[],"providerId":"openrouter"}}
```

Local storage cache entry in Berd's WebKit database (`localstorage.sqlite3`):
```json
{"providerId":"openrouter","models":[],"fetchedAt":1788805485945}
```

### Screenshots, recordings, or other context

Upstream code pointers in `aaif-goose/goose`:
1. `crates/goose-providers/src/openrouter.rs`: implements `fetch_recommended_models` using OpenRouter `/api/v1/models`, but does not implement `fetch_supported_models`.
2. `crates/goose-provider-types/src/base.rs`:
```rust
async fn fetch_supported_models(&self) -> Result, ProviderError> {
Ok(vec![])
}
```
3. `crates/goose/src/acp/server/providers.rs`:
```rust
pub(super) async fn on_list_provider_supported_models(
&self,
req: ProviderSupportedModelsListRequest,
) -> Result {
let provider = self
.create_provider(&req.provider_id, Vec::new(), None, true)
.await
.internal_err_ctx("Failed to initialize provider")?;
let models = match provider.fetch_supported_models().await {
...
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the empty response with the `_goose/unstable/providers/supported-models/list` ACP request. Read `src/features/providers/stores/providerModelCacheStore.ts`, `crates/goose-providers/src/openrouter.rs`, `crates/goose-provider-types/src/base.rs`, and `crates/goose/src/acp/server/providers.rs` to trace the model flow. Done means OpenRouter models returned by the endpoint appear in Berd’s model picker.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
api, backend, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.