Skip to content

Bind skill paths to their executor filesystem#24992

Closed
starr-openai wants to merge 16 commits into
mainfrom
starr/environment-path-ref-core
Closed

Bind skill paths to their executor filesystem#24992
starr-openai wants to merge 16 commits into
mainfrom
starr/environment-path-ref-core

Conversation

@starr-openai

@starr-openai starr-openai commented May 29, 2026

Copy link
Copy Markdown
Contributor

Why

Skills loading had started to pass raw AbsolutePathBuf values separately from the ExecutorFileSystem that actually owns those paths. That is unsafe once Codex can have more than one execution environment: the same absolute path string can refer to different files depending on whether it is read through the local filesystem or a selected remote environment.

This PR makes that authority explicit at the skills boundary. Skill code now receives a bound path object instead of reconstructing (filesystem, path) pairs ad hoc, so repo/workspace skill reads stay attached to the selected environment while client-local skill sources do not accidentally get read from a remote filesystem.

What Changed

  • Added public codex_exec_server::EnvironmentPathRef, a small bound-path primitive for (Arc<dyn ExecutorFileSystem>, AbsolutePathBuf) with path helpers plus filesystem-backed read_to_string, metadata, and read_directory methods.
  • Moved skills loading to carry EnvironmentPathRef through SkillRoot, SkillsLoadInput, loader traversal, cache keys, and plugin skill reads instead of splitting filesystem/path authority at callsites.
  • Split skill root authority intentionally:
    • repo/workspace roots such as project .codex/skills and repo .agents/skills use the selected environment path
    • local user/system/plugin roots use the available local filesystem only
    • when local exec is disabled, local absolute roots are skipped instead of falling back to LOCAL_FS
  • Updated turn/session skill loading to construct the selected environment path from the resolved primary turn environment, while still using the local filesystem for local user/system/plugin skill roots when available.
  • Kept plugin skill metadata loading local-only for now, with TODOs marking the future multi-environment plugin-loading follow-up.
  • Added backwards-compatible skills/list.environmentId request selection. When present, skills/list scans cwd entries using that environment; when omitted, it keeps the legacy implicit-local behavior. If omitted while local exec is disabled, the API now returns an empty catalog instead of silently switching to another environment.
  • Updated the app-server schema/docs and focused tests for the new skills/list request shape and local-disabled behavior.

Verification

  • Added EnvironmentPathRef unit coverage for filesystem identity/hash behavior and sandbox forwarding.
  • Added skills loader/manager coverage that repo roots stay bound to the selected environment filesystem while local roots use the local filesystem and are skipped when local exec is unavailable.
  • Added app-server skills/list coverage for explicit environmentId serialization and the implicit-local-disabled empty-catalog case.

@starr-openai starr-openai requested a review from a team as a code owner May 29, 2026 00:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 902bcc6901

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core-skills/src/loader.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/catalog_processor.rs Outdated
Comment thread codex-rs/core/src/session/turn_context.rs
@starr-openai starr-openai changed the title Move skills path refs into exec server Bind skill paths to their executor filesystem May 29, 2026
@starr-openai starr-openai force-pushed the starr/environment-path-ref-core branch from d9074a5 to 2f7cbea Compare May 29, 2026 05:10
Comment thread codex-rs/core-skills/src/loader.rs
Comment thread codex-rs/app-server/src/request_processors/catalog_processor.rs
Comment thread codex-rs/tui/src/app/background_requests.rs
Comment thread codex-rs/core-skills/src/loader.rs
Comment thread codex-rs/core-skills/src/loader.rs
Comment thread codex-rs/core-skills/src/manager_tests.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants