Require filesystem backends to implement directory walks (#39749)

## What changed

- Make `ExecutorFileSystem::walk` a required backend operation instead of
  providing a fallback built from directory reads and metadata requests.
- Implement bounded local walks on a blocking task with cancellation, symlink
  cycle detection, deterministic ordering, error collection, and response-size
  limits.
- Have remote filesystems use the server's walk operation directly.

## Testing

- Cover local and remote handling of invalid roots and limits, directory
  symlinks, non-UTF-8 names, cancellation, sandbox contexts, and response
  budgets.

GitOrigin-RevId: 7499bf05080c3f9965a5eb7ffd593de604d62c2a
This commit is contained in:
cgst-oai
2026-08-20 17:16:52 +00:00
committed by copyberry
parent 2e1f18e0db
commit a26d50852a
11 changed files with 668 additions and 271 deletions
@@ -15,6 +15,8 @@ use codex_exec_server::GetMetadataOptions;
use codex_exec_server::ReadDirectoryEntry;
use codex_exec_server::ReadFileOptions;
use codex_exec_server::RemoveOptions;
use codex_exec_server::WalkOptions;
use codex_exec_server::WalkOutcome;
use codex_exec_server::WriteFileOptions;
use codex_plugin::ResolvedPlugin;
use codex_plugin::manifest::PluginManifest;
@@ -124,6 +126,15 @@ impl ExecutorFileSystem for SyntheticExecutorFileSystem {
Box::pin(async { Self::unsupported() })
}
fn walk<'a>(
&'a self,
_path: &'a PathUri,
_options: WalkOptions,
_sandbox: Option<&'a FileSystemSandboxContext>,
) -> ExecutorFileSystemFuture<'a, WalkOutcome> {
Box::pin(async { Self::unsupported() })
}
fn remove<'a>(
&'a self,
_path: &'a PathUri,