mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +00:00
Generate automatic and manual conversation recaps (#40705)
## Why Users returning to a conversation need a short summary of its recent progress and next steps. ## What changed - Generate a recap for eligible idle, unfocused conversations and add it to the transcript. - Add `/recap` to request the same summary on demand, with visible progress and actionable errors. - Keep recap requests bounded and isolated, reject stale results, and retry only automatic failures. ## Testing - Cover automatic and manual generation, request eligibility, failure handling, loading-state cleanup, and temporary-thread configuration. GitOrigin-RevId: 926a88d6996d67a42809ce2c4091b13fca882b52
This commit is contained in:
1 parent
40ba7da7b4
commit
6988d390b3
17 files changed
+831
-38
No files matched your search
@@ -1,5 +1,6 @@
|
||||
use super::*;
|
||||
use crate::app_event::ConnectorsSnapshot;
|
||||
use crate::history_cell::ThreadRecapLoadingCell;
|
||||
use codex_protocol::models::ManagedFileSystemPermissions;
|
||||
use codex_protocol::permissions::FileSystemAccessMode;
|
||||
use codex_protocol::permissions::FileSystemPath;
|
||||
@@ -32,6 +33,25 @@ fn assert_hidden_shell_payload_is_literal(op: Result<Op, TryRecvError>, payload:
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn user_submission_does_not_commit_recap_loading_to_history() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.show_recap_loading();
|
||||
while rx.try_recv().is_ok() {}
|
||||
|
||||
chat.submit_user_message(UserMessage::from("Continue with the task"));
|
||||
|
||||
let mut saw_user_message = false;
|
||||
while let Ok(event) = rx.try_recv() {
|
||||
if let AppEvent::InsertHistoryCell(cell) = event {
|
||||
assert!(!cell.as_any().is::<ThreadRecapLoadingCell>());
|
||||
saw_user_message |= cell.as_any().is::<UserHistoryCell>();
|
||||
}
|
||||
}
|
||||
assert!(saw_user_message);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn hidden_shell_paste_submits_literal_prompt() {
|
||||
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
|
||||
@@ -177,6 +177,22 @@ async fn slash_compact_eagerly_queues_follow_up_before_turn_start() {
|
||||
assert_matches!(op_rx.try_recv(), Err(TryRecvError::Empty));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn slash_recap_requests_generation_for_current_thread() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
let thread_id = ThreadId::new();
|
||||
chat.thread_id = Some(thread_id);
|
||||
|
||||
chat.dispatch_command(SlashCommand::Recap);
|
||||
|
||||
assert_matches!(
|
||||
rx.try_recv(),
|
||||
Ok(AppEvent::GenerateRecap {
|
||||
thread_id: requested_thread_id,
|
||||
}) if requested_thread_id == thread_id
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn queued_slash_compact_dispatches_after_active_turn() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
|
||||
Reference in new issue
Block a user