mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Interrupt cyber model turns after one Guardian denial (#37190)
## What changed - Add a Guardian circuit-breaker policy for models whose catalog specialty is `cyber`. - Interrupt those models after the first Guardian denial while retaining the existing denial thresholds for other models. - Centralize the `cyber` model-specialty identifier for use across core, protocol, app-server, and TUI code. ## Testing - Cover the cyber-specific threshold in the circuit-breaker unit tests. - Verify end to end that a denied command is not executed and the turn is interrupted after one denial. GitOrigin-RevId: fad24c9e7aa280432580db1f0e39d13535779710
This commit is contained in:
1 parent
92b83e226d
commit
f141dc77f0
9 files changed
+200
-23
No files matched your search
@@ -15,6 +15,7 @@ use codex_protocol::ThreadId;
|
||||
use codex_protocol::config_types::ModeKind;
|
||||
use codex_protocol::models::BUILT_IN_PERMISSION_PROFILE_WORKSPACE;
|
||||
use codex_protocol::models::PermissionProfile;
|
||||
use codex_protocol::openai_models::MODEL_SPECIALTY_CYBER;
|
||||
|
||||
impl App {
|
||||
pub(super) async fn sync_active_thread_model_setting(
|
||||
@@ -50,7 +51,8 @@ impl App {
|
||||
let thread_id = self.active_thread_id?;
|
||||
let is_cyber_model = self.model_catalog.try_list_models().is_ok_and(|models| {
|
||||
models.iter().any(|preset| {
|
||||
preset.model == model && preset.model_specialty.as_deref() == Some("cyber")
|
||||
preset.model == model
|
||||
&& preset.model_specialty.as_deref() == Some(MODEL_SPECIALTY_CYBER)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user