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:
@@ -1,9 +1,9 @@
|
||||
//! Reports v2 readiness without exposing memory contents or persistence details to clients.
|
||||
//! Memoria nativa rimossa: lo stato v2 resta nel protocollo per compatibilità e risponde
|
||||
//! sempre «non pronto», senza aprire database né cartelle.
|
||||
|
||||
use super::*;
|
||||
use akode_app_server_protocol::MemoryStatusParams;
|
||||
use akode_app_server_protocol::MemoryStatusResponse;
|
||||
use akode_protocol::MemoryVersion;
|
||||
|
||||
impl ThreadRequestProcessor {
|
||||
pub(crate) async fn memory_status(
|
||||
@@ -16,42 +16,10 @@ impl ThreadRequestProcessor {
|
||||
"minConsolidatedThreads must be between 1 and 4096",
|
||||
));
|
||||
}
|
||||
let db = self
|
||||
.state_db
|
||||
.as_ref()
|
||||
.ok_or_else(|| internal_error("sqlite state db unavailable for memory status"))?;
|
||||
let store = db
|
||||
.memories_for_version(MemoryVersion::V2)
|
||||
.await
|
||||
.map_err(|error| internal_error(format!("failed to open v2 memory state: {error}")))?;
|
||||
let count = store
|
||||
.max_consolidated_thread_count()
|
||||
.await
|
||||
.map_err(|error| internal_error(format!("failed to read memory progress: {error}")))?;
|
||||
let root = self
|
||||
.config
|
||||
.codex_home
|
||||
.join(MemoryVersion::V2.directory_name());
|
||||
let summary = tokio::fs::read_to_string(root.join("memory_summary.md"))
|
||||
.await
|
||||
.ok();
|
||||
let has_v1_workspace = tokio::fs::try_exists(
|
||||
self.config
|
||||
.codex_home
|
||||
.join(MemoryVersion::V1.directory_name()),
|
||||
)
|
||||
.await
|
||||
.map_err(|error| internal_error(format!("failed to check v1 memory workspace: {error}")))?;
|
||||
// Fresh profiles can start on V2 without consolidating any V1 history first.
|
||||
let ready = !has_v1_workspace
|
||||
|| count >= minimum
|
||||
&& summary
|
||||
.as_deref()
|
||||
.is_some_and(akode_memories_write::workspace::is_valid_v2_summary);
|
||||
Ok(Some(
|
||||
MemoryStatusResponse {
|
||||
v2_consolidated_threads: count,
|
||||
v2_ready: ready,
|
||||
v2_consolidated_threads: 0,
|
||||
v2_ready: false,
|
||||
}
|
||||
.into(),
|
||||
))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//! Reads memory context from the loaded thread's resolved version, without fallback.
|
||||
//! Memoria nativa rimossa: la lettura del riassunto resta nel protocollo per compatibilità
|
||||
//! e risponde sempre senza riassunto.
|
||||
|
||||
use super::*;
|
||||
use akode_app_server_protocol::ThreadMemoryReadParams;
|
||||
@@ -9,22 +10,8 @@ impl ThreadRequestProcessor {
|
||||
&self,
|
||||
params: ThreadMemoryReadParams,
|
||||
) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
|
||||
let (_, thread) = self.load_thread(¶ms.thread_id).await?;
|
||||
let config = thread.config().await;
|
||||
let summary =
|
||||
if config.features.enabled(Feature::MemoryTool) && config.memories.use_memories {
|
||||
tokio::fs::read_to_string(
|
||||
config
|
||||
.codex_home
|
||||
.join(config.memories.version.directory_name())
|
||||
.join("memory_summary.md"),
|
||||
)
|
||||
.await
|
||||
.ok()
|
||||
.filter(|summary| !summary.trim().is_empty())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
Ok(Some(ThreadMemoryReadResponse { summary }.into()))
|
||||
// Il thread deve comunque esistere, come prima.
|
||||
self.load_thread(¶ms.thread_id).await?;
|
||||
Ok(Some(ThreadMemoryReadResponse { summary: None }.into()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,6 +535,8 @@ enum RunningThreadResumeResult {
|
||||
NotRunning(Option<Box<StoredThread>>),
|
||||
}
|
||||
|
||||
pub(crate) const MEMORY_RESET_UNSUPPORTED: &str = "memoryReset non supportato: la memoria nativa è stata rimossa da aKode (la memoria a lungo termine è il plugin memoria di imeAI).";
|
||||
|
||||
impl ThreadRequestProcessor {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub(crate) fn new(
|
||||
@@ -2015,25 +2017,9 @@ impl ThreadRequestProcessor {
|
||||
}
|
||||
|
||||
async fn memory_reset_response_inner(&self) -> Result<MemoryResetResponse, JSONRPCErrorError> {
|
||||
let state_db = self
|
||||
.state_db
|
||||
.clone()
|
||||
.ok_or_else(|| internal_error("sqlite state db unavailable for memory reset"))?;
|
||||
|
||||
state_db.clear_all_memory_data().await.map_err(|err| {
|
||||
internal_error(format!("failed to clear memory rows in memories db: {err}"))
|
||||
})?;
|
||||
|
||||
clear_memory_roots_contents(&self.config.codex_home)
|
||||
.await
|
||||
.map_err(|err| {
|
||||
internal_error(format!(
|
||||
"failed to clear memory directories under {}: {err}",
|
||||
self.config.codex_home.display()
|
||||
))
|
||||
})?;
|
||||
|
||||
Ok(MemoryResetResponse {})
|
||||
// La memoria nativa ereditata da Codex è stata rimossa: il metodo resta nel
|
||||
// protocollo per compatibilità con client e daemon, ma non fa nulla.
|
||||
Err(crate::error_code::invalid_request(MEMORY_RESET_UNSUPPORTED))
|
||||
}
|
||||
|
||||
async fn thread_metadata_update_response_inner(
|
||||
|
||||
@@ -521,7 +521,7 @@ impl TurnRequestProcessor {
|
||||
app_server_client_name: Option<String>,
|
||||
app_server_client_version: Option<String>,
|
||||
) -> Result<TurnStartResponse, JSONRPCErrorError> {
|
||||
let (thread_id, thread) = self.load_thread(¶ms.thread_id).await?;
|
||||
let (_thread_id, thread) = self.load_thread(¶ms.thread_id).await?;
|
||||
self.ensure_direct_input_allowed(&request_id, thread.as_ref())
|
||||
.await?;
|
||||
self.config_manager
|
||||
@@ -580,7 +580,6 @@ impl TurnRequestProcessor {
|
||||
let environment_requests =
|
||||
resolve_turn_environment_requests(self.thread_manager.as_ref(), params.environments)?;
|
||||
|
||||
let turn_has_input = !params.input.is_empty();
|
||||
let input = if let Some(tool_output) = params.tool_output {
|
||||
let item = ResponseItem::FunctionCallOutput {
|
||||
id: None,
|
||||
@@ -668,7 +667,7 @@ impl TurnRequestProcessor {
|
||||
};
|
||||
error
|
||||
})?;
|
||||
let (turn_id, root_turn_id, started) = match submission {
|
||||
let (turn_id, root_turn_id) = match submission {
|
||||
TurnInputSubmission::Accepted => {
|
||||
return Err(internal_error(
|
||||
"user input unexpectedly returned agent acceptance".to_string(),
|
||||
@@ -677,11 +676,11 @@ impl TurnRequestProcessor {
|
||||
TurnInputSubmission::Started {
|
||||
turn_id,
|
||||
root_turn_id,
|
||||
} => (turn_id, root_turn_id, true),
|
||||
} => (turn_id, root_turn_id),
|
||||
TurnInputSubmission::Steered {
|
||||
turn_id,
|
||||
root_turn_id,
|
||||
} => (turn_id, root_turn_id, false),
|
||||
} => (turn_id, root_turn_id),
|
||||
TurnInputSubmission::NotSubmitted { reason } => {
|
||||
let error = if reason == NotSubmittedReason::ServerDraining {
|
||||
crate::error_code::server_draining_error()
|
||||
@@ -692,20 +691,6 @@ impl TurnRequestProcessor {
|
||||
}
|
||||
};
|
||||
|
||||
if turn_has_input && started {
|
||||
let config_snapshot = thread.config_snapshot().await;
|
||||
if config_snapshot.is_primary_environment_configured() {
|
||||
akode_memories_write::start_memories_startup_task(
|
||||
Arc::clone(&self.thread_manager),
|
||||
thread_id,
|
||||
Arc::clone(&thread),
|
||||
thread.config().await,
|
||||
config_snapshot.permission_profile,
|
||||
&config_snapshot.session_source,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
self.outgoing
|
||||
.record_request_turn_id(&request_id, &turn_id)
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user