Use AbsolutePathBuf in skill loading and codex_home (#17407)

Helps with FS migration later
This commit is contained in:
pakrym-oai
2026-04-13 10:26:51 -07:00
committed by GitHub
Unverified
parent d25a9822a7
commit ac82443d07
86 changed files with 850 additions and 625 deletions
+14 -14
View File
@@ -649,7 +649,7 @@ impl Codex {
network_sandbox_policy: config.permissions.network_sandbox_policy,
windows_sandbox_level: WindowsSandboxLevel::from_config(&config),
cwd: config.cwd.clone(),
codex_home: config.codex_home.clone(),
codex_home: config.codex_home.to_path_buf(),
thread_name: None,
original_config_do_not_use: Arc::clone(&config),
metrics_service_name,
@@ -1912,7 +1912,7 @@ impl Session {
tx
} else {
ShellSnapshot::start_snapshotting(
config.codex_home.clone(),
config.codex_home.to_path_buf(),
conversation_id,
session_configuration.cwd.to_path_buf(),
&mut default_shell,
@@ -2164,7 +2164,7 @@ impl Session {
INITIAL_SUBMIT_ID.to_owned(),
tx_event.clone(),
sandbox_state,
config.codex_home.clone(),
config.codex_home.to_path_buf(),
codex_apps_tools_cache_key(auth),
tool_plugin_provenance,
)
@@ -4516,7 +4516,7 @@ impl Session {
turn_context.sub_id.clone(),
self.get_tx_event(),
sandbox_state,
config.codex_home.clone(),
config.codex_home.to_path_buf(),
codex_apps_tools_cache_key(auth.as_ref()),
tool_plugin_provenance,
)
@@ -4884,7 +4884,6 @@ mod handlers {
use crate::codex::SessionSettingsUpdate;
use crate::codex::SteerInputError;
use crate::SkillError;
use crate::codex::spawn_review_thread;
use crate::config::Config;
use crate::config_loader::CloudRequirementsLoader;
@@ -4915,6 +4914,7 @@ mod handlers {
use codex_protocol::protocol::ReviewDecision;
use codex_protocol::protocol::ReviewRequest;
use codex_protocol::protocol::RolloutItem;
use codex_protocol::protocol::SkillErrorInfo;
use codex_protocol::protocol::SkillsListEntry;
use codex_protocol::protocol::ThreadNameUpdatedEvent;
use codex_protocol::protocol::ThreadRolledBackEvent;
@@ -5371,7 +5371,7 @@ mod handlers {
let mut skills = Vec::new();
let empty_cli_overrides: &[(String, toml::Value)] = &[];
for cwd in cwds {
let cwd_abs = match AbsolutePathBuf::try_from(cwd.as_path()) {
let cwd_abs = match AbsolutePathBuf::relative_to_current_dir(cwd.as_path()) {
Ok(path) => path,
Err(err) => {
let message = err.to_string();
@@ -5379,17 +5379,17 @@ mod handlers {
skills.push(SkillsListEntry {
cwd: cwd_for_entry.clone(),
skills: Vec::new(),
errors: super::errors_to_info(&[SkillError {
errors: vec![SkillErrorInfo {
path: cwd_for_entry,
message,
}]),
}],
});
continue;
}
};
let config_layer_stack = match load_config_layers_state(
&codex_home,
Some(cwd_abs),
Some(cwd_abs.clone()),
empty_cli_overrides,
LoaderOverrides::default(),
CloudRequirementsLoader::default(),
@@ -5403,10 +5403,10 @@ mod handlers {
skills.push(SkillsListEntry {
cwd: cwd_for_entry.clone(),
skills: Vec::new(),
errors: super::errors_to_info(&[SkillError {
errors: vec![SkillErrorInfo {
path: cwd_for_entry,
message,
}]),
}],
});
continue;
}
@@ -5416,7 +5416,7 @@ mod handlers {
config.features.enabled(Feature::Plugins),
);
let skills_input = crate::SkillsLoadInput::new(
cwd.clone(),
cwd_abs,
effective_skill_roots,
config_layer_stack,
config.bundled_skills_enabled(),
@@ -5959,7 +5959,7 @@ async fn spawn_review_thread(
fn skills_to_info(
skills: &[SkillMetadata],
disabled_paths: &HashSet<PathBuf>,
disabled_paths: &HashSet<AbsolutePathBuf>,
) -> Vec<ProtocolSkillMetadata> {
skills
.iter()
@@ -6005,7 +6005,7 @@ fn errors_to_info(errors: &[SkillError]) -> Vec<SkillErrorInfo> {
errors
.iter()
.map(|err| SkillErrorInfo {
path: err.path.clone(),
path: err.path.to_path_buf(),
message: err.message.clone(),
})
.collect()