Skip to content

[codex] Add size to internal filesystem metadata#27927

Merged
pakrym-oai merged 2 commits into
mainfrom
pakrym/full-ci-file-metadata-size
Jun 12, 2026
Merged

[codex] Add size to internal filesystem metadata#27927
pakrym-oai merged 2 commits into
mainfrom
pakrym/full-ci-file-metadata-size

Conversation

@pakrym-oai

@pakrym-oai pakrym-oai commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Why

ExecutorFileSystem::get_metadata reports file kind and timestamps but not size. Internal callers that need to enforce a size limit therefore have to read the complete file first, which is especially wasteful for remote filesystems.

This adds the missing internal metadata so consumers can reject oversized files before transferring or buffering them. The field is named size, matching VS Code's FileStat.size filesystem convention.

What changed

  • add size: u64 to internal FileMetadata
  • populate it from the underlying filesystem metadata
  • carry it through sandbox-helper and remote exec-server responses
  • cover files, directories, symlink targets, and sandboxed reads across local and remote filesystem implementations

The new field is intentionally not exposed through the app-server API.

Testing

  • just test -p codex-exec-server get_metadata
  • just test -p codex-exec-server file_system_sandboxed_metadata_and_read_allow_readable_root
  • just test -p codex-core-plugins
  • just test -p codex-skills-extension

@pakrym-oai
pakrym-oai marked this pull request as ready for review June 12, 2026 18:31
@pakrym-oai pakrym-oai changed the title [codex] Add size to filesystem metadata [codex] Add size to internal filesystem metadata Jun 12, 2026

@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: 138e4eeeea

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

pub is_directory: bool,
pub is_file: bool,
pub is_symlink: bool,
pub size: u64,

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.

P1 Badge Keep fs/getMetadata responses backward-compatible

With mixed-version remotes, older exec-server fs/getMetadata replies omit size; making it required makes serde fail before RemoteFileSystem::get_metadata returns metadata. Please default/optionalize this wire field or negotiate protocol while filling it when available. guidance

Useful? React with 👍 / 👎.

@pakrym-oai
pakrym-oai merged commit 76d8f20 into main Jun 12, 2026
60 of 78 checks passed
@pakrym-oai
pakrym-oai deleted the pakrym/full-ci-file-metadata-size branch June 12, 2026 19:12
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants