mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
Restrict agent roles to bounded configuration overrides (#39299)
## Why Agent roles should customize a child agent without expanding the authority or changing the provider configuration inherited from its parent session. ## What changed - Apply only supported role overrides for model behavior, developer instructions, personality, service tier, and capability reductions. - Preserve parent-owned permissions, model providers, endpoints, MCP servers, notifications, and other unrestricted configuration. - Keep managed feature requirements effective when a role disables capabilities, and reject symlinked user role files. - Use the same bounded role application path for both multi-agent implementations and resumed agents. ## Testing Add coverage for authority preservation, managed feature requirements, symlink rejection, provider inheritance, and provider routing after resume. GitOrigin-RevId: c528d615b691f9c02bfbc21154d514ea07743010
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use super::residency::is_v2_resident_session_source;
|
||||
use super::*;
|
||||
use crate::agent::role::apply_role_to_config_for_multi_agent_v2;
|
||||
use crate::agent::role::apply_role_to_config;
|
||||
use crate::config::PermissionProfileSnapshot;
|
||||
use crate::context::ContextualUserFragment;
|
||||
use crate::context::CurrentTimeReminder;
|
||||
@@ -310,7 +310,7 @@ impl AgentControl {
|
||||
),
|
||||
};
|
||||
|
||||
apply_role_to_config_for_multi_agent_v2(&mut config, Some(&role_name))
|
||||
apply_role_to_config(&mut config, Some(&role_name))
|
||||
.await
|
||||
.map_err(CodexErr::InvalidRequest)?;
|
||||
config
|
||||
|
||||
Reference in New Issue
Block a user