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

@@ -730,6 +730,7 @@ pub(super) async fn handle_pending_thread_resume_request(
let cwd = config_snapshot.cwd().clone();
let ThreadConfigSnapshot {
model,
disabled_plugin_ids,
model_provider_id,
service_tier,
approval_policy,
@@ -748,6 +749,7 @@ pub(super) async fn handle_pending_thread_resume_request(
let response = ThreadResumeResponse {
thread,
disabled_plugin_ids,
model,
model_provider: model_provider_id,
service_tier,
@@ -1617,6 +1617,7 @@ impl ThreadRequestProcessor {
let response = ThreadStartResponse {
thread: thread.clone(),
disabled_plugin_ids: config_snapshot.disabled_plugin_ids,
model: config_snapshot.model,
model_provider: config_snapshot.model_provider_id,
service_tier: config_snapshot.service_tier,
@@ -4177,6 +4178,7 @@ impl ThreadRequestProcessor {
let thread_originator = config_snapshot.originator.clone();
let response = ThreadResumeResponse {
thread,
disabled_plugin_ids: config_snapshot.disabled_plugin_ids,
model: session_configured.model,
model_provider: session_configured.model_provider_id,
service_tier: session_configured.service_tier,
@@ -5369,6 +5371,7 @@ impl ThreadRequestProcessor {
let thread_originator = config_snapshot.originator.clone();
let response = ThreadForkResponse {
thread: thread.clone(),
disabled_plugin_ids: config_snapshot.disabled_plugin_ids,
model: session_configured.model,
model_provider: session_configured.model_provider_id,
service_tier: session_configured.service_tier,
@@ -679,6 +679,7 @@ mod thread_processor_behavior_tests {
initial_turns_page: None,
};
let config_snapshot = ThreadConfigSnapshot {
disabled_plugin_ids: Vec::new(),
model: "gpt-5".to_string(),
model_provider_id: "openai".to_string(),
service_tier: Some("flex".to_string()),
@@ -176,6 +176,7 @@ pub(crate) fn thread_settings_from_config_snapshot(
config_snapshot: &ThreadConfigSnapshot,
) -> ThreadSettings {
ThreadSettings {
disabled_plugin_ids: config_snapshot.disabled_plugin_ids.clone(),
cwd: config_snapshot.cwd().clone(),
approval_policy: config_snapshot.approval_policy.into(),
approvals_reviewer: config_snapshot.approvals_reviewer.into(),
@@ -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,