mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
## Why Checking multiple paths against the same sandbox policy repeats root resolution and protected metadata path construction. URI containment checks also allocate segment lists and check for escaped separators even when paths contain no escapes. ## What changed - Lazily cache resolved policy roots, lexical depths, protected metadata paths, and the full-disk write decision in the path matcher. Reuse the matcher across checks against the same prepared local policy. - Compare URI path segments directly from iterators and skip decoding for plain POSIX segment comparisons. Keep checking the full path for encoded separators, including the suffix beyond a matched prefix. ## Testing Exercise one prepared matcher against protected metadata and an ordinary writable file. Extend URI prefix tests to cover a candidate shorter than its base and paths with repeated or trailing separators. GitOrigin-RevId: 34425d018516e24c36e1c87ea51bfbd344137cd8
codex-protocol
This crate defines the "types" for the protocol used by Codex CLI, which includes both "internal types" for communication between codex-core and codex-tui, as well as "external types" used with codex app-server.
This crate should have minimal dependencies.
Ideally, we should avoid "material business logic" in this crate, as we can always introduce Ext-style traits to add functionality to types in other crates.