[2 of 4] tui: route app and skill enablement through app server (#22914)

## Why
App and skill toggles are user config mutations too. When the TUI is
attached to a remote app server, writing those toggles into the local
`config.toml` makes the UI report success without updating the server
that actually owns the session.

This is **[2 of 4]** in a stacked series that moves TUI-owned config
mutations onto app-server APIs.

## What changed
- Routed app enable/disable persistence through app-server config batch
writes.
- Routed skill enable/disable persistence through `skills/config/write`.
- Avoided refreshing local config from disk after these writes when the
TUI is connected to a remote app server.

## Config keys affected
- `apps.<app_id>.enabled`
- `apps.<app_id>.disabled_reason`
- `[[skills.config]]` entries keyed by `path`, with `enabled = false`
used for persisted disables

## Suggested manual validation
- Connect the TUI to a remote app server, disable an app, reconnect, and
confirm the app remains disabled from remote config rather than local
disk state.
- Re-enable the same app and confirm both `apps.<app_id>.enabled` and
`apps.<app_id>.disabled_reason` are cleared remotely.
- Disable a skill in the manage-skills UI and confirm a remote
`[[skills.config]]` disable entry appears.
- Re-enable that skill and confirm the disable entry is removed and the
effective enabled state updates without relying on local config reloads.

## Stack
1. [#22913](https://github.com/openai/codex/pull/22913) `[1 of 4]`
primary settings writes
2. [#22914](https://github.com/openai/codex/pull/22914) `[2 of 4]` app
and skill enablement
3. [#22915](https://github.com/openai/codex/pull/22915) `[3 of 4]`
feature and memory toggles
4. [#22916](https://github.com/openai/codex/pull/22916) `[4 of 4]`
startup and onboarding bookkeeping
This commit is contained in:
Eric Traut authored and GitHub committed 2026-05-19 10:21:07 -07:00
1 parent f0663fd4fd
commit ae10708ae0
18 files changed
+189 -326

No files matched your search

@@ -6,6 +6,9 @@
use super::plugin_mentions::fetch_plugin_mentions;
use super::*;
use crate::app_event::ConnectorsSnapshot;
use codex_app_server_protocol::AppsListParams;
use codex_app_server_protocol::AppsListResponse;
use codex_app_server_protocol::MarketplaceAddParams;
use codex_app_server_protocol::MarketplaceAddResponse;
use codex_app_server_protocol::MarketplaceRemoveParams;
@@ -92,6 +95,27 @@ impl App {
});
}
pub(super) fn fetch_connectors_list(
&mut self,
app_server: &AppServerSession,
force_refetch: bool,
) {
let request_handle = app_server.request_handle();
let app_event_tx = self.app_event_tx.clone();
let thread_id = self
.current_displayed_thread_id()
.map(|thread_id| thread_id.to_string());
tokio::spawn(async move {
let result = fetch_connectors_list(request_handle, force_refetch, thread_id)
.await
.map_err(|err| err.to_string());
app_event_tx.send(AppEvent::ConnectorsLoaded {
result,
is_final: true,
});
});
}
pub(super) fn fetch_plugins_list(&mut self, app_server: &AppServerSession, cwd: PathBuf) {
let request_handle = app_server.request_handle();
let app_event_tx = self.app_event_tx.clone();
@@ -634,6 +658,29 @@ pub(super) async fn fetch_skills_list(
.wrap_err("skills/list failed in TUI")
}
pub(super) async fn fetch_connectors_list(
request_handle: AppServerRequestHandle,
force_refetch: bool,
thread_id: Option<String>,
) -> Result<ConnectorsSnapshot> {
let request_id = RequestId::String(format!("apps-list-{}", Uuid::new_v4()));
let response: AppsListResponse = request_handle
.request_typed(ClientRequest::AppsList {
request_id,
params: AppsListParams {
cursor: None,
limit: None,
thread_id,
force_refetch,
},
})
.await
.wrap_err("app/list failed in TUI")?;
Ok(ConnectorsSnapshot {
connectors: response.data,
})
}
pub(super) async fn fetch_plugins_list(
request_handle: AppServerRequestHandle,
cwd: PathBuf,