Skip to content

chore(app-server-protocol): split v2 API definitions into modules#21251

Merged
owenlin0 merged 3 commits into
mainfrom
owen/split_up_v2_protocol_defs
May 5, 2026
Merged

chore(app-server-protocol): split v2 API definitions into modules#21251
owenlin0 merged 3 commits into
mainfrom
owen/split_up_v2_protocol_defs

Conversation

@owenlin0

@owenlin0 owenlin0 commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Why

codex-rs/app-server-protocol/src/protocol/v2.rs had grown into a single ~12k-line definition file for the entire app-server v2 API.

This is purely a mechanical refactor to break up the monolithic v2.rs file that contains all app-server API v2 types into more modular files, grouped by resource (e.g. account, thread, turn, etc.).

just write-app-server-schema shows no real changes, so we can be sure that this is purely an internal organizational change.

What changed

  • Replaced the monolithic protocol/v2.rs with a protocol/v2/ module tree and a small mod.rs that only declares and reexports modules.
  • Grouped v2 API definitions by conceptual owner, including account, apps, collaboration_mode, command_exec, config, device_key, experimental_feature, feedback, fs, hook, item, mcp, model, notification, permissions, plugin, process, realtime, review, thread, thread_data, turn, and windows_sandbox.
  • Moved v2 tests into protocol/v2/tests.rs so mod.rs stays small.
  • Kept shared protocol helpers in protocol/v2/shared.rs, including the enum mirroring macro and common cross-resource types.
  • Co-located resource-specific notifications and server-request payloads with the modules that own those resources.
  • Regenerated app-server protocol schema fixtures. The schema diffs are non-semantic newline-only changes after the refactor.

Verification

  • cargo check -p codex-app-server-protocol
  • cargo test -p codex-app-server-protocol
  • just write-app-server-schema

@owenlin0 owenlin0 marked this pull request as ready for review May 5, 2026 21:46
@owenlin0 owenlin0 force-pushed the owen/split_up_v2_protocol_defs branch from ce7b9ba to 3423dca Compare May 5, 2026 22:46
@owenlin0 owenlin0 force-pushed the owen/split_up_v2_protocol_defs branch from 3423dca to c2a2f99 Compare May 5, 2026 22:53
@owenlin0 owenlin0 changed the title chore(app-server-protocol): split up v2.rs chore(app-server-protocol): split v2 API definitions into modules May 5, 2026
@owenlin0 owenlin0 requested review from bolinfest and pakrym-oai May 5, 2026 23:02
@owenlin0 owenlin0 enabled auto-merge (squash) May 5, 2026 23:21
@owenlin0 owenlin0 disabled auto-merge May 5, 2026 23:42
@owenlin0 owenlin0 merged commit d7de4dd into main May 5, 2026
37 of 38 checks passed
@owenlin0 owenlin0 deleted the owen/split_up_v2_protocol_defs branch May 5, 2026 23:46
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 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