[App Server] Allow fetching or resuming a conversation summary from the conversation id (#5890)

This PR adds an option to app server to allow conversation summaries to
be fetched from just the conversation id rather than rollout path for
convenience at the cost of some latency to discover the rollout path.

This convenience is non-trivial as it allows app servers to simply
maintain conversation ids rather than rollout paths and the associated
platform (Windows) handling associated with storing and encoding them
correctly.
This commit is contained in:
Gabriel Peal
2025-10-28 17:17:22 -07:00
committed by GitHub
parent a1635eea25
commit 1d76ba5ebe
4 changed files with 93 additions and 16 deletions

View File

@@ -340,12 +340,24 @@ pub struct ResumeConversationResponse {
pub model: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub initial_messages: Option<Vec<EventMsg>>,
pub rollout_path: PathBuf,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
pub struct GetConversationSummaryParams {
pub rollout_path: PathBuf,
#[serde(untagged)]
pub enum GetConversationSummaryParams {
/// Provide the absolute or CODEX_HOMErelative rollout path directly.
RolloutPath {
#[serde(rename = "rolloutPath")]
rollout_path: PathBuf,
},
/// Provide a conversation id; the server will locate the rollout using the
/// same logic as `resumeConversation`. There will be extra latency compared to using the rollout path,
/// as the server needs to locate the rollout path first.
ConversationId {
#[serde(rename = "conversationId")]
conversation_id: ConversationId,
},
}
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema, TS)]
@@ -487,8 +499,12 @@ pub struct LogoutAccountResponse {}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
pub struct ResumeConversationParams {
/// Absolute path to the rollout JSONL file.
pub path: PathBuf,
/// Absolute path to the rollout JSONL file. If omitted, `conversationId` must be provided.
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<PathBuf>,
/// If the rollout path is not known, it can be discovered via the conversation id at at the cost of extra latency.
#[serde(skip_serializing_if = "Option::is_none")]
pub conversation_id: Option<ConversationId>,
/// Optional overrides to apply when spawning the resumed session.
#[serde(skip_serializing_if = "Option::is_none")]
pub overrides: Option<NewConversationParams>,