aaif-goose / aaif-goose/goose

Make provider model metadata (context limits, reasoning) live-first instead of build-time-catalog-only

Ouverte
#11,558 2 commentaires 0 réactions 1 personne assignée Assignée à @jamadeo Voir sur GitHub
Langage dominant
Rust
Étoiles
54.2k
Forks
6.2k
Merge moyen
3 j 4 h
PR mergées (30 j)
240

Description

### Describe the improvement

Goose's model metadata (context window, max output tokens, reasoning support) currently comes from a build-time snapshot of models.dev, refreshed only when goose is released. For OpenRouter specifically, `/api/v1/models` already exposes `context_length`, `top_provider.max_completion_tokens`, and reasoning support via `supported_parameters` at runtime — but the inventory refresh keeps only model IDs, so any model missing from the bundled catalog falls back to a hardcoded 128k context limit and never shows a thinking control.

This tracking issue covers making provider model metadata **live-first**: fetch it from the provider when available, store it in the inventory cache, and treat the build-time catalog as a per-field fallback rather than the source of truth.

### Why is this needed?

Day-zero model releases (stealth/private/org-aliased models) are common on OpenRouter. Today those sessions silently run with wrong compaction thresholds and no reasoning support until a new goose release ships an updated catalog.

### Scope / related work

- [x] Initial implementation: #11531 (OpenRouter live metadata → inventory → session config + canonical-info endpoint)
- [ ] Extend metadata fetching to other providers with rich models APIs
- [ ] Mid-session convergence after a manual inventory refresh (currently applies at session prep and model switch)
- [ ] Decide on provenance tracking for `ModelConfig` fields so explicit user overrides vs catalog-derived defaults can be distinguished structurally instead of by value comparison

### Additional context

Other OpenRouter-related changes in flight may touch `crates/goose/src/providers/openrouter.rs` and the inventory refresh path (`providers/inventory/`) — coordinating here to avoid collisions.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par lire le PR d’implémentation initiale #11531 afin de comprendre les changements apportés à `crates/goose/src/providers/openrouter.rs` et au chemin de mise à jour de l’inventaire (`providers/inventory/`). Examinez comment les métadonnées des modèles sont actuellement récupérées depuis `/api/v1/models` et mises en cache. L’objectif est d’étendre cette approche live-first à d’autres fournisseurs, de garantir que les mises à jour en cours de session fonctionnent et de suivre la provenance des champs. L’exécution des tests existants pour les modules d’inventaire et de fournisseurs aidera à vérifier les changements.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust
Domaine
ai-infra-agents, backend-api-design
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.