fix(cli): z-order Cancel #151 + projection live événements avant Final #167 (+ alignement fixture plugin #165/#166) — QA verte

This commit is contained in:
2026-08-06 19:09:07 +02:00
parent 3d4ea6859e
commit b45deabe6d
4 changed files with 133 additions and 24 deletions

View File

@ -421,7 +421,7 @@ impl AgentSession for CodexExecSession {
}
async fn send(&self, prompt: &str) -> Result<ReplyStream, AgentSessionError> {
self.send_inner(prompt, None, true).await
self.send_inner(prompt, None).await
}
async fn send_with_tap(
@ -429,7 +429,7 @@ impl AgentSession for CodexExecSession {
prompt: &str,
tap: std::sync::mpsc::Sender<ReplyEvent>,
) -> Result<ReplyStream, AgentSessionError> {
self.send_inner(prompt, Some(tap), false).await
self.send_inner(prompt, Some(tap)).await
}
async fn shutdown(&self) -> Result<(), AgentSessionError> {
@ -443,17 +443,17 @@ impl CodexExecSession {
&self,
prompt: &str,
tap: Option<std::sync::mpsc::Sender<ReplyEvent>>,
include_stream_announcements: bool,
) -> Result<ReplyStream, AgentSessionError> {
let spec = self.build_spawn_line(prompt);
let has_tap = tap.is_some();
let (line_tap, parser_thread) = tap.map_or((None, None), |event_tap| {
let (line_tx, line_rx) = std::sync::mpsc::channel::<String>();
let parser = std::thread::spawn(move || {
for line in line_rx {
if let Ok(parsed) = parse_event(&line) {
for event in parsed.events {
if let ReplyEvent::Final { content } = event {
let _ = event_tap.send(ReplyEvent::Announcement { text: content });
if !matches!(event, ReplyEvent::Final { .. }) {
let _ = event_tap.send(event);
}
}
}
@ -488,7 +488,7 @@ impl CodexExecSession {
// Un `agent_message` précédemment retenu est supersédé : il devient
// une annonce non terminale, on garde le plus récent en conclusion.
if last_final.is_some() {
if include_stream_announcements {
if !has_tap {
events.push(ReplyEvent::Announcement {
text: last_final.take().expect("présent"),
});
@ -496,7 +496,11 @@ impl CodexExecSession {
}
last_final = Some(content);
}
other => events.push(other),
other => {
if !has_tap {
events.push(other);
}
}
}
}
}