Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
33 lines
1.2 KiB
Rust
33 lines
1.2 KiB
Rust
//! Reads registered agent identity, status and settings without restoring a runtime.
|
|
//! Known unloaded agents stay distinct from missing identities and backend failures.
|
|
|
|
use super::LocalAgentControl;
|
|
use crate::agent::api::AgentInfo;
|
|
use crate::agent::types::LiveAgent;
|
|
use akode_protocol::ThreadId;
|
|
use akode_protocol::error::CodexErrorDetails;
|
|
use akode_protocol::error::Result as CodexResult;
|
|
|
|
impl LocalAgentControl {
|
|
pub(super) async fn inspect_agent(&self, thread_id: ThreadId) -> CodexResult<AgentInfo> {
|
|
let manager = self.runtime.upgrade()?;
|
|
let thread = match manager.get_thread(thread_id).await {
|
|
Ok(thread) => thread,
|
|
Err(err) if matches!(err.details(), CodexErrorDetails::ThreadNotFound(_)) => {
|
|
return Ok(AgentInfo::Unloaded(
|
|
self.runtime.ensure_agent_known(thread_id)?,
|
|
));
|
|
}
|
|
Err(err) => return Err(err),
|
|
};
|
|
Ok(AgentInfo::Loaded {
|
|
agent: LiveAgent {
|
|
thread_id,
|
|
metadata: self.get_agent_metadata(thread_id).unwrap_or_default(),
|
|
status: thread.agent_status().await,
|
|
},
|
|
config: Box::new(thread.config_snapshot().await),
|
|
})
|
|
}
|
|
}
|