mirror of
https://github.com/openai/codex.git
synced 2026-05-03 10:56:37 +00:00
chore: unify conversation with thread name (#8830)
Done and verified by Codex + refactor feature of RustRover
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
|
||||
use codex_core::AuthManager;
|
||||
use codex_core::CodexAuth;
|
||||
use codex_core::ConversationManager;
|
||||
use codex_core::NewConversation;
|
||||
use codex_core::NewThread;
|
||||
use codex_core::ThreadManager;
|
||||
use codex_core::protocol::EventMsg;
|
||||
use codex_core::protocol::InitialHistory;
|
||||
use codex_core::protocol::ResumedHistory;
|
||||
use codex_core::protocol::RolloutItem;
|
||||
use codex_core::protocol::TurnContextItem;
|
||||
use codex_core::protocol::WarningEvent;
|
||||
use codex_protocol::ConversationId;
|
||||
use codex_protocol::ThreadId;
|
||||
use core::time::Duration;
|
||||
use core_test_support::load_default_config_for_test;
|
||||
use core_test_support::wait_for_event;
|
||||
@@ -36,7 +36,7 @@ fn resume_history(
|
||||
};
|
||||
|
||||
InitialHistory::Resumed(ResumedHistory {
|
||||
conversation_id: ConversationId::default(),
|
||||
conversation_id: ThreadId::default(),
|
||||
history: vec![RolloutItem::TurnContext(turn_ctx)],
|
||||
rollout_path: rollout_path.to_path_buf(),
|
||||
})
|
||||
@@ -56,15 +56,18 @@ async fn emits_warning_when_resumed_model_differs() {
|
||||
|
||||
let initial_history = resume_history(&config, "previous-model", &rollout_path);
|
||||
|
||||
let conversation_manager = ConversationManager::with_models_provider(
|
||||
let thread_manager = ThreadManager::with_models_provider(
|
||||
CodexAuth::from_api_key("test"),
|
||||
config.model_provider.clone(),
|
||||
);
|
||||
let auth_manager = AuthManager::from_auth_for_testing(CodexAuth::from_api_key("test"));
|
||||
|
||||
// Act: resume the conversation.
|
||||
let NewConversation { conversation, .. } = conversation_manager
|
||||
.resume_conversation_with_history(config, initial_history, auth_manager)
|
||||
let NewThread {
|
||||
thread: conversation,
|
||||
..
|
||||
} = thread_manager
|
||||
.resume_thread_with_history(config, initial_history, auth_manager)
|
||||
.await
|
||||
.expect("resume conversation");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user