feat(agent): routage LaunchAgent structuré vs PTY + réconciliation A/B (D3) — §17
- LaunchAgent route sur profile.structured_adapter : Some ⇒ AgentSession via
factory + enregistrement StructuredSessions (aucun pty.spawn) ; None ⇒ PTY
inchangé. Dépendances structurées injectées par builders additifs
with_structured (signatures publiques inchangées ⇒ A/B legacy verts).
- LaunchAgentOutput étendu d'un champ optionnel structured (non cassant).
- A (ChangeAgentProfile) : kill polymorphe — session structurée ⇒ shutdown(),
PTY ⇒ kill ; détection sur les deux registres.
- B : resume_supported vrai pour profil structuré ; resolve_session_plan ⇒
Resume{conversation_id} (Claude --resume / Codex exec resume).
- Codex : build_spawn_line porte --sandbox workspace-write --ask-for-approval
never (autonomie d'écriture ; à terme piloté par les permissions).
Tests : structured_launch 8 + codex flags 2 ; application/infrastructure 0 échec.
Reste D4 : ChatBridge (Channel) + commandes agent_send/reattach + StructuredSessions
dans AppState + DTO cellKind/ReplyChunk.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -142,13 +142,18 @@ impl CodexExecSession {
|
||||
/// Compose la ligne de commande d'un tour.
|
||||
///
|
||||
/// Format RÉEL vérifié 2026-06-09 :
|
||||
/// - Conversation neuve : `codex exec --json --skip-git-repo-check <prompt>`.
|
||||
/// - Conversation neuve : `codex exec --json --skip-git-repo-check
|
||||
/// --sandbox workspace-write --ask-for-approval never <prompt>`.
|
||||
/// - Reprise (id connu) : `codex exec resume <thread_id> --json
|
||||
/// --skip-git-repo-check <prompt>`.
|
||||
/// --skip-git-repo-check --sandbox workspace-write --ask-for-approval never
|
||||
/// <prompt>`.
|
||||
///
|
||||
/// NOTE intégration (D3, hors parsing) : pour qu'un agent puisse **écrire**, le
|
||||
/// lancement devra ajouter `--sandbox workspace-write` + une politique
|
||||
/// d'approbation non bloquante. Ce n'est pas le rôle de cette composition.
|
||||
/// **Autonomie d'écriture (D3)** : `--sandbox workspace-write` autorise l'agent à
|
||||
/// écrire dans son workspace et `--ask-for-approval never` évite tout blocage sur
|
||||
/// une demande d'approbation interactive (un tour structuré non-interactif ne peut
|
||||
/// répondre à un prompt). Défaut raisonnable, aligné sur l'autonomie projet
|
||||
/// (CLAUDE.md §12) ; à terme **piloté par les permissions de l'agent**
|
||||
/// (`.ideai/permissions.json` + sandbox OS) — non implémenté ici.
|
||||
fn build_spawn_line(&self, prompt: &str) -> SpawnLine {
|
||||
let mut args = vec!["exec".to_owned()];
|
||||
if let Some(id) = self.conversation_id.lock().expect("mutex sain").as_ref() {
|
||||
@ -157,6 +162,10 @@ impl CodexExecSession {
|
||||
}
|
||||
args.push("--json".to_owned());
|
||||
args.push("--skip-git-repo-check".to_owned());
|
||||
args.push("--sandbox".to_owned());
|
||||
args.push("workspace-write".to_owned());
|
||||
args.push("--ask-for-approval".to_owned());
|
||||
args.push("never".to_owned());
|
||||
args.push(prompt.to_owned());
|
||||
SpawnLine {
|
||||
command: self.command.clone(),
|
||||
|
||||
Reference in New Issue
Block a user