mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
[codex] remove EnvironmentPathRef (#27433)
We're switching to using a static encoding of the host path in `PathUri`. We may need a type like this again but we can add it when it's more compelling. Stacked on #27454.
This commit is contained in:
1 parent
0b08bbb9d9
commit
4a05d3b282
5 files changed
+34
-602
No files matched your search
@@ -6,7 +6,6 @@ use codex_core_skills::filter_skill_load_outcome_for_product;
|
||||
use codex_core_skills::loader::SkillRoot;
|
||||
use codex_core_skills::loader::load_skills_from_roots;
|
||||
use codex_exec_server::EnvironmentManager;
|
||||
use codex_exec_server::EnvironmentPathRef;
|
||||
use codex_protocol::capabilities::CapabilityRootLocation;
|
||||
use codex_protocol::protocol::Product;
|
||||
use codex_protocol::protocol::SkillScope;
|
||||
@@ -99,7 +98,7 @@ impl SkillProvider for ExecutorSkillProvider {
|
||||
enabled,
|
||||
authority.clone(),
|
||||
&selected_root_id,
|
||||
Arc::clone(&file_system),
|
||||
&environment_id,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -121,13 +120,19 @@ impl SkillProvider for ExecutorSkillProvider {
|
||||
"executor skill resource does not match its package",
|
||||
));
|
||||
}
|
||||
let Some(resource_path) = request.resource.environment_path() else {
|
||||
let Some((environment_id, resource_path)) = request.resource.environment_path() else {
|
||||
return Err(SkillProviderError::new(
|
||||
"executor skill resource is not bound to an environment",
|
||||
));
|
||||
};
|
||||
let contents = resource_path
|
||||
.read_to_string(/*sandbox*/ None)
|
||||
let Some(environment) = self.environment_manager.get_environment(environment_id) else {
|
||||
return Err(SkillProviderError::new(format!(
|
||||
"executor skill resource references unavailable environment `{environment_id}`"
|
||||
)));
|
||||
};
|
||||
let contents = environment
|
||||
.get_filesystem()
|
||||
.read_file_text(resource_path, /*sandbox*/ None)
|
||||
.await
|
||||
.map_err(|err| {
|
||||
SkillProviderError::new(format!(
|
||||
@@ -153,7 +158,7 @@ fn catalog_entry_from_skill(
|
||||
enabled: bool,
|
||||
authority: SkillAuthority,
|
||||
selected_root_id: &str,
|
||||
file_system: Arc<dyn codex_exec_server::ExecutorFileSystem>,
|
||||
environment_id: &str,
|
||||
) -> SkillCatalogEntry {
|
||||
let skill_path = skill.path_to_skills_md.to_string_lossy().into_owned();
|
||||
let normalized_path = skill_path.replace('\\', "/");
|
||||
@@ -168,7 +173,8 @@ fn catalog_entry_from_skill(
|
||||
skill.description.clone(),
|
||||
SkillResourceId::environment(
|
||||
display_path.clone(),
|
||||
EnvironmentPathRef::new(file_system, skill.path_to_skills_md.clone()),
|
||||
environment_id,
|
||||
skill.path_to_skills_md.clone(),
|
||||
),
|
||||
)
|
||||
.with_short_description(skill.short_description.clone())
|
||||
|
||||
Reference in new issue
Block a user