refactor(acp): remove unused provider list fields (#11696)
This commit is contained in:
@@ -41,9 +41,6 @@ pub struct ProviderMetadata {
|
||||
/// step-by-step instructions for set up providers eg: api key
|
||||
#[serde(default)]
|
||||
pub setup_steps: Vec<String>,
|
||||
/// Hint shown in the model picker when this provider manages its own model selection.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub model_selection_hint: Option<String>,
|
||||
/// The name of a fast/cheap model to use for lightweight tasks (e.g. session naming,
|
||||
/// compaction). When set, fast-path callers prefer this model over the main model.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -83,7 +80,6 @@ impl ProviderMetadata {
|
||||
model_doc_link: model_doc_link.to_string(),
|
||||
config_keys,
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -108,7 +104,6 @@ impl ProviderMetadata {
|
||||
model_doc_link: model_doc_link.to_string(),
|
||||
config_keys,
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -125,7 +120,6 @@ impl ProviderMetadata {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -137,11 +131,6 @@ impl ProviderMetadata {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_model_selection_hint(mut self, hint: &str) -> Self {
|
||||
self.model_selection_hint = Some(hint.to_string());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_fast_model(mut self, fast_model: &str) -> Self {
|
||||
self.fast_model = Some(fast_model.to_string());
|
||||
self
|
||||
|
||||
@@ -1764,8 +1764,6 @@ pub struct ProviderInventoryEntryDto {
|
||||
pub available: bool,
|
||||
/// Provider classification such as `Preferred`, `Builtin`, `Declarative`, or `Custom`.
|
||||
pub provider_type: String,
|
||||
/// Whether this inventory entry represents an agent provider or a model provider.
|
||||
pub category: ProviderSetupCategoryDto,
|
||||
/// Whether this provider communicates through ACP.
|
||||
#[serde(default)]
|
||||
pub acp: bool,
|
||||
@@ -1797,9 +1795,6 @@ pub struct ProviderInventoryEntryDto {
|
||||
pub last_refresh_error: Option<String>,
|
||||
/// Whether we believe this data may be outdated.
|
||||
pub stale: bool,
|
||||
/// Guidance message shown when this provider manages its own model selection externally.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub model_selection_hint: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
|
||||
|
||||
@@ -1670,10 +1670,6 @@
|
||||
"type": "string",
|
||||
"description": "Provider classification such as `Preferred`, `Builtin`, `Declarative`, or `Custom`."
|
||||
},
|
||||
"category": {
|
||||
"$ref": "#/$defs/ProviderSetupCategoryDto",
|
||||
"description": "Whether this inventory entry represents an agent provider or a model provider."
|
||||
},
|
||||
"acp": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this provider communicates through ACP.",
|
||||
@@ -1747,13 +1743,6 @@
|
||||
"stale": {
|
||||
"type": "boolean",
|
||||
"description": "Whether we believe this data may be outdated."
|
||||
},
|
||||
"modelSelectionHint": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "Guidance message shown when this provider manages its own model selection externally."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1764,7 +1753,6 @@
|
||||
"configured",
|
||||
"available",
|
||||
"providerType",
|
||||
"category",
|
||||
"visibleInSetup",
|
||||
"deprecated",
|
||||
"configKeys",
|
||||
@@ -1776,13 +1764,6 @@
|
||||
],
|
||||
"description": "Provider inventory entry."
|
||||
},
|
||||
"ProviderSetupCategoryDto": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"agent",
|
||||
"model"
|
||||
]
|
||||
},
|
||||
"ProviderConfigKey": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -2072,6 +2053,13 @@
|
||||
"supportsAuthStatus"
|
||||
]
|
||||
},
|
||||
"ProviderSetupCategoryDto": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"agent",
|
||||
"model"
|
||||
]
|
||||
},
|
||||
"ProviderSetupMethodDto": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
||||
@@ -521,7 +521,6 @@ mod tests {
|
||||
configured: true,
|
||||
available: true,
|
||||
provider_type: crate::providers::base::ProviderType::Builtin,
|
||||
category: crate::providers::catalog::ProviderSetupCategory::Model,
|
||||
acp: false,
|
||||
visible_in_setup: true,
|
||||
deprecated: false,
|
||||
@@ -544,7 +543,6 @@ mod tests {
|
||||
last_updated_at: None,
|
||||
last_refresh_attempt_at: None,
|
||||
last_refresh_error: None,
|
||||
model_selection_hint: None,
|
||||
};
|
||||
build_model_state("unused", &inventory)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ fn inventory_entry_to_dto(entry: ProviderInventoryEntry) -> ProviderInventoryEnt
|
||||
configured: entry.configured,
|
||||
available: entry.available,
|
||||
provider_type: format!("{:?}", entry.provider_type),
|
||||
category: provider_setup_category_to_dto(entry.category),
|
||||
acp: entry.acp,
|
||||
visible_in_setup: entry.visible_in_setup,
|
||||
deprecated: entry.deprecated,
|
||||
@@ -76,7 +75,6 @@ fn inventory_entry_to_dto(entry: ProviderInventoryEntry) -> ProviderInventoryEnt
|
||||
last_refresh_attempt_at: entry.last_refresh_attempt_at.map(|t| t.to_rfc3339()),
|
||||
last_refresh_error: entry.last_refresh_error,
|
||||
stale,
|
||||
model_selection_hint: entry.model_selection_hint,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ impl goose_providers::base::ProviderDescriptor for AmpAcpProvider {
|
||||
.with_docs_url("https://ampcode.com")
|
||||
.with_capabilities(true, true, true),
|
||||
)
|
||||
.with_model_selection_hint("Use the Amp CLI to configure models")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ pub use resolver::{
|
||||
|
||||
use super::base::{ConfigKey, ModelInfo, Provider, ProviderType};
|
||||
use super::canonical::{map_provider_name, map_to_canonical_model, CanonicalModelRegistry};
|
||||
use super::catalog::ProviderSetupCategory;
|
||||
use crate::config::declarative_providers::{DeclarativeProviderConfig, ProviderEngine};
|
||||
use crate::config::Config;
|
||||
use crate::session::session_manager::SessionStorage;
|
||||
@@ -36,7 +35,6 @@ pub struct ProviderInventoryEntry {
|
||||
pub configured: bool,
|
||||
pub available: bool,
|
||||
pub provider_type: ProviderType,
|
||||
pub category: ProviderSetupCategory,
|
||||
pub acp: bool,
|
||||
pub visible_in_setup: bool,
|
||||
pub deprecated: bool,
|
||||
@@ -49,7 +47,6 @@ pub struct ProviderInventoryEntry {
|
||||
pub last_updated_at: Option<DateTime<Utc>>,
|
||||
pub last_refresh_attempt_at: Option<DateTime<Utc>>,
|
||||
pub last_refresh_error: Option<String>,
|
||||
pub model_selection_hint: Option<String>,
|
||||
}
|
||||
|
||||
/// Families whose latest model should be surfaced in the compact picker.
|
||||
@@ -267,7 +264,6 @@ struct ProviderDescriptor {
|
||||
configured: bool,
|
||||
available: bool,
|
||||
provider_type: ProviderType,
|
||||
category: ProviderSetupCategory,
|
||||
acp: bool,
|
||||
visible_in_setup: bool,
|
||||
deprecated: bool,
|
||||
@@ -276,7 +272,6 @@ struct ProviderDescriptor {
|
||||
setup_steps: Vec<String>,
|
||||
supports_refresh: bool,
|
||||
static_models: Vec<ModelInfo>,
|
||||
model_selection_hint: Option<String>,
|
||||
}
|
||||
|
||||
impl ProviderInventoryService {
|
||||
@@ -315,7 +310,6 @@ impl ProviderInventoryService {
|
||||
configured: descriptor.configured,
|
||||
available: descriptor.available,
|
||||
provider_type: descriptor.provider_type,
|
||||
category: descriptor.category,
|
||||
acp: descriptor.acp,
|
||||
visible_in_setup: descriptor.visible_in_setup,
|
||||
deprecated: descriptor.deprecated,
|
||||
@@ -332,7 +326,6 @@ impl ProviderInventoryService {
|
||||
.as_ref()
|
||||
.and_then(|snapshot| snapshot.last_refresh_attempt_at),
|
||||
last_refresh_error: snapshot.and_then(|snapshot| snapshot.last_refresh_error),
|
||||
model_selection_hint: descriptor.model_selection_hint,
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -738,11 +731,6 @@ impl ProviderInventoryService {
|
||||
},
|
||||
available: entry.inventory_configured(),
|
||||
provider_type: entry.provider_type(),
|
||||
category: metadata
|
||||
.setup
|
||||
.as_ref()
|
||||
.map(|setup| setup.category)
|
||||
.unwrap_or(ProviderSetupCategory::Model),
|
||||
acp: metadata.setup.as_ref().is_some_and(|setup| setup.acp),
|
||||
visible_in_setup: metadata.deprecated.is_none(),
|
||||
deprecated: metadata.deprecated.is_some(),
|
||||
@@ -754,7 +742,6 @@ impl ProviderInventoryService {
|
||||
setup_steps: metadata.setup_steps.clone(),
|
||||
supports_refresh: entry.supports_inventory_refresh(),
|
||||
static_models: metadata.known_models,
|
||||
model_selection_hint: metadata.model_selection_hint,
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ impl goose_providers::base::ProviderDescriptor for PiAcpProvider {
|
||||
.with_docs_url("https://github.com/badlogic/pi-mono")
|
||||
.show_only_when_installed(),
|
||||
)
|
||||
.with_model_selection_hint("Use the Pi CLI to configure models")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,6 @@ impl ProviderRegistry {
|
||||
.unwrap_or(base_metadata.model_doc_link),
|
||||
config_keys,
|
||||
setup_steps: config.setup_steps.clone(),
|
||||
model_selection_hint: None,
|
||||
fast_model: config.fast_model.clone(),
|
||||
setup: config.setup.clone(),
|
||||
deprecated: None,
|
||||
|
||||
@@ -539,7 +539,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -713,7 +712,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -896,7 +894,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -1257,7 +1254,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -1537,7 +1533,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -1740,7 +1735,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -1893,7 +1887,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -2254,7 +2247,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -3205,7 +3197,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
@@ -3294,7 +3285,6 @@ mod tests {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
|
||||
@@ -198,7 +198,6 @@ impl goose::providers::base::ProviderDescriptor for MockCompactionProvider {
|
||||
model_doc_link: "".to_string(),
|
||||
config_keys: vec![],
|
||||
setup_steps: vec![],
|
||||
model_selection_hint: None,
|
||||
fast_model: None,
|
||||
setup: None,
|
||||
deprecated: None,
|
||||
|
||||
@@ -165,15 +165,14 @@ describe('ACP providers', () => {
|
||||
expect((await acpGetProviderDetails('claude-code')).replacement).toBe('claude-acp');
|
||||
});
|
||||
|
||||
it('uses the explicit ACP capability instead of category or provider id', async () => {
|
||||
it('uses the explicit ACP capability instead of provider id', async () => {
|
||||
const custom = providerEntry({
|
||||
providerId: 'custom_example-acp',
|
||||
providerType: 'Custom',
|
||||
category: 'model',
|
||||
acp: false,
|
||||
});
|
||||
const agent = providerEntry({ providerId: 'cursor-agent', category: 'agent', acp: false });
|
||||
const acp = providerEntry({ providerId: 'pi-acp', category: 'agent', acp: true });
|
||||
const agent = providerEntry({ providerId: 'cursor-agent', acp: false });
|
||||
const acp = providerEntry({ providerId: 'pi-acp', acp: true });
|
||||
const client = {
|
||||
goose: {
|
||||
providersList_unstable: vi.fn().mockResolvedValue({ entries: [custom, agent, acp] }),
|
||||
@@ -338,7 +337,6 @@ function providerEntry(overrides: Record<string, unknown> = {}) {
|
||||
configured: true,
|
||||
available: true,
|
||||
providerType: 'Builtin',
|
||||
category: 'agent',
|
||||
acp: true,
|
||||
visibleInSetup: true,
|
||||
deprecated: false,
|
||||
|
||||
@@ -51,7 +51,6 @@ function providerEntryToDetails(entry: ProviderInventoryEntryDto): ProviderDetai
|
||||
deprecated: entry.deprecated,
|
||||
replacement: entry.replacement ?? null,
|
||||
provider_type: entry.providerType as ProviderDetails['provider_type'],
|
||||
setup_category: entry.category,
|
||||
uses_acp: entry.acp ?? false,
|
||||
metadata: {
|
||||
name: entry.providerId,
|
||||
@@ -59,7 +58,6 @@ function providerEntryToDetails(entry: ProviderInventoryEntryDto): ProviderDetai
|
||||
description: entry.description,
|
||||
default_model: entry.defaultModel,
|
||||
model_doc_link: '',
|
||||
model_selection_hint: entry.modelSelectionHint ?? null,
|
||||
config_keys: entry.configKeys.map((key) => ({
|
||||
name: key.name,
|
||||
required: key.required,
|
||||
|
||||
@@ -31,7 +31,6 @@ const oauthProvider: ProviderDetails = {
|
||||
visible_in_setup: true,
|
||||
deprecated: false,
|
||||
provider_type: 'Builtin',
|
||||
setup_category: 'model',
|
||||
uses_acp: false,
|
||||
metadata: {
|
||||
name: 'github_copilot',
|
||||
@@ -65,7 +64,6 @@ describe('ProviderConfigurationModal', () => {
|
||||
const acpProvider: ProviderDetails = {
|
||||
...oauthProvider,
|
||||
name: 'claude-acp',
|
||||
setup_category: 'agent',
|
||||
uses_acp: true,
|
||||
metadata: {
|
||||
...oauthProvider.metadata,
|
||||
@@ -122,7 +120,6 @@ describe('ProviderConfigurationModal', () => {
|
||||
...oauthProvider,
|
||||
name: 'codex-acp',
|
||||
is_configured: false,
|
||||
setup_category: 'agent',
|
||||
uses_acp: true,
|
||||
metadata: {
|
||||
...oauthProvider.metadata,
|
||||
|
||||
@@ -31,7 +31,6 @@ export type ProviderMetadata = {
|
||||
fast_model?: string | null;
|
||||
known_models: ModelInfo[];
|
||||
model_doc_link: string;
|
||||
model_selection_hint?: string | null;
|
||||
name: string;
|
||||
setup_steps?: string[];
|
||||
};
|
||||
@@ -48,7 +47,6 @@ export type ProviderDetails = {
|
||||
metadata: ProviderMetadata;
|
||||
name: string;
|
||||
provider_type: ProviderType;
|
||||
setup_category: 'agent' | 'model';
|
||||
uses_acp: boolean;
|
||||
saved_model?: string | null;
|
||||
};
|
||||
|
||||
@@ -837,10 +837,6 @@ export type ProviderInventoryEntryDto = {
|
||||
* Provider classification such as `Preferred`, `Builtin`, `Declarative`, or `Custom`.
|
||||
*/
|
||||
providerType: string;
|
||||
/**
|
||||
* Whether this inventory entry represents an agent provider or a model provider.
|
||||
*/
|
||||
category: ProviderSetupCategoryDto;
|
||||
/**
|
||||
* Whether this provider communicates through ACP.
|
||||
*/
|
||||
@@ -893,14 +889,8 @@ export type ProviderInventoryEntryDto = {
|
||||
* Whether we believe this data may be outdated.
|
||||
*/
|
||||
stale: boolean;
|
||||
/**
|
||||
* Guidance message shown when this provider manages its own model selection externally.
|
||||
*/
|
||||
modelSelectionHint?: string | null;
|
||||
};
|
||||
|
||||
export type ProviderSetupCategoryDto = 'agent' | 'model';
|
||||
|
||||
export type ProviderConfigKey = {
|
||||
name: string;
|
||||
required: boolean;
|
||||
@@ -1007,6 +997,8 @@ export type ProviderSetupCatalogEntryDto = {
|
||||
supportsAuthStatus: boolean;
|
||||
};
|
||||
|
||||
export type ProviderSetupCategoryDto = 'agent' | 'model';
|
||||
|
||||
export type ProviderSetupMethodDto = 'none' | 'single_api_key' | 'config_fields' | 'host_with_oauth_fallback' | 'oauth_browser' | 'oauth_device_code' | 'cloud_credentials' | 'local' | 'cli_auth';
|
||||
|
||||
export type ProviderSetupFieldDto = {
|
||||
|
||||
@@ -536,8 +536,6 @@ export const zListProvidersRequest_unstable = z.object({
|
||||
providerIds: z.array(z.string()).optional().default([])
|
||||
});
|
||||
|
||||
export const zProviderSetupCategoryDto = z.enum(['agent', 'model']);
|
||||
|
||||
export const zProviderConfigKey = z.object({
|
||||
name: z.string(),
|
||||
required: z.boolean(),
|
||||
@@ -571,7 +569,6 @@ export const zProviderInventoryEntryDto = z.object({
|
||||
configured: z.boolean(),
|
||||
available: z.boolean(),
|
||||
providerType: z.string(),
|
||||
category: zProviderSetupCategoryDto,
|
||||
acp: z.boolean().optional().default(false),
|
||||
visibleInSetup: z.boolean(),
|
||||
deprecated: z.boolean(),
|
||||
@@ -584,8 +581,7 @@ export const zProviderInventoryEntryDto = z.object({
|
||||
lastUpdatedAt: z.string().nullish(),
|
||||
lastRefreshAttemptAt: z.string().nullish(),
|
||||
lastRefreshError: z.string().nullish(),
|
||||
stale: z.boolean(),
|
||||
modelSelectionHint: z.string().nullish()
|
||||
stale: z.boolean()
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -633,6 +629,8 @@ export const zProviderCatalogListResponse_unstable = z.object({
|
||||
*/
|
||||
export const zProviderSetupCatalogListRequest_unstable = z.record(z.string(), z.unknown());
|
||||
|
||||
export const zProviderSetupCategoryDto = z.enum(['agent', 'model']);
|
||||
|
||||
export const zProviderSetupMethodDto = z.enum([
|
||||
'none',
|
||||
'single_api_key',
|
||||
|
||||
Reference in New Issue
Block a user