Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions codex-rs/app-server-protocol/schema/json/v2/AppsReadResponse.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions codex-rs/app-server-protocol/src/protocol/v2/apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ pub struct ConnectorMetadata {
pub name: String,
pub description: Option<String>,
pub icon_url: Option<String>,
pub icon_url_dark: Option<String>,
pub distribution_channel: Option<String>,
pub install_url: Option<String>,
#[serde(default)]
pub plugin_display_names: Vec<String>,
pub tool_summaries: Option<Vec<AppToolSummary>>,
}

Expand Down
10 changes: 9 additions & 1 deletion codex-rs/app-server/src/app_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use codex_connectors::AppReview;
use codex_connectors::AppScreenshot;
use codex_connectors::ConnectorMetadata;
use codex_connectors::ConnectorToolSummary;
use codex_connectors::metadata::connector_install_url;

/// Converts connector-domain app metadata owned by `codex-connectors` into the app-server wire
/// type owned by `codex-app-server-protocol`.
Expand Down Expand Up @@ -59,20 +60,27 @@ pub(crate) fn app_info_to_api(app: AppInfo) -> ApiAppInfo {
/// Converts metadata-only connector data into the app-server wire type.
///
/// Keeping this separate from app_info_to_api makes it impossible for app/read to accidentally
/// grow runtime state from the broader app/list shape.
/// expose full runtime tool state from the broader app/list path.
pub(crate) fn connector_metadata_to_api(metadata: ConnectorMetadata) -> ApiConnectorMetadata {
let ConnectorMetadata {
id,
name,
description,
icon_url,
icon_url_dark,
distribution_channel,
tool_summaries,
} = metadata;
let install_url = Some(connector_install_url(&name, &id));
ApiConnectorMetadata {
id,
name,
description,
icon_url,
icon_url_dark,
distribution_channel,
install_url,
plugin_display_names: Vec::new(),
tool_summaries: tool_summaries.map(|tools| {
tools
.into_iter()
Expand Down
21 changes: 20 additions & 1 deletion codex-rs/app-server/src/request_processors/apps_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,28 @@ impl AppsRequestProcessor {
} = connectors::read_connector_metadata(&config, auth, &app_ids, include_tools)
.await
.map_err(|err| internal_error(format!("failed to read app metadata: {err}")))?;
let loaded_plugins = self
.thread_manager
.plugins_manager()
.plugins_for_config(&config.plugins_config_input())
.await;
let connector_snapshot =
codex_connectors::ConnectorSnapshot::from_plugin_capability_summaries(
loaded_plugins.capability_summaries(),
);
let apps = apps
.into_iter()
.map(|metadata| {
let mut app = connector_metadata_to_api(metadata);
app.plugin_display_names = connector_snapshot
.plugin_display_names_for_connector_id(app.id.as_str())
.to_vec();
app
})
.collect();
Ok(Some(
AppsReadResponse {
apps: apps.into_iter().map(connector_metadata_to_api).collect(),
apps,
missing_app_ids,
}
.into(),
Expand Down
Loading
Loading