mirror of
https://github.com/openai/codex.git
synced 2026-11-22 15:15:18 +00:00
Trust undecided local projects automatically (#36935)
## What changed - Replace the TUI directory-trust prompt with automatic trust for local projects whose trust level is unset. Keep explicit trust settings and remote workspaces unchanged. - Persist trust for the resolved Git or configured project root, then reload configuration so project-local settings take effect. - Fall back to an in-memory trust override and an embedded app server when the config update cannot be persisted. ## Testing - Cover persisted and in-memory trust, custom project-root markers, and the working directories selected by resume and fork flows. GitOrigin-RevId: 8fd51eb4cd88267073324bfd7dc4106a56d7c745
This commit is contained in:
1 parent
90314a9207
commit
1e59dc5bda
12 files changed
+388
-690
No files matched your search
@@ -1478,7 +1478,8 @@ impl ConfigBuilder {
|
||||
vec![lock_layer],
|
||||
config_layer_stack.requirements().clone(),
|
||||
config_layer_stack.requirements_toml().clone(),
|
||||
)?;
|
||||
)?
|
||||
.with_project_root(config_layer_stack.project_root().cloned());
|
||||
let mut config = Config::load_config_with_layer_stack(
|
||||
LOCAL_FS.as_ref(),
|
||||
lock_config_toml,
|
||||
@@ -1788,6 +1789,7 @@ impl Config {
|
||||
.requirements_toml()
|
||||
.clone(),
|
||||
)?
|
||||
.with_project_root(refreshed_config.config_layer_stack.project_root().cloned())
|
||||
.with_user_and_project_exec_policy_rules_ignored(
|
||||
refreshed_config
|
||||
.config_layer_stack
|
||||
@@ -3325,12 +3327,21 @@ impl Config {
|
||||
.into_iter()
|
||||
.map(|path| AbsolutePathBuf::resolve_path_against_base(path, resolved_cwd.as_path()))
|
||||
.collect();
|
||||
let project_root = config_layer_stack
|
||||
.project_root()
|
||||
.cloned()
|
||||
.unwrap_or_else(|| resolved_cwd.clone());
|
||||
let repo_root = resolve_root_git_project_for_trust(fs, &resolved_cwd).await;
|
||||
let active_project = cfg
|
||||
.get_active_project(
|
||||
resolved_cwd.as_path(),
|
||||
repo_root.as_ref().map(AbsolutePathBuf::as_path),
|
||||
Some(project_root.as_path()),
|
||||
)
|
||||
.or_else(|| {
|
||||
repo_root.as_ref().and_then(|repo_root| {
|
||||
cfg.get_active_project(repo_root.as_path(), /*repo_root*/ None)
|
||||
})
|
||||
})
|
||||
.unwrap_or(ProjectConfig { trust_level: None });
|
||||
let permission_config_syntax = resolve_permission_config_syntax(
|
||||
&config_layer_stack,
|
||||
|
||||
Reference in new issue
Block a user