保留 DirectProject 历史测试适配入口
将测试用用户与助手消息写入原始 Responses item 不恢复生产环境旧聊天持久化逻辑
This commit is contained in:
@@ -4230,6 +4230,34 @@ pub(crate) async fn chat_with_game_creator_home_direct_codex(
|
||||
run_direct_game_creator_home_turn(&prompt, attachments.as_deref().unwrap_or_default()).await
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn persist_direct_codex_user_prompt_at(
|
||||
root: &Path,
|
||||
client_turn_id: &str,
|
||||
prompt: &str,
|
||||
) -> Result<(), String> {
|
||||
let item = direct_project_local_message_item(
|
||||
"user",
|
||||
prompt,
|
||||
Some(&format!("direct-codex:{client_turn_id}:user")),
|
||||
)?;
|
||||
append_direct_project_history_item_at(root, &item)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn persist_direct_codex_assistant_reply_at(
|
||||
root: &Path,
|
||||
client_turn_id: &str,
|
||||
reply: &str,
|
||||
) -> Result<(), String> {
|
||||
let item = direct_project_local_message_item(
|
||||
"assistant",
|
||||
reply,
|
||||
Some(&format!("direct-codex:{client_turn_id}:assistant")),
|
||||
)?;
|
||||
append_direct_project_history_item_at(root, &item)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user