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>
50 lines
1.5 KiB
Rust
50 lines
1.5 KiB
Rust
use akode_code_mode::CellId;
|
|
use akode_code_mode::CodeModeNestedToolCall;
|
|
use akode_code_mode::CodeModeSessionDelegate;
|
|
use akode_code_mode::NotificationFuture;
|
|
use akode_code_mode::ToolInvocationFuture;
|
|
use akode_protocol::ToolName;
|
|
use pretty_assertions::assert_eq;
|
|
use serde_json::json;
|
|
use tokio::sync::Semaphore;
|
|
use tokio_util::sync::CancellationToken;
|
|
|
|
pub(crate) struct LargeToolResultDelegate {
|
|
pub(crate) started: Semaphore,
|
|
pub(crate) release: Semaphore,
|
|
}
|
|
|
|
impl CodeModeSessionDelegate for LargeToolResultDelegate {
|
|
fn invoke_tool<'a>(
|
|
&'a self,
|
|
invocation: CodeModeNestedToolCall,
|
|
_cancellation: CancellationToken,
|
|
) -> ToolInvocationFuture<'a> {
|
|
Box::pin(async move {
|
|
if invocation.tool_name == ToolName::plain("fast") {
|
|
return Ok(json!({ "value": "isolated" }));
|
|
}
|
|
assert_eq!(invocation.tool_name, ToolName::plain("large"));
|
|
self.started.add_permits(/*n*/ 1);
|
|
self.release
|
|
.acquire()
|
|
.await
|
|
.map_err(|_| "large tool release closed".to_string())?
|
|
.forget();
|
|
Ok(json!({ "value": "x".repeat(8 * 1024 * 1024) }))
|
|
})
|
|
}
|
|
|
|
fn notify<'a>(
|
|
&'a self,
|
|
_call_id: String,
|
|
_cell_id: CellId,
|
|
_text: String,
|
|
_cancellation: CancellationToken,
|
|
) -> NotificationFuture<'a> {
|
|
Box::pin(async { Ok(()) })
|
|
}
|
|
|
|
fn cell_closed(&self, _cell_id: &CellId) {}
|
|
}
|