Skip to content

permissions: remove cwd special path#19841

Merged
bolinfest merged 1 commit intomainfrom
pr19841
Apr 27, 2026
Merged

permissions: remove cwd special path#19841
bolinfest merged 1 commit intomainfrom
pr19841

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 27, 2026

Why

The experimental PermissionProfile API had both :cwd and :project_roots special filesystem paths, which made the permission root ambiguous. This PR removes the unstable current_working_directory special path before the permissions API is stabilized, so callers use :project_roots for symbolic project-root access.

What changed

  • Removes FileSystemSpecialPath::CurrentWorkingDirectory from protocol and app-server protocol models, plus regenerated app-server JSON/TypeScript schemas.
  • Replaces internal :cwd permission entries with :project_roots entries.
  • Keeps the existing cwd-update behavior for legacy-shaped workspace-write profiles, while removing the deleted CurrentWorkingDirectory case from that compatibility path.
  • Keeps PermissionProfile::workspace_write() as the reusable symbolic workspace-write helper, with docs noting that :project_roots entries resolve at enforcement time.
  • Updates app-server docs/examples and approval UI labeling to stop advertising :cwd as a permission token.

Compatibility

Persisted rollout items may contain the old {"kind":"current_working_directory"} tag from earlier experimental permissionProfile snapshots. This PR keeps that tag as a deserialize-only alias for ProjectRoots { subpath: None }, while continuing to serialize only the new project_roots tag.

Follow-up

This PR intentionally does not introduce an explicit project-root set on SessionConfiguration or runtime sandbox resolution. Today, the resolver still uses the active cwd as the single implicit project root. A follow-up should model project roots separately from tool cwd so :project_roots entries can resolve against the configured project roots, and resolve to no entries when there are no project roots.

Verification

  • cargo test -p codex-protocol permissions:: --lib
  • cargo test -p codex-app-server-protocol
  • cargo test -p codex-sandboxing -p codex-exec-server --lib
  • cargo test -p codex-core session_configuration_apply_ --lib
  • cargo test -p codex-app-server command_exec_permission_profile_project_roots_use_command_cwd --test all
  • cargo test -p codex-tui thread_read_session_state_does_not_reuse_primary_permission_profile --lib
  • cargo test -p codex-tui preset_matching_accepts_workspace_write_with_extra_roots --lib
  • cargo test -p codex-config --lib

@bolinfest bolinfest requested a review from a team as a code owner April 27, 2026 17:57
Copy link
Copy Markdown
Contributor

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

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: 015d927617

ℹ️ 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/protocol/src/permissions.rs
@bolinfest bolinfest force-pushed the pr19841 branch 2 times, most recently from 660ff6b to d85ef7c Compare April 27, 2026 18:40
@bolinfest bolinfest requested a review from viyatb-oai April 27, 2026 18:42
@bolinfest bolinfest force-pushed the pr19841 branch 3 times, most recently from 876bda9 to 6aaaea4 Compare April 27, 2026 19:05
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai left a comment

Choose a reason for hiding this comment

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

Confirmed this against persisted rollout behavior on the current head.

Comment thread codex-rs/protocol/src/permissions.rs
@bolinfest bolinfest merged commit 4b55979 into main Apr 27, 2026
49 of 72 checks passed
@bolinfest bolinfest deleted the pr19841 branch April 27, 2026 20:41
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 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