[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:
Adam Perry @ OpenAI authored and GitHub committed 2026-06-11 18:26:12 +00:00
1 parent 0b08bbb9d9
commit 4a05d3b282
5 files changed
+34 -602

No files matched your search

+21 -6
View File
@@ -1,5 +1,5 @@
use codex_core_skills::model::SkillDependencies;
use codex_exec_server::EnvironmentPathRef;
use codex_utils_absolute_path::AbsolutePathBuf;
/// Source authority that owns a skill package and must be used to read it.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
@@ -62,7 +62,7 @@ pub struct SkillPackageId(pub String);
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct SkillResourceId {
id: String,
environment_path: Option<EnvironmentPathRef>,
environment_path: Option<EnvironmentSkillResource>,
}
impl SkillResourceId {
@@ -73,10 +73,17 @@ impl SkillResourceId {
}
}
pub fn environment(id: impl Into<String>, path: EnvironmentPathRef) -> Self {
pub fn environment(
id: impl Into<String>,
environment_id: impl Into<String>,
path: AbsolutePathBuf,
) -> Self {
Self {
id: id.into(),
environment_path: Some(path),
environment_path: Some(EnvironmentSkillResource {
environment_id: environment_id.into(),
path,
}),
}
}
@@ -84,11 +91,19 @@ impl SkillResourceId {
&self.id
}
pub(crate) fn environment_path(&self) -> Option<&EnvironmentPathRef> {
self.environment_path.as_ref()
pub(crate) fn environment_path(&self) -> Option<(&str, &AbsolutePathBuf)> {
self.environment_path
.as_ref()
.map(|resource| (resource.environment_id.as_str(), &resource.path))
}
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
struct EnvironmentSkillResource {
environment_id: String,
path: AbsolutePathBuf,
}
/// Metadata shown in the always-visible skills catalog.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SkillCatalogEntry {