aKode fase 5: test e snapshot adeguati alla rinomina, 429 distinto (ProviderRateLimited), cargo fmt dopo il cambio dei prefissi

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 12:47:01 +01:00
parent 8b73331037
commit ad43f9281a
919 changed files with 2358 additions and 2430 deletions

View File

@@ -62,7 +62,7 @@ fn config_error_from_io(err: &std::io::Error) -> &ConfigError {
fn mdm_requirement_source() -> RequirementSource {
RequirementSource::MdmManagedPreferences {
domain: "com.openai.codex".to_string(),
domain: "net.difonzo.akode".to_string(),
key: "requirements_toml_base64".to_string(),
}
}
@@ -1199,8 +1199,8 @@ flag = false
#[tokio::test]
async fn managed_preferences_expand_home_directory_in_workspace_write_roots() -> anyhow::Result<()>
{
use base64::Engine;
use akode_protocol::protocol::SandboxPolicy;
use base64::Engine;
let Some(home) = dirs::home_dir() else {
return Ok(());
@@ -1568,7 +1568,7 @@ allowed_approval_policies = ["on-request"]
candidate: "Never".into(),
allowed: "[OnRequest]".into(),
requirement_source: RequirementSource::MdmManagedPreferences {
domain: "com.openai.codex".to_string(),
domain: "net.difonzo.akode".to_string(),
key: "requirements_toml_base64".to_string(),
},
})

View File

@@ -4,7 +4,6 @@ use crate::config::edit::apply_blocking;
use crate::context::ContextualUserFragment;
use crate::plugins::plugins_manager_for_config;
use crate::session::multi_agents::resolve_usage_hints;
use assert_matches::assert_matches;
use akode_config::CONFIG_TOML_FILE;
use akode_config::ConfigLayerEntry;
use akode_config::ConfigLayerSource;
@@ -102,6 +101,7 @@ use akode_protocol::protocol::RealtimeVoice;
use akode_protocol::protocol::SandboxPolicy;
use akode_protocol_test_support::ContentItemTestExt;
use akode_utils_path_uri::LegacyAppPathString;
use assert_matches::assert_matches;
use serde::Deserialize;
use tempfile::tempdir;
@@ -4147,7 +4147,7 @@ async fn permissions_profiles_allow_unknown_special_paths() -> std::io::Result<(
);
assert!(
config.startup_warnings.iter().any(|warning| warning.contains(
"Configured filesystem path `:future_special_path` is not recognized by this version of Codex and will be ignored."
"Configured filesystem path `:future_special_path` is not recognized by this version of aKode and will be ignored."
)),
"{:?}",
config.startup_warnings
@@ -4188,7 +4188,7 @@ async fn permissions_profiles_allow_unknown_special_paths_with_nested_entries()
);
assert!(
config.startup_warnings.iter().any(|warning| warning.contains(
"Configured filesystem path `:future_special_path` with nested entry `docs` is not recognized by this version of Codex and will be ignored."
"Configured filesystem path `:future_special_path` with nested entry `docs` is not recognized by this version of aKode and will be ignored."
)),
"{:?}",
config.startup_warnings
@@ -4219,7 +4219,7 @@ async fn permissions_profiles_allow_missing_filesystem_with_warning() -> std::io
);
assert!(
config.startup_warnings.iter().any(|warning| warning.contains(
"Permissions profile `dev` does not define any recognized filesystem entries for this version of Codex."
"Permissions profile `dev` does not define any recognized filesystem entries for this version of aKode."
)),
"{:?}",
config.startup_warnings
@@ -4247,7 +4247,7 @@ async fn permissions_profiles_allow_empty_filesystem_with_warning() -> std::io::
);
assert!(
config.startup_warnings.iter().any(|warning| warning.contains(
"Permissions profile `dev` does not define any recognized filesystem entries for this version of Codex."
"Permissions profile `dev` does not define any recognized filesystem entries for this version of aKode."
)),
"{:?}",
config.startup_warnings
@@ -11138,7 +11138,7 @@ sandbox_mode = "danger-full-access"
assert_eq!(err.kind(), std::io::ErrorKind::InvalidInput);
assert_eq!(
err.to_string(),
"`approval_policy = \"never\"` cannot be used because requirements do not allow `sandbox_mode = \"danger-full-access\"`; Codex would fall back to read-only permissions with approvals disabled. Choose an `approval_policy` based on what you need, such as `on-request`, or choose an allowed sandbox mode."
"`approval_policy = \"never\"` cannot be used because requirements do not allow `sandbox_mode = \"danger-full-access\"`; aKode would fall back to read-only permissions with approvals disabled. Choose an `approval_policy` based on what you need, such as `on-request`, or choose an allowed sandbox mode."
);
Ok(())
}
@@ -11172,7 +11172,7 @@ default_permissions = "dev"
assert_eq!(err.kind(), std::io::ErrorKind::InvalidInput);
assert_eq!(
err.to_string(),
"`approval_policy = \"never\"` cannot be used because requirements do not allow `sandbox_mode = \"danger-full-access\"`; Codex would fall back to read-only permissions with approvals disabled. Choose an `approval_policy` based on what you need, such as `on-request`, or choose an allowed sandbox mode."
"`approval_policy = \"never\"` cannot be used because requirements do not allow `sandbox_mode = \"danger-full-access\"`; aKode would fall back to read-only permissions with approvals disabled. Choose an `approval_policy` based on what you need, such as `on-request`, or choose an allowed sandbox mode."
);
Ok(())
}
@@ -11710,7 +11710,7 @@ fn retired_feature_requirements_do_not_pin_configured_values(
..Default::default()
},
RequirementSource::MdmManagedPreferences {
domain: "com.openai.codex".to_string(),
domain: "net.difonzo.akode".to_string(),
key: "requirements_toml_base64".to_string(),
},
);

