Skip to content

feat: add permission profile list api#23412

Open
viyatb-oai wants to merge 6 commits into
mainfrom
codex/viyatb/permission-profile-list-api
Open

feat: add permission profile list api#23412
viyatb-oai wants to merge 6 commits into
mainfrom
codex/viyatb/permission-profile-list-api

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai commented May 19, 2026

Why

Clients need a typed permission-profile catalog instead of reconstructing that state from config internals.

What changed

  • Added permissionProfile/list to the app-server v2 protocol with cursor pagination and optional cwd.
  • The list response includes built-in permission profiles plus config-defined [permissions.<id>] profiles from the effective config for the request context.
  • Permission profiles keep optional description metadata for display purposes.
  • App-server docs and schema fixtures are updated for the new RPC.

Co-authored-by: Codex noreply@openai.com
@viyatb-oai viyatb-oai requested a review from a team as a code owner May 19, 2026 04:18
@viyatb-oai viyatb-oai requested a review from bolinfest May 19, 2026 04:30
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: 022c70895f

ℹ️ 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/common.rs
Comment on lines +423 to +424
id: BUILT_IN_PERMISSION_PROFILE_DANGER_FULL_ACCESS.to_string(),
description: None,
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.

P2 Badge Hide constrained-out built-in profiles

When managed requirements restrict permissions (for example allowed_sandbox_modes = ["read-only"]), ConfigBuilder already falls back and clears the active profile for disallowed selections, but this catalog still advertises the unrestricted built-in profiles unconditionally. In those managed environments a client can present :danger-full-access as an available choice from permissionProfile/list, only for thread/start/overrides to be constrained back to read-only, so the list should be derived from the effective constraints or omit profiles that cannot actually be selected.

Useful? React with 👍 / 👎.

Comment thread codex-rs/app-server/src/request_processors/catalog_processor.rs Outdated
@viyatb-oai viyatb-oai changed the title feat: add permission profile list API feat: add permission profile catalog and requirements support May 19, 2026
@viyatb-oai viyatb-oai changed the title feat: add permission profile catalog and requirements support feat: add permission profile list api May 19, 2026
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
#[ts(export_to = "v2/")]
pub struct PermissionProfileListParams {
/// Opaque pagination cursor returned by a previous call.
#[ts(optional = nullable)]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm debating whether adding support for a cursor is helpful or just adds more complexity that our clients are unlikely to need?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I’m keeping cursor support here. It matches the default shape for new app-server list APIs and avoids revisiting the contract later if the profile catalog grows beyond the small built-in set.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sorry codex comment - having a cursor would be great if an org pushed a lot of permission profiles.

#[ts(export_to = "v2/")]
pub struct PermissionProfileSummary {
/// Available permission profile identifier.
pub id: String,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm debating whether we should optionally provide label: Option<String> in addition to description where the label would be the value to show instead of the id in a UI element without a lot of space. This could be used to simply the raw names of the built-in profiles in the UI?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I’m leaving label out of this PR. I’d like this list surface to stay semantic rather than presentation-specific until we have a clear label source and contract for custom profiles too, not just the built-ins.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

keeping this for a follow up pr

Comment thread codex-rs/app-server/src/request_processors/catalog_processor.rs
Co-authored-by: Codex noreply@openai.com
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.

2 participants