Expose disabled plugin settings in the app-server API (#44905)

## What changed

- Accept `disabledPluginIds` in `thread/settings/update` and `turn/start`. A supplied list replaces the saved selection; omission or `null` preserves it, and `[]` clears it.
- Return the selection in thread start, resume, and fork responses and `thread/settings/updated` notifications. Update generated schemas and client types.
- Restore disabled plugin IDs from the history retained at the requested fork boundary, preserving explicit overrides.

The selection persists across resume but does not yet filter plugin capabilities.

## Testing

Add coverage for replacing, preserving, and clearing selections without inference; turn-start notifications; resume; and fork boundaries across legacy and paginated history, with loaded and restarted parents. Add a core regression test for history restoration and explicit clearing.

GitOrigin-RevId: 654a8c2a0527228d422c0dd4919228447e2663db
This commit is contained in:
Matthew Zeng authored and copyberry committed 2026-09-11 20:27:37 +00:00
1 parent 42cd1ec497
commit c62d191c4c
44 files changed
+549 -19

No files matched your search

@@ -122,6 +122,7 @@ struct ThreadEnvironmentOverride {
struct ThreadSettingsBuildParams {
method: &'static str,
disabled_plugin_ids: Option<Vec<String>>,
environment_override: ThreadEnvironmentOverride,
approval_policy: Option<codex_app_server_protocol::AskForApproval>,
approvals_reviewer: Option<codex_app_server_protocol::ApprovalsReviewer>,
@@ -627,6 +628,7 @@ impl TurnRequestProcessor {
thread.as_ref(),
ThreadSettingsBuildParams {
method: "turn/start",
disabled_plugin_ids: params.disabled_plugin_ids,
environment_override,
approval_policy: params.approval_policy,
approvals_reviewer: params.approvals_reviewer,
@@ -774,6 +776,7 @@ impl TurnRequestProcessor {
) -> Result<codex_protocol::protocol::ThreadSettingsOverrides, JSONRPCErrorError> {
let ThreadSettingsBuildParams {
method,
disabled_plugin_ids,
environment_override:
ThreadEnvironmentOverride {
environments,
@@ -810,6 +813,7 @@ impl TurnRequestProcessor {
};
let has_any_overrides = has_environment_override
|| disabled_plugin_ids.is_some()
|| approval_policy.is_some()
|| approvals_reviewer.is_some()
|| sandbox_policy.is_some()
@@ -874,7 +878,7 @@ impl TurnRequestProcessor {
if has_any_overrides {
thread
.preview_thread_settings_overrides(CodexThreadSettingsOverrides {
disabled_plugin_ids: None,
disabled_plugin_ids: disabled_plugin_ids.clone(),
environments: environments.clone(),
runtime_workspace_roots: runtime_workspace_roots.clone(),
approval_policy,
@@ -898,7 +902,7 @@ impl TurnRequestProcessor {
}
Ok(codex_protocol::protocol::ThreadSettingsOverrides {
disabled_plugin_ids: None,
disabled_plugin_ids,
environments,
runtime_workspace_roots,
profile_workspace_roots,
@@ -939,6 +943,7 @@ impl TurnRequestProcessor {
thread.as_ref(),
ThreadSettingsBuildParams {
method: "thread/settings/update",
disabled_plugin_ids: params.disabled_plugin_ids,
environment_override,
approval_policy: params.approval_policy,
approvals_reviewer: params.approvals_reviewer,