View File

@@ -1,6 +1,5 @@
use crate::path_utils::resolve_symlink_write_paths;
use crate::path_utils::write_atomically;
use anyhow::Context;
use akode_config::CONFIG_TOML_FILE;
use akode_config::is_structured_feature_path;
use akode_config::types::McpServerConfig;
@@ -11,6 +10,7 @@ use akode_features::FEATURES;
use akode_protocol::config_types::ServiceTier;
use akode_protocol::config_types::TrustLevel;
use akode_protocol::openai_models::ReasoningEffort;
use anyhow::Context;
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::collections::HashSet;

View File

@@ -1,4 +1,3 @@
use anyhow::Context;
use akode_config::types::AppToolApproval;
use akode_config::types::McpServerAuth;
use akode_config::types::McpServerConfig;
@@ -8,6 +7,7 @@ use akode_config::types::McpServerTransportConfig;
use akode_config::types::McpStartupReadiness;
use akode_config::types::ToolSuggestDisabledTool;
use akode_config::types::ToolSuggestDiscoverableType;
use anyhow::Context;
use toml_edit::Array as TomlArray;
use toml_edit::InlineTable;
use toml_edit::Item as TomlItem;

View File

@@ -4,7 +4,6 @@
use super::*;
use crate::config::ConfigBuilder;
use anyhow::Context;
use akode_execpolicy::Decision;
use akode_execpolicy::NetworkRuleProtocol::Https;
use akode_http_client::HttpClientBuilder;
@@ -16,6 +15,7 @@ use akode_protocol::permissions::NetworkSandboxPolicy::Enabled;
use akode_protocol::permissions::NetworkSandboxPolicy::Restricted;
use akode_protocol::protocol::AskForApproval::Never;
use akode_protocol::protocol::AskForApproval::OnRequest;
use anyhow::Context;
use http::StatusCode;
use pretty_assertions::assert_eq;
use serde_json::Value;

View File

@@ -185,8 +185,6 @@ pub(crate) use runtime_refresh::RuntimeConfigRefresh;
mod schema;
mod token_budget_startup;
mod windows_sandbox_config;
pub use auth_keyring::bootstrap_auth_config;
pub use auth_keyring::resolve_bootstrap_auth_keyring_backend_kind;
pub use akode_agent_roles::AgentRoleConfig;
pub use akode_config::ConfigLoadOptions;
pub use akode_config::Constrained;
@@ -196,6 +194,8 @@ pub use akode_config::LoaderOverrides;
pub use akode_network_proxy::NetworkProxyAuditMetadata;
use akode_sandboxing::compatibility_sandbox_policy_for_permission_profile;
pub use akode_sandboxing::system_bwrap_warning;
pub use auth_keyring::bootstrap_auth_config;
pub use auth_keyring::resolve_bootstrap_auth_keyring_backend_kind;
pub use managed_features::ManagedFeatures;
pub(crate) use metrics::emit_session_start_metrics;
pub(crate) use metrics::legacy_multi_agent_disabled_sources;

View File

@@ -32,16 +32,16 @@ fn active_arg0_helper_dir_selects_only_the_first_session_alias_directory() -> an
.path()
.join("tmp")
.join(format!("arg0-{foreign_os}"))
.join("codex-arg0-foreign");
.join("akode-arg0-foreign");
for arg0_root in [&platform_root, &legacy_root] {
let active = arg0_root.join("codex-arg0-active");
let active = arg0_root.join("akode-arg0-active");
let paths = std::env::join_paths([
home.path().join("bin"),
foreign_alias.clone(),
arg0_root.clone(),
arg0_root.join("unrelated"),
active.clone(),
arg0_root.join("codex-arg0-parent"),
arg0_root.join("akode-arg0-parent"),
])?;
assert_eq!(
active_arg0_helper_dir(home.path(), &paths),