Files
imeai-aKode/akode-rs/akode-mcp
andrea.difonzo 6d4c830805 aKode: consegna delle sessioni al server memoria (memory_ingest_session)
- ext/memoria: trascrizione compatta e cumulativa del thread (utente, risposte
  finali senza commentary, comandi con output troncato a ~1500 caratteri,
  file modificati, ricerche web, altri server MCP; le chiamate al server
  memoria sono ignorate), limite di ~150k caratteri tenendo il primo
  messaggio e i turni più recenti, external_context (web, other_mcp).
- Consegna con reason "idle" dopo `[memoria] deliver_idle_minutes` minuti di
  inattività (predefinito 10, il timer si annulla a ogni nuovo turno) e con
  reason "end" alla chiusura del thread (al massimo 5 s, poi rinuncia).
  Solo se ci sono turni nuovi dall'ultima consegna accettata (queued,
  duplicate, skipped); `[memoria] deliver_sessions = false` la spegne. Solo
  thread dell'utente, con il plugin memoria attivo e il server pronto.
- akode-mcp: McpResourceClient::call_tool e McpConnectionSet::call_host_tool
  per le chiamate dell'host a strumenti non elencati e fuori dal filtro
  enabled_tools (il filtro resta per il modello).
- extension-api: on_thread_closing, chiamato a inizio chiusura quando i server
  MCP sono ancora connessi (on_thread_stop arriva dopo il loro arresto).
- Test sul modello di ext/memoria/src/tests.rs: ruoli, compattazione,
  esclusione del server memoria, external_context, nessuna consegna senza
  turni nuovi, errori, timer di inattività; test del percorso host in
  akode-mcp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:49:51 +01:00
..

Codex MCP runtime

This crate manages Codex's MCP connections, tool calls, and their captured authority.

Sandbox request metadata

An MCP server advertises the experimental codex/sandbox-state capability to receive sandbox metadata on tool calls. The deprecated capability name codex/sandbox-state-meta opts into the same contract during migration.

Codex supplies these entries in the request's _meta object:

Key Value
codex/sandbox-state Opaque policy to pass to akode sandbox --sandbox-state-json.
codex/sandbox-state-meta An identical copy of that policy under the deprecated name.
codex/sandbox-launcher When available, an object with an absolute codexExecutable path to a verified full Codex CLI on the MCP server's host.

Use the launcher path to invoke sandbox --sandbox-state-json with the entire state value serialized as one argument, followed by -- and the command to run. The state contains neither launcher discovery data nor deprecation messages. Preserve unknown policy fields by forwarding the original value rather than deserializing and reconstructing it. The two state names are aliases, not separate policies; new consumers should prefer codex/sandbox-state.

Launcher metadata is currently available only for local stdio servers. An HTTP endpoint, including loopback, or a remote executor does not establish a shared filesystem with the harness. Codex omits the launcher when its path is unknown, not representable as UTF-8, or fails the cached capability probe. Absence does not authorize a PATH search or unsandboxed fallback. Servers that require a launcher must fail closed or require an explicit operator opt-out.

The state and launcher describe the issuing call. Retain both when starting a long-lived subprocess or caching policy-bound results; reject changed authority before reusing them. Tool arguments supplied by the model are not authority. See sandbox_metadata.rs for the wire types and binding.rs for execution-environment selection.