[apps] Add thread_id param to optionally load thread config for apps feature check. (#11279)

- [x] Add thread_id param to optionally load thread config for apps
feature check
This commit is contained in:
Matthew Zeng
2026-02-09 23:10:26 -08:00
committed by GitHub
parent 503186b31f
commit 005e040f97
11 changed files with 186 additions and 1 deletions

View File

@@ -4368,7 +4368,7 @@ impl CodexMessageProcessor {
}
async fn apps_list(&self, request_id: ConnectionRequestId, params: AppsListParams) {
let config = match self.load_latest_config().await {
let mut config = match self.load_latest_config().await {
Ok(config) => config,
Err(error) => {
self.outgoing.send_error(request_id, error).await;
@@ -4376,6 +4376,22 @@ impl CodexMessageProcessor {
}
};
if let Some(thread_id) = params.thread_id.as_deref() {
let (_, thread) = match self.load_thread(thread_id).await {
Ok(result) => result,
Err(error) => {
self.outgoing.send_error(request_id, error).await;
return;
}
};
if thread.enabled(Feature::Apps) {
config.features.enable(Feature::Apps);
} else {
config.features.disable(Feature::Apps);
}
}
if !config.features.enabled(Feature::Apps) {
self.outgoing
.send_response(
@@ -4405,6 +4421,7 @@ impl CodexMessageProcessor {
let AppsListParams {
cursor,
limit,
thread_id: _,
force_refetch,
} = params;
let start = match cursor {