mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
[codex] expose scheduled task summaries in plugin/read
This commit is contained in:
@@ -8,6 +8,7 @@ use codex_app_server_protocol::PluginAvailability;
|
||||
use codex_app_server_protocol::PluginInstallPolicy;
|
||||
use codex_app_server_protocol::PluginInstallPolicySource;
|
||||
use codex_app_server_protocol::PluginInterface;
|
||||
use codex_app_server_protocol::ScheduledTaskSummary;
|
||||
use codex_app_server_protocol::SkillInterface;
|
||||
use codex_login::CodexAuth;
|
||||
use codex_login::default_client::build_reqwest_client;
|
||||
@@ -209,6 +210,7 @@ pub struct RemotePluginDetail {
|
||||
pub app_ids: Vec<String>,
|
||||
pub app_templates: Vec<RemoteAppTemplate>,
|
||||
pub mcp_servers: Vec<String>,
|
||||
pub scheduled_tasks: Option<Vec<ScheduledTaskSummary>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
@@ -504,6 +506,7 @@ struct RemotePluginReleaseResponse {
|
||||
skills: Vec<RemotePluginSkillResponse>,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
mcp_servers: Vec<RemotePluginMcpServerResponse>,
|
||||
scheduled_tasks: Option<Vec<ScheduledTaskSummary>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
@@ -1290,6 +1293,7 @@ async fn build_remote_plugin_detail(
|
||||
})
|
||||
.collect(),
|
||||
mcp_servers,
|
||||
scheduled_tasks: plugin.release.scheduled_tasks,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +96,24 @@ fn unknown_installation_policy_source_maps_to_none() {
|
||||
assert_eq!(summary.install_policy_source, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scheduled_task_metadata_distinguishes_unavailable_from_empty() {
|
||||
let release = serde_json::json!({
|
||||
"display_name": "Example",
|
||||
"description": "Example plugin",
|
||||
"interface": {},
|
||||
});
|
||||
let without_metadata: RemotePluginReleaseResponse =
|
||||
serde_json::from_value(release.clone()).expect("release should deserialize");
|
||||
assert_eq!(without_metadata.scheduled_tasks, None);
|
||||
|
||||
let mut with_empty_metadata = release;
|
||||
with_empty_metadata["scheduled_tasks"] = serde_json::json!([]);
|
||||
let with_empty_metadata: RemotePluginReleaseResponse =
|
||||
serde_json::from_value(with_empty_metadata).expect("release should deserialize");
|
||||
assert_eq!(with_empty_metadata.scheduled_tasks, Some(Vec::new()));
|
||||
}
|
||||
|
||||
fn directory_plugin(id: &str, name: &str) -> RemotePluginDirectoryItem {
|
||||
RemotePluginDirectoryItem {
|
||||
id: id.to_string(),
|
||||
@@ -138,6 +156,7 @@ fn directory_plugin(id: &str, name: &str) -> RemotePluginDirectoryItem {
|
||||
},
|
||||
skills: Vec::new(),
|
||||
mcp_servers: Vec::new(),
|
||||
scheduled_tasks: None,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user