mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Remove legacy thread summary test helpers from the app server (#63593)
## What changed Delete the test-only helpers for converting state database metadata into a `Thread`, along with the unit test that checked whether those helpers preserved subagent nicknames and roles. GitOrigin-RevId: 0218372fd82f9efd4d79a1a44f662d781bc5df5a
This commit is contained in:
@@ -7022,54 +7022,6 @@ fn summary_from_stored_thread(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[cfg(test)]
|
||||
fn summary_from_state_db_metadata(
|
||||
conversation_id: ThreadId,
|
||||
path: PathBuf,
|
||||
first_user_message: Option<String>,
|
||||
preview: Option<String>,
|
||||
timestamp: String,
|
||||
updated_at: String,
|
||||
model_provider: String,
|
||||
cwd: PathBuf,
|
||||
cli_version: String,
|
||||
source: String,
|
||||
_thread_source: Option<codex_protocol::protocol::ThreadSource>,
|
||||
agent_nickname: Option<String>,
|
||||
agent_role: Option<String>,
|
||||
git_sha: Option<String>,
|
||||
git_branch: Option<String>,
|
||||
git_origin_url: Option<String>,
|
||||
) -> ConversationSummary {
|
||||
let preview = preview.or(first_user_message).unwrap_or_default();
|
||||
let source = serde_json::from_str(&source)
|
||||
.or_else(|_| serde_json::from_value(serde_json::Value::String(source.clone())))
|
||||
.unwrap_or(codex_protocol::protocol::SessionSource::Unknown);
|
||||
let source = with_thread_spawn_agent_metadata(source, agent_nickname, agent_role);
|
||||
let git_info = if git_sha.is_none() && git_branch.is_none() && git_origin_url.is_none() {
|
||||
None
|
||||
} else {
|
||||
Some(ConversationGitInfo {
|
||||
sha: git_sha,
|
||||
branch: git_branch,
|
||||
origin_url: git_origin_url,
|
||||
})
|
||||
};
|
||||
ConversationSummary {
|
||||
conversation_id,
|
||||
path,
|
||||
preview,
|
||||
timestamp: Some(timestamp),
|
||||
updated_at: Some(updated_at),
|
||||
model_provider,
|
||||
cwd,
|
||||
cli_version,
|
||||
source,
|
||||
git_info,
|
||||
}
|
||||
}
|
||||
|
||||
fn preview_from_rollout_items(items: &[RolloutItem]) -> String {
|
||||
items
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user