Enable runtime access to provider name (#5399)

This commit is contained in:
Will Pfleger
2025-10-28 14:21:24 -04:00
committed by GitHub
parent f1ad5490b6
commit 4d8c91efbd
25 changed files with 196 additions and 3 deletions
@@ -23,6 +23,8 @@ pub const CURSOR_AGENT_DOC_URL: &str = "https://docs.cursor.com/en/cli/overview"
pub struct CursorAgentProvider {
command: String,
model: ModelConfig,
#[serde(skip)]
name: String,
}
impl CursorAgentProvider {
@@ -41,6 +43,7 @@ impl CursorAgentProvider {
Ok(Self {
command: resolved_command,
model,
name: Self::metadata().name,
})
}
@@ -395,6 +398,10 @@ impl Provider for CursorAgentProvider {
)
}
fn get_name(&self) -> &str {
&self.name
}
fn get_model_config(&self) -> ModelConfig {
// Return the model config with appropriate context limit for Cursor models
self.model.clone()