mirror of
https://github.com/openai/codex.git
synced 2026-10-21 17:48:44 +00:00
[app-server] add image generation title
This commit is contained in:
@@ -3957,6 +3957,7 @@ async fn turn_event_counts_completed_tool_items() {
|
||||
ThreadItem::ImageGeneration {
|
||||
id: "image-1".to_string(),
|
||||
status: "completed".to_string(),
|
||||
title: None,
|
||||
revised_prompt: None,
|
||||
result: "ok".to_string(),
|
||||
saved_path: None,
|
||||
|
||||
@@ -4364,6 +4364,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
+7
@@ -17686,6 +17686,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
+7
@@ -15494,6 +15494,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1114,6 +1114,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1114,6 +1114,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1258,6 +1258,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1742,6 +1742,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1557,6 +1557,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
+7
@@ -1557,6 +1557,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1557,6 +1557,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1742,6 +1742,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1557,6 +1557,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1742,6 +1742,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1557,6 +1557,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1557,6 +1557,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1258,6 +1258,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1258,6 +1258,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -1258,6 +1258,13 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Short display title for the generated image, when available.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"imageGeneration"
|
||||
|
||||
@@ -99,4 +99,8 @@ reasoningEffort: ReasoningEffort | null,
|
||||
/**
|
||||
* Last known status of the target agents, when available.
|
||||
*/
|
||||
agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "subAgentActivity", id: string, kind: SubAgentActivityKind, agentThreadId: string, agentPath: string, } | { "type": "webSearch", id: string, query: string, action: WebSearchAction | null, } | { "type": "imageView", id: string, path: AbsolutePathBuf, } | { "type": "imageGeneration", id: string, status: string, revisedPrompt: string | null, result: string, savedPath?: AbsolutePathBuf, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, };
|
||||
agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "subAgentActivity", id: string, kind: SubAgentActivityKind, agentThreadId: string, agentPath: string, } | { "type": "webSearch", id: string, query: string, action: WebSearchAction | null, } | { "type": "imageView", id: string, path: AbsolutePathBuf, } | { "type": "imageGeneration", id: string, status: string,
|
||||
/**
|
||||
* Short display title for the generated image, when available.
|
||||
*/
|
||||
title: string | null, revisedPrompt: string | null, result: string, savedPath?: AbsolutePathBuf, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, };
|
||||
|
||||
@@ -602,6 +602,7 @@ impl ThreadHistoryBuilder {
|
||||
let item = ThreadItem::ImageGeneration {
|
||||
id: payload.call_id.clone(),
|
||||
status: String::new(),
|
||||
title: None,
|
||||
revised_prompt: None,
|
||||
result: String::new(),
|
||||
saved_path: None,
|
||||
@@ -613,6 +614,7 @@ impl ThreadHistoryBuilder {
|
||||
let item = ThreadItem::ImageGeneration {
|
||||
id: payload.call_id.clone(),
|
||||
status: payload.status.clone(),
|
||||
title: None,
|
||||
revised_prompt: payload.revised_prompt.clone(),
|
||||
result: payload.result.clone(),
|
||||
saved_path: payload.saved_path.clone(),
|
||||
@@ -1622,6 +1624,7 @@ mod tests {
|
||||
ThreadItem::ImageGeneration {
|
||||
id: "ig_123".into(),
|
||||
status: "completed".into(),
|
||||
title: None,
|
||||
revised_prompt: Some("final prompt".into()),
|
||||
result: "Zm9v".into(),
|
||||
saved_path: Some(test_path_buf("/tmp/ig_123.png").abs()),
|
||||
|
||||
@@ -358,6 +358,8 @@ pub enum ThreadItem {
|
||||
ImageGeneration {
|
||||
id: String,
|
||||
status: String,
|
||||
/// Short display title for the generated image, when available.
|
||||
title: Option<String>,
|
||||
revised_prompt: Option<String>,
|
||||
result: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -837,6 +839,7 @@ impl From<CoreTurnItem> for ThreadItem {
|
||||
CoreTurnItem::ImageGeneration(image) => ThreadItem::ImageGeneration {
|
||||
id: image.id,
|
||||
status: image.status,
|
||||
title: None,
|
||||
revised_prompt: image.revised_prompt,
|
||||
result: image.result,
|
||||
saved_path: image.saved_path,
|
||||
|
||||
@@ -1354,6 +1354,7 @@ Today both notifications carry an empty `items` array even when item events were
|
||||
- `collabToolCall` — `{id, tool, status, senderThreadId, receiverThreadId?, newThreadId?, prompt?, agentStatus?}` describing collab tool calls (`spawn_agent`, `send_input`, `resume_agent`, `wait`, `close_agent`); `status` is `inProgress`, `completed`, or `failed`.
|
||||
- `webSearch` — `{id, query, action?}` for a web search request issued by the agent; `action` mirrors the Responses API web_search action payload (`search`, `open_page`, `find_in_page`) and may be omitted until completion.
|
||||
- `imageView` — `{id, path}` emitted when the agent invokes the image viewer tool.
|
||||
- `imageGeneration` — `{id, status, title, revisedPrompt, result, savedPath?}` emitted when the agent generates an image; `title` is a short display title when available, while `revisedPrompt` contains the full prompt used for generation.
|
||||
- `enteredReviewMode` — `{id, review}` sent when the reviewer starts; `review` is a short user-facing label such as `"current changes"` or the requested target description.
|
||||
- `exitedReviewMode` — `{id, review}` emitted when the reviewer finishes; `review` is the full plain-text review (usually, overall notes plus bullet point findings).
|
||||
- `contextCompaction` — `{id}` emitted when codex compacts the conversation history. This can happen automatically.
|
||||
|
||||
@@ -94,6 +94,7 @@ mod tests {
|
||||
ThreadItem::ImageGeneration {
|
||||
id: "ig-1".to_string(),
|
||||
status: "completed".to_string(),
|
||||
title: None,
|
||||
revised_prompt: Some("revised".to_string()),
|
||||
result: "base64-result".to_string(),
|
||||
saved_path: Some(test_path_buf("/tmp/ig-1.png").abs()),
|
||||
|
||||
@@ -200,6 +200,7 @@ async fn standalone_image_generation_failure_emits_terminal_item() -> Result<()>
|
||||
ThreadItem::ImageGeneration {
|
||||
id: call_id.to_string(),
|
||||
status: "failed".to_string(),
|
||||
title: None,
|
||||
revised_prompt: Some("paint a blue whale".to_string()),
|
||||
result: String::new(),
|
||||
saved_path: None,
|
||||
|
||||
@@ -710,6 +710,7 @@ pub(super) fn handle_image_generation_end(
|
||||
item: AppServerThreadItem::ImageGeneration {
|
||||
id: call_id.into(),
|
||||
status: status.into(),
|
||||
title: None,
|
||||
revised_prompt,
|
||||
result: String::new(),
|
||||
saved_path,
|
||||
|
||||
Reference in New Issue
Block a user