Skip to content

fix: accept two macOS automation input shapes for approval payload compatibility#13683

Merged
celia-oai merged 2 commits intomainfrom
dev/cc/add
Mar 6, 2026
Merged

fix: accept two macOS automation input shapes for approval payload compatibility#13683
celia-oai merged 2 commits intomainfrom
dev/cc/add

Conversation

@celia-oai
Copy link
Collaborator

@celia-oai celia-oai commented Mar 6, 2026

Summary

This PR:

  1. fixes a deserialization mismatch for macOS automation permissions in approval payloads by making core parsing accept both supported wire shapes for bundle IDs.
  2. added #[serde(default)] to MacOsSeatbeltProfileExtensions so omitted fields deserialize to secure defaults.

Why this change is needed

MacOsAutomationPermission uses #[serde(try_from = "MacOsAutomationPermissionDe")], so deserialization is controlled by MacOsAutomationPermissionDe. After we aligned v2 additionalPermissions.macos.automations to the core shape, approval payloads started including { "bundle_ids": [...] } in some paths. MacOsAutomationPermissionDe previously accepted only "none" | "all" or a plain array, so object-shaped bundle IDs failed with data did not match any variant of untagged enum MacOsAutomationPermissionDe. This change restores compatibility by accepting both forms while preserving existing normalization behavior (trim values and map empty bundle lists to None).

Validation

saw this error went away when running

cargo run -p codex-app-server-test-client -- \
    --codex-bin ./target/debug/codex \
    -c 'approval_policy="on-request"' \
    -c 'features.shell_zsh_fork=true' \
    -c 'zsh_path="/tmp/codex-zsh-fork/package/vendor/aarch64-apple-darwin/zsh/macos-15/zsh"' \
    send-message-v2 --experimental-api \
    'Use $apple-notes and run scripts/notes_info now.'

:

Error: failed to deserialize ServerRequest from JSONRPCRequest

Caused by:
    data did not match any variant of untagged enum MacOsAutomationPermissionDe

@celia-oai celia-oai marked this pull request as draft March 6, 2026 05:20
@celia-oai celia-oai changed the title fix: normalize additionalPermissions.macos.automations to v2 wire shape Accept both macOS automation input shapes (["..."] and { "bundle_ids": [...] }) for approval payload compatibility Mar 6, 2026
@celia-oai celia-oai changed the title Accept both macOS automation input shapes (["..."] and { "bundle_ids": [...] }) for approval payload compatibility fix: accept two macOS automation input shapes for approval payload compatibility Mar 6, 2026
@celia-oai celia-oai marked this pull request as ready for review March 6, 2026 05:45
@celia-oai celia-oai enabled auto-merge (squash) March 6, 2026 05:55
@celia-oai celia-oai merged commit f9ce403 into main Mar 6, 2026
51 of 53 checks passed
@celia-oai celia-oai deleted the dev/cc/add branch March 6, 2026 06:02
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 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.

3 participants