Keep remote browsing on atlas command path

Only auto-inject the hidden atlas bridge when remote browsing is configured,
include thread ids in browser session notifications, and persist Atlas browser
state plus image artifacts so replay items can be rebuilt from history.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Liang-Ting Jiang
2026-03-25 01:53:56 +00:00
co-authored by Codex
parent ee865bcddc
commit 509a743501
15 changed files with 178 additions and 23 deletions
@@ -524,6 +524,12 @@
},
"browserState": {
"$ref": "#/definitions/BrowserSessionState"
},
"threadId": {
"type": [
"string",
"null"
]
}
},
"required": [
@@ -4994,4 +5000,4 @@
}
],
"title": "ServerNotification"
}
}
@@ -5656,6 +5656,12 @@
},
"browserState": {
"$ref": "#/definitions/v2/BrowserSessionState"
},
"threadId": {
"type": [
"string",
"null"
]
}
},
"required": [
@@ -14921,4 +14927,4 @@
},
"title": "CodexAppServerProtocol",
"type": "object"
}
}
@@ -856,6 +856,12 @@
},
"browserState": {
"$ref": "#/definitions/BrowserSessionState"
},
"threadId": {
"type": [
"string",
"null"
]
}
},
"required": [
@@ -12680,4 +12686,4 @@
},
"title": "CodexAppServerProtocolV2",
"type": "object"
}
}
@@ -92,6 +92,12 @@
},
"browserState": {
"$ref": "#/definitions/BrowserSessionState"
},
"threadId": {
"type": [
"string",
"null"
]
}
},
"required": [
@@ -100,4 +106,4 @@
],
"title": "BrowserSessionUpdatedNotification",
"type": "object"
}
}
@@ -4,4 +4,4 @@
import type { BrowserSessionArtifacts } from "./BrowserSessionArtifacts";
import type { BrowserSessionState } from "./BrowserSessionState";
export type BrowserSessionUpdatedNotification = { browserSessionId: string, browserState: BrowserSessionState, artifacts?: BrowserSessionArtifacts | null, };
export type BrowserSessionUpdatedNotification = { threadId?: string | null, browserSessionId: string, browserState: BrowserSessionState, artifacts?: BrowserSessionArtifacts | null, };
@@ -1651,6 +1651,7 @@ mod tests {
fn serialize_browser_session_updated_notification() -> Result<()> {
let notification =
ServerNotification::BrowserSessionUpdated(v2::BrowserSessionUpdatedNotification {
thread_id: Some("thread-1".to_string()),
browser_session_id: "sess_123".to_string(),
browser_state: v2::BrowserSessionState {
selected_tab_id: "tab_123".to_string(),
@@ -1672,6 +1673,7 @@ mod tests {
json!({
"method": "browserSession/updated",
"params": {
"threadId": "thread-1",
"browserSessionId": "sess_123",
"browserState": {
"selectedTabId": "tab_123",
@@ -1725,6 +1727,7 @@ mod tests {
fn browser_session_updated_is_marked_experimental() {
let notification =
ServerNotification::BrowserSessionUpdated(v2::BrowserSessionUpdatedNotification {
thread_id: Some("thread-1".to_string()),
browser_session_id: "sess_123".to_string(),
browser_state: v2::BrowserSessionState {
selected_tab_id: String::new(),
@@ -2162,6 +2162,9 @@ pub struct BrowserSessionCommandResponse {
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct BrowserSessionUpdatedNotification {
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional = nullable)]
pub thread_id: Option<String>,
pub browser_session_id: String,
pub browser_state: BrowserSessionState,
#[serde(default, skip_serializing_if = "Option::is_none")]