aKode: rimossa la memoria nativa di Codex e le funzioni senza codice; meno chiamate al modello
Memoria nativa (memories) rimossa del tutto: - features: memories, memory_tool, external_agent_memory_import, chronicle (alias telepathy) diventano Removed; le chiavi restano accettate e memories/memory_tool/[memories] producono un solo avviso senza link («La sezione [memories] e la chiave memory_tool non sono più usate da aKode: la memoria a lungo termine è il plugin memoria di imeAI.»). - Tolti i crate memories/read, memories/write ed ext/memories, l'avvio della pipeline a ogni turno (app-server), l'estensione, /memories e la richiesta di attivazione nella TUI, `akode debug clear-memories`, l'importazione delle memorie da altri agenti (memory_import.rs, detect/memory.rs; il resto di /import resta). - core: niente più MemoriesConfig, citazioni delle memorie, metriche e marcatura «polluted» dei thread; [memories] (MemoriesToml) resta solo come sezione accettata e ignorata. - state: memories_1.sqlite e memories_v2_1.sqlite non vengono più aperti né cancellati; la colonna threads.memory_mode resta, nessuna migrazione. - Protocollo app-server invariato per compatibilità col daemon: memory/reset risponde «non supportato» senza cancellare nulla, memory/status non è mai pronto, thread/memory/read non ha riassunto. Altre rimozioni: - I 14 flag dell'app desktop di OpenAI senza codice (tool_suggest, in_app_*, browser_use*, computer_use, bedrock_setup_wizard, workspace_dependencies) e analytics_plan_history: Removed, chiavi accettate; analytics_plan_history esce da /experimental. - Skill: tolto l'esperimento «shadow selection» e i selettori collegati. Meno chiamate al modello non richieste: - Titoli dei thread: il primo messaggio dell'utente su una riga, troncato a 36 caratteri; `[tui] auto_title = true` riattiva i titoli generati. - `[tui] auto_recap` predefinito false; `goals` spento di default. Privacy: installation_id e gli id di sessione/thread/finestra (e il blocco dei metadati del turno che li ripete) vanno in client_metadata e negli header di compatibilità solo ai provider locali (loopback, IP privati 10/8, 172.16/12, 192.168/16, host .local/.lan). Domini OpenAI: tolti i link visibili (avviso dei flag deprecati, profili, bubblewrap), l'attribuzione Codex nei commit (sempre spenta), la riscrittura dell'URL della documentazione OpenAI via MCP e la registrazione remota dell'exec-server verso host OpenAI (ora solo loopback); il riconoscimento delle destinazioni OpenAI confronta i domini etichetta per etichetta. Il binario non contiene più «openai.com» né «chatgpt.com». Test adattati (sicurezza compresa: guardian, ruolo ostile, exec-server ora più restrittivo); rimossi solo quelli del codice tolto. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -501,13 +501,13 @@ pub struct ConfigToml {
|
||||
/// Settings for the main agent loop (e.g. loop protection).
|
||||
pub agent: Option<AgentToml>,
|
||||
|
||||
/// Settings for the imeAI `memoria` plugin (session-start briefing).
|
||||
/// Settings for the imeAI `memoria` plugin (session-start briefing, session delivery).
|
||||
pub memoria: Option<MemoriaToml>,
|
||||
|
||||
/// Goal-related settings.
|
||||
pub goals: Option<GoalsToml>,
|
||||
|
||||
/// Memories subsystem settings.
|
||||
/// Removed native memories (`[memories]`): accepted for old configs and ignored.
|
||||
pub memories: Option<MemoriesToml>,
|
||||
|
||||
/// User-level skill config entries keyed by SKILL.md path.
|
||||
@@ -793,7 +793,7 @@ pub struct AgentToml {
|
||||
pub announce_nudges: Option<u32>,
|
||||
}
|
||||
|
||||
/// `[memoria]` table: session-start briefing of the imeAI `memoria` plugin.
|
||||
/// `[memoria]` table: session-start briefing and session delivery of the imeAI `memoria` plugin.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
pub struct MemoriaToml {
|
||||
@@ -806,6 +806,13 @@ pub struct MemoriaToml {
|
||||
pub briefing_timeout_ms: Option<u64>,
|
||||
/// Token budget requested from the server for the briefing. Default: 1500 (300-3000).
|
||||
pub briefing_max_tokens: Option<u32>,
|
||||
/// Deliver a compact transcript of each session to the memoria server (tool
|
||||
/// `memory_ingest_session`, called by aKode itself, never by the model) when the thread has
|
||||
/// been idle for `deliver_idle_minutes` and when it closes. Default: true. Only used while the
|
||||
/// `memoria` plugin is enabled and its MCP server is ready.
|
||||
pub deliver_sessions: Option<bool>,
|
||||
/// Minutes of inactivity before an idle session is delivered. Default: 10 (1-1440).
|
||||
pub deliver_idle_minutes: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema)]
|
||||
|
||||
@@ -288,7 +288,7 @@ pub async fn load_config_layers_state(
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::InvalidData,
|
||||
format!(
|
||||
"--profile `{active_user_profile}` cannot be used while {} contains legacy `profile = \"{active_user_profile}\"` or `[profiles.{active_user_profile}]` config; move those settings into {} and remove the legacy profile selector/table. See https://developers.openai.com/codex/config-advanced#profiles for more information.",
|
||||
"--profile `{active_user_profile}` cannot be used while {} contains legacy `profile = \"{active_user_profile}\"` or `[profiles.{active_user_profile}]` config; move those settings into {} and remove the legacy profile selector/table.",
|
||||
base_user_file.as_path().display(),
|
||||
active_user_file.as_path().display()
|
||||
),
|
||||
|
||||
@@ -898,7 +898,7 @@ model = "gpt-work"
|
||||
"unexpected error message: {message}"
|
||||
);
|
||||
assert!(
|
||||
message.contains("https://developers.openai.com/codex/config-advanced#profiles"),
|
||||
!message.contains("http"),
|
||||
"unexpected error message: {message}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ pub use akode_protocol::config_types::AltScreenMode;
|
||||
pub use akode_protocol::config_types::ApprovalsReviewer;
|
||||
pub use akode_protocol::config_types::ModeKind;
|
||||
pub use akode_protocol::config_types::Personality;
|
||||
use akode_protocol::config_types::SERVICE_TIER_DEFAULT_REQUEST_VALUE;
|
||||
pub use akode_protocol::config_types::ServiceTier;
|
||||
use akode_protocol::config_types::ToolExposureSurface;
|
||||
pub use akode_protocol::config_types::WebSearchMode;
|
||||
@@ -49,17 +48,6 @@ pub use crate::tui_keymap::TuiVimOperatorKeymap;
|
||||
pub use crate::tui_keymap::TuiVimSearchKeymap;
|
||||
pub use crate::tui_rendering::TuiRendering;
|
||||
|
||||
pub const DEFAULT_MEMORIES_MAX_ROLLOUTS_PER_STARTUP: usize = 2;
|
||||
pub const DEFAULT_MEMORIES_MAX_ROLLOUT_AGE_DAYS: i64 = 10;
|
||||
pub const DEFAULT_MEMORIES_MIN_ROLLOUT_IDLE_HOURS: i64 = 6;
|
||||
pub const DEFAULT_MEMORIES_MIN_RATE_LIMIT_REMAINING_PERCENT: i64 = 25;
|
||||
pub const DEFAULT_MEMORIES_MAX_RAW_MEMORIES_FOR_CONSOLIDATION: usize = 256;
|
||||
pub const DEFAULT_MEMORIES_MAX_UNUSED_DAYS: i64 = 30;
|
||||
const MIN_MEMORIES_MAX_RAW_MEMORIES_FOR_CONSOLIDATION: usize = 1;
|
||||
const MAX_MEMORIES_MAX_RAW_MEMORIES_FOR_CONSOLIDATION: usize = 4096;
|
||||
const MIN_MEMORIES_MAX_ROLLOUTS_PER_STARTUP: usize = 1;
|
||||
const MAX_MEMORIES_MAX_ROLLOUTS_PER_STARTUP: usize = 128;
|
||||
|
||||
const fn default_enabled() -> bool {
|
||||
true
|
||||
}
|
||||
@@ -348,7 +336,10 @@ pub struct ToolSuggestConfig {
|
||||
|
||||
pub use akode_protocol::MemoryVersion;
|
||||
|
||||
/// Memories settings loaded from config.toml.
|
||||
/// Sezione `[memories]` della memoria nativa ereditata da Codex, rimossa in aKode.
|
||||
///
|
||||
/// La sezione è ancora accettata (le config vecchie si caricano senza errori) ma è
|
||||
/// ignorata: la memoria a lungo termine di aKode è il plugin memoria di imeAI.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
pub struct MemoriesToml {
|
||||
@@ -389,103 +380,6 @@ pub struct MemoriesToml {
|
||||
pub consolidation_service_tier: Option<String>,
|
||||
}
|
||||
|
||||
/// Effective memories settings after defaults are applied.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
|
||||
pub struct MemoriesConfig {
|
||||
pub version: MemoryVersion,
|
||||
pub dual_write: bool,
|
||||
pub disable_on_external_context: bool,
|
||||
pub generate_memories: bool,
|
||||
pub use_memories: bool,
|
||||
pub dedicated_tools: bool,
|
||||
pub max_raw_memories_for_consolidation: usize,
|
||||
pub max_unused_days: i64,
|
||||
pub max_rollout_age_days: i64,
|
||||
pub max_rollouts_per_startup: usize,
|
||||
pub min_rollout_idle_hours: i64,
|
||||
pub min_rate_limit_remaining_percent: i64,
|
||||
pub extract_model: Option<String>,
|
||||
pub consolidation_model: Option<String>,
|
||||
pub consolidation_service_tier: String,
|
||||
}
|
||||
|
||||
impl Default for MemoriesConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
version: MemoryVersion::V1,
|
||||
dual_write: false,
|
||||
disable_on_external_context: false,
|
||||
generate_memories: true,
|
||||
use_memories: true,
|
||||
dedicated_tools: false,
|
||||
max_raw_memories_for_consolidation: DEFAULT_MEMORIES_MAX_RAW_MEMORIES_FOR_CONSOLIDATION,
|
||||
max_unused_days: DEFAULT_MEMORIES_MAX_UNUSED_DAYS,
|
||||
max_rollout_age_days: DEFAULT_MEMORIES_MAX_ROLLOUT_AGE_DAYS,
|
||||
max_rollouts_per_startup: DEFAULT_MEMORIES_MAX_ROLLOUTS_PER_STARTUP,
|
||||
min_rollout_idle_hours: DEFAULT_MEMORIES_MIN_ROLLOUT_IDLE_HOURS,
|
||||
min_rate_limit_remaining_percent: DEFAULT_MEMORIES_MIN_RATE_LIMIT_REMAINING_PERCENT,
|
||||
extract_model: None,
|
||||
consolidation_model: None,
|
||||
consolidation_service_tier: SERVICE_TIER_DEFAULT_REQUEST_VALUE.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MemoriesToml> for MemoriesConfig {
|
||||
fn from(toml: MemoriesToml) -> Self {
|
||||
let defaults = Self::default();
|
||||
Self {
|
||||
version: toml.version.unwrap_or(defaults.version),
|
||||
dual_write: toml.dual_write.unwrap_or(defaults.dual_write),
|
||||
disable_on_external_context: toml
|
||||
.disable_on_external_context
|
||||
.unwrap_or(defaults.disable_on_external_context),
|
||||
generate_memories: toml.generate_memories.unwrap_or(defaults.generate_memories),
|
||||
use_memories: toml.use_memories.unwrap_or(defaults.use_memories),
|
||||
dedicated_tools: toml.dedicated_tools.unwrap_or(defaults.dedicated_tools),
|
||||
max_raw_memories_for_consolidation: toml
|
||||
.max_raw_memories_for_consolidation
|
||||
.unwrap_or(defaults.max_raw_memories_for_consolidation)
|
||||
.clamp(
|
||||
MIN_MEMORIES_MAX_RAW_MEMORIES_FOR_CONSOLIDATION,
|
||||
MAX_MEMORIES_MAX_RAW_MEMORIES_FOR_CONSOLIDATION,
|
||||
),
|
||||
max_unused_days: toml
|
||||
.max_unused_days
|
||||
.unwrap_or(defaults.max_unused_days)
|
||||
.clamp(0, 365),
|
||||
max_rollout_age_days: toml
|
||||
.max_rollout_age_days
|
||||
.unwrap_or(defaults.max_rollout_age_days)
|
||||
.clamp(0, 90),
|
||||
max_rollouts_per_startup: toml
|
||||
.max_rollouts_per_startup
|
||||
.unwrap_or(defaults.max_rollouts_per_startup)
|
||||
.clamp(
|
||||
MIN_MEMORIES_MAX_ROLLOUTS_PER_STARTUP,
|
||||
MAX_MEMORIES_MAX_ROLLOUTS_PER_STARTUP,
|
||||
),
|
||||
min_rollout_idle_hours: toml
|
||||
.min_rollout_idle_hours
|
||||
.unwrap_or(defaults.min_rollout_idle_hours)
|
||||
.clamp(1, 48),
|
||||
min_rate_limit_remaining_percent: toml
|
||||
.min_rate_limit_remaining_percent
|
||||
.unwrap_or(defaults.min_rate_limit_remaining_percent)
|
||||
.clamp(0, 100),
|
||||
extract_model: toml.extract_model,
|
||||
consolidation_model: toml.consolidation_model,
|
||||
consolidation_service_tier: toml
|
||||
.consolidation_service_tier
|
||||
.map(|tier| {
|
||||
ServiceTier::from_request_value(&tier)
|
||||
.map_or(tier, |tier| tier.request_value().to_string())
|
||||
})
|
||||
.unwrap_or(defaults.consolidation_service_tier),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Default settings that apply to all apps.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
@@ -838,10 +732,15 @@ pub struct Tui {
|
||||
pub show_server_version_notice: bool,
|
||||
|
||||
/// Generate automatic conversation recaps when the terminal is unfocused.
|
||||
/// Defaults to `true`. Disabling this leaves `/recap` available on demand.
|
||||
#[serde(default = "default_true")]
|
||||
/// Defaults to `false` (each recap is a model request). `/recap` is always available on demand.
|
||||
#[serde(default)]
|
||||
pub auto_recap: bool,
|
||||
|
||||
/// Ask the model for a title for each new thread. Defaults to `false`: the title is the
|
||||
/// first user message truncated to one line. `/rename` can still suggest a title on demand.
|
||||
#[serde(default)]
|
||||
pub auto_title: bool,
|
||||
|
||||
/// When true, disables burst-paste detection for typed input entirely.
|
||||
/// All characters are inserted as they are received, and no buffering
|
||||
/// or placeholder replacement will occur for fast keypress bursts.
|
||||
|
||||
@@ -124,66 +124,19 @@ fn deserialize_skill_config_with_path_selector() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn memories_config_clamps_count_limits_to_nonzero_values() {
|
||||
let config = MemoriesConfig::from(MemoriesToml {
|
||||
max_raw_memories_for_consolidation: Some(0),
|
||||
max_rollouts_per_startup: Some(0),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
assert_eq!(
|
||||
config,
|
||||
MemoriesConfig {
|
||||
max_raw_memories_for_consolidation: 1,
|
||||
max_rollouts_per_startup: 1,
|
||||
..MemoriesConfig::default()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn memories_config_clamps_rate_limit_remaining_threshold() {
|
||||
let config = MemoriesConfig::from(MemoriesToml {
|
||||
min_rate_limit_remaining_percent: Some(101),
|
||||
..Default::default()
|
||||
});
|
||||
assert_eq!(
|
||||
config,
|
||||
MemoriesConfig {
|
||||
min_rate_limit_remaining_percent: 100,
|
||||
..MemoriesConfig::default()
|
||||
}
|
||||
);
|
||||
|
||||
let config = MemoriesConfig::from(MemoriesToml {
|
||||
min_rate_limit_remaining_percent: Some(-1),
|
||||
..Default::default()
|
||||
});
|
||||
assert_eq!(
|
||||
config,
|
||||
MemoriesConfig {
|
||||
min_rate_limit_remaining_percent: 0,
|
||||
..MemoriesConfig::default()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn memories_version_selects_pipeline_without_changing_other_defaults() {
|
||||
for (source, version) in [
|
||||
("", MemoryVersion::V1),
|
||||
("version = \"v2\"", MemoryVersion::V2),
|
||||
] {
|
||||
let parsed: MemoriesToml = toml::from_str(source).expect("parse memories config");
|
||||
assert_eq!(
|
||||
MemoriesConfig::from(parsed),
|
||||
MemoriesConfig {
|
||||
version,
|
||||
..Default::default()
|
||||
}
|
||||
);
|
||||
}
|
||||
assert!(toml::from_str::<MemoriesToml>("version = \"v3\"").is_err());
|
||||
fn removed_memories_section_still_parses() {
|
||||
// La sezione [memories] è ignorata ma deve restare accettata per le config vecchie.
|
||||
let parsed: MemoriesToml = toml::from_str(
|
||||
r#"
|
||||
version = "v2"
|
||||
dual_write = true
|
||||
generate_memories = true
|
||||
use_memories = true
|
||||
extract_model = "qwen"
|
||||
"#,
|
||||
)
|
||||
.expect("la sezione [memories] deve restare accettata");
|
||||
assert_eq!(parsed.version, Some(MemoryVersion::V2));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user