Skip to content

app-server: preserve legacy cwd strings in exec events#29472

Closed
anp-oai wants to merge 7 commits into
mainfrom
codex/legacy-exec-event-cwd
Closed

app-server: preserve legacy cwd strings in exec events#29472
anp-oai wants to merge 7 commits into
mainfrom
codex/legacy-exec-event-cwd

Conversation

@anp-oai

@anp-oai anp-oai commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Why

Command lifecycle events can end up on the wire or on disk in some configurations. This undoes the overeager conversion of their cwd's to PathUri, and also adds tests to ensure that any rollouts with these events written as file:///... will deserialize successfully.

What

  • Carry LegacyAppPathString in exec command begin/end events.
  • Convert internal PathUri values at emission and restore them only for app-server command-action resolution.
  • Accept both raw file URIs and inferred native paths in to_inferred_path_uri.

@anp-oai anp-oai marked this pull request as ready for review June 22, 2026 19:20
@anp-oai anp-oai requested a review from a team as a code owner June 22, 2026 19:20

@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: f919194e9f

ℹ️ 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/app-server-protocol/src/protocol/item_builders.rs Outdated
@anp-oai

anp-oai commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 985644dccf

ℹ️ 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/rollout-trace/src/protocol_event.rs Outdated
Comment thread codex-rs/core/src/tools/events.rs
Comment thread codex-rs/utils/path-uri/src/api_path_string.rs Outdated
anp-oai added a commit that referenced this pull request Jun 22, 2026
anp-oai added a commit that referenced this pull request Jun 22, 2026
anp-oai added a commit that referenced this pull request Jun 22, 2026
anp-oai added a commit that referenced this pull request Jun 22, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
@anp-oai anp-oai force-pushed the codex/legacy-exec-event-cwd branch from 63d55da to 7453a92 Compare June 23, 2026 00:03
anp-oai added a commit that referenced this pull request Jun 23, 2026
@anp-oai anp-oai force-pushed the codex/legacy-exec-event-cwd branch from 7453a92 to 9b23284 Compare June 23, 2026 00:05
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
@anp-oai anp-oai force-pushed the codex/legacy-exec-event-cwd branch from 4ec2fbf to f7d5959 Compare June 23, 2026 01:05
anp-oai added a commit that referenced this pull request Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
@anp-oai anp-oai force-pushed the codex/legacy-exec-event-cwd branch from f7d5959 to 2233689 Compare June 23, 2026 01:46
@anp-oai

anp-oai commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

This is overkill, the path that codex proposed for these to end up in rollouts was only an experimental feature that has since been removed.

@anp-oai anp-oai closed this Jun 23, 2026
anp-oai added a commit that referenced this pull request Jun 23, 2026
## Why

I'd originally added `PathUri` legacy path deserialization thinking we'd
want it for having `PathUri` in public app-server APIs. Since then we've
added `LegacyAppPathString` to handle the messy conversions that we need
for backcompat. It's confusing for `PathUri` to support deserializing
legacy paths when we don't yet want to actually expose app-server
callers or rollout storage to the new URI format.

Stacked on top of #29472 to avoid breaking compatibility in case those
types ended up stored somewhere for someone.

## What changed

- Parse deserialized `PathUri` values exclusively as valid `file:` URIs.
- Replace legacy acceptance coverage with rejection coverage for
top-level filesystem paths and sandbox working directories.
- Serialize CWDs in hand-built exec-server process requests as `PathUri`
values.
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.

1 participant