Log plugin install failure subtypes (#31518)

## Summary

- classify plugin store and remote bundle I/O failures by privacy-safe
operation context
- include the normalized `sub_error_type` in structured plugin-install
failure warnings
- leave analytics events and schemas unchanged

## Why

Top-level error types such as `store_io` collapse multiple filesystem
operations, making logs harder to diagnose. The subtype identifies the
failed operation without logging paths or new exception details.

## Impact

Plugin-install warning logs gain an optional normalized subtype.
Analytics payloads, app-server APIs, and stored data are unchanged.

## Validation

- `just fmt`
- `just test -p codex-core-plugins -p codex-app-server` (1,235 passed;
14 failed and 6 timed out because local `sandbox-exec` was denied,
`test_stdio_server` was unavailable, or user-level skill fixtures were
loaded)
This commit is contained in:
charlesgong-openai authored and GitHub committed 2026-07-08 11:06:45 -04:00
1 parent f17a57b7d5
commit 1ee0e9a949
4 files changed
+56

No files matched your search

+16
View File
@@ -1283,6 +1283,7 @@ impl PluginsManager {
self.track_plugin_install_failed(
&plugin_id,
plugin_install_error_type(&err),
plugin_install_sub_error_type(&err),
err.to_string(),
);
Err(err)
@@ -1345,6 +1346,7 @@ impl PluginsManager {
self.track_plugin_install_failed(
&resolved.plugin_id,
plugin_install_error_type(&err),
plugin_install_sub_error_type(&err),
err.to_string(),
);
return Err(err);
@@ -1356,6 +1358,7 @@ impl PluginsManager {
self.track_plugin_install_failed(
&plugin_id,
plugin_install_error_type(&err),
plugin_install_sub_error_type(&err),
err.to_string(),
);
Err(err)
@@ -1383,6 +1386,7 @@ impl PluginsManager {
self.track_plugin_install_failed(
&plugin_id,
marketplace_error_type(err),
/*sub_error_type*/ None,
err.to_string(),
);
} else {
@@ -1398,11 +1402,13 @@ impl PluginsManager {
&self,
plugin_id: &PluginId,
error_type: &'static str,
sub_error_type: Option<String>,
error_message: String,
) {
tracing::warn!(
plugin_id = %plugin_id.as_key(),
error_type = %error_type,
sub_error_type = sub_error_type.as_deref(),
error = %error_message,
"plugin install failed"
);
@@ -2674,6 +2680,16 @@ fn plugin_install_error_type(err: &PluginInstallError) -> &'static str {
}
}
fn plugin_install_sub_error_type(err: &PluginInstallError) -> Option<String> {
match err {
PluginInstallError::Store(err) => err.sub_error_type(),
PluginInstallError::Marketplace(_)
| PluginInstallError::Remote(_)
| PluginInstallError::Config(_)
| PluginInstallError::Join(_) => None,
}
}
fn marketplace_error_type(err: &MarketplaceError) -> &'static str {
match err {
MarketplaceError::Io { .. } => "marketplace_io",