Add an operation to override current task context (#2431)

- Added an operation to override current task context
- Added a test to check that cache stays the same
This commit is contained in:
Ahmed Ibrahim
2025-08-18 12:59:19 -07:00
committed by GitHub
parent c9963b52e9
commit c283f9f6ce
4 changed files with 263 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ use crate::error::CodexErr;
use crate::error::Result;
use crate::error::UsageLimitReachedError;
use crate::flags::CODEX_RS_SSE_FIXTURE;
use crate::model_family::ModelFamily;
use crate::model_provider_info::ModelProviderInfo;
use crate::model_provider_info::WireApi;
use crate::models::ResponseItem;
@@ -311,6 +312,30 @@ impl ModelClient {
pub fn get_provider(&self) -> ModelProviderInfo {
self.provider.clone()
}
/// Returns the currently configured model slug.
pub fn get_model(&self) -> String {
self.config.model.clone()
}
/// Returns the currently configured model family.
pub fn get_model_family(&self) -> ModelFamily {
self.config.model_family.clone()
}
/// Returns the current reasoning effort setting.
pub fn get_reasoning_effort(&self) -> ReasoningEffortConfig {
self.effort
}
/// Returns the current reasoning summary setting.
pub fn get_reasoning_summary(&self) -> ReasoningSummaryConfig {
self.summary
}
pub fn get_auth(&self) -> Option<CodexAuth> {
self.auth.clone()
}
}
#[derive(Debug, Deserialize, Serialize)]