mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
Scope remote execution analytics to threads
This commit is contained in:
@@ -71,6 +71,7 @@ use codex_app_server_protocol::SandboxPolicy as AppServerSandboxPolicy;
|
||||
use codex_app_server_protocol::ServerNotification;
|
||||
use codex_app_server_protocol::SessionSource as AppServerSessionSource;
|
||||
use codex_app_server_protocol::Thread;
|
||||
use codex_app_server_protocol::ThreadExecutionEnvironment;
|
||||
use codex_app_server_protocol::ThreadResumeResponse;
|
||||
use codex_app_server_protocol::ThreadStartParams;
|
||||
use codex_app_server_protocol::ThreadStartResponse;
|
||||
@@ -78,7 +79,6 @@ use codex_app_server_protocol::ThreadStatus as AppServerThreadStatus;
|
||||
use codex_app_server_protocol::Turn;
|
||||
use codex_app_server_protocol::TurnCompletedNotification;
|
||||
use codex_app_server_protocol::TurnError as AppServerTurnError;
|
||||
use codex_app_server_protocol::TurnExecutionEnvironment;
|
||||
use codex_app_server_protocol::TurnStartParams;
|
||||
use codex_app_server_protocol::TurnStartedNotification;
|
||||
use codex_app_server_protocol::TurnStatus as AppServerTurnStatus;
|
||||
@@ -219,14 +219,6 @@ fn sample_thread_resume_response_with_source(
|
||||
}
|
||||
|
||||
fn sample_turn_start_request(thread_id: &str, request_id: i64) -> ClientRequest {
|
||||
sample_turn_start_request_with_execution_environment(thread_id, request_id, None)
|
||||
}
|
||||
|
||||
fn sample_turn_start_request_with_execution_environment(
|
||||
thread_id: &str,
|
||||
request_id: i64,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
) -> ClientRequest {
|
||||
ClientRequest::TurnStart {
|
||||
request_id: RequestId::Integer(request_id),
|
||||
params: TurnStartParams {
|
||||
@@ -240,7 +232,6 @@ fn sample_turn_start_request_with_execution_environment(
|
||||
url: "https://example.com/a.png".to_string(),
|
||||
},
|
||||
],
|
||||
execution_environment,
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
@@ -346,20 +337,6 @@ fn sample_turn_steer_request(
|
||||
thread_id: &str,
|
||||
expected_turn_id: &str,
|
||||
request_id: i64,
|
||||
) -> ClientRequest {
|
||||
sample_turn_steer_request_with_execution_environment(
|
||||
thread_id,
|
||||
expected_turn_id,
|
||||
request_id,
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
fn sample_turn_steer_request_with_execution_environment(
|
||||
thread_id: &str,
|
||||
expected_turn_id: &str,
|
||||
request_id: i64,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
) -> ClientRequest {
|
||||
ClientRequest::TurnSteer {
|
||||
request_id: RequestId::Integer(request_id),
|
||||
@@ -376,7 +353,6 @@ fn sample_turn_steer_request_with_execution_environment(
|
||||
},
|
||||
],
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -503,7 +479,7 @@ async fn ingest_initialize(reducer: &mut AnalyticsReducer, out: &mut Vec<TrackEv
|
||||
async fn ingest_thread_start_with_execution_environment(
|
||||
reducer: &mut AnalyticsReducer,
|
||||
out: &mut Vec<TrackEventRequest>,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
) {
|
||||
reducer
|
||||
.ingest(
|
||||
@@ -878,7 +854,7 @@ fn thread_initialized_event_serializes_expected_shape() {
|
||||
initialization_mode: ThreadInitializationMode::New,
|
||||
subagent_source: None,
|
||||
parent_thread_id: None,
|
||||
execution_environment: Some(TurnExecutionEnvironment::Remote),
|
||||
execution_environment: Some(ThreadExecutionEnvironment::Remote),
|
||||
created_at: 1,
|
||||
},
|
||||
});
|
||||
@@ -1016,27 +992,6 @@ async fn initialize_caches_client_and_thread_lifecycle_publishes_once_initialize
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn thread_start_execution_environment_flows_to_thread_initialized_event() {
|
||||
let mut reducer = AnalyticsReducer::default();
|
||||
let mut out = Vec::new();
|
||||
|
||||
ingest_initialize(&mut reducer, &mut out).await;
|
||||
ingest_thread_start_with_execution_environment(
|
||||
&mut reducer,
|
||||
&mut out,
|
||||
Some(TurnExecutionEnvironment::Remote),
|
||||
)
|
||||
.await;
|
||||
|
||||
let payload = serde_json::to_value(&out[0]).expect("serialize thread event");
|
||||
assert_eq!(payload["event_type"], json!("codex_thread_initialized"));
|
||||
assert_eq!(
|
||||
payload["event_params"]["execution_environment"],
|
||||
json!("remote")
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn compaction_event_ingests_custom_fact() {
|
||||
let mut reducer = AnalyticsReducer::default();
|
||||
@@ -1833,7 +1788,7 @@ fn turn_event_serializes_expected_shape() {
|
||||
initialization_mode: ThreadInitializationMode::New,
|
||||
subagent_source: None,
|
||||
parent_thread_id: None,
|
||||
execution_environment: Some(TurnExecutionEnvironment::Remote),
|
||||
execution_environment: Some(ThreadExecutionEnvironment::Remote),
|
||||
model: Some("gpt-5".to_string()),
|
||||
model_provider: "openai".to_string(),
|
||||
sandbox_policy: Some("read_only"),
|
||||
@@ -2231,76 +2186,7 @@ async fn turn_lifecycle_emits_turn_event() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn turn_start_execution_environment_flows_to_turn_event() {
|
||||
let mut reducer = AnalyticsReducer::default();
|
||||
let mut out = Vec::new();
|
||||
|
||||
ingest_initialize(&mut reducer, &mut out).await;
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::ClientResponse {
|
||||
connection_id: 7,
|
||||
response: Box::new(sample_thread_start_response(
|
||||
"thread-2", /*ephemeral*/ false, "gpt-5",
|
||||
)),
|
||||
},
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
out.clear();
|
||||
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::ClientRequest {
|
||||
connection_id: 7,
|
||||
request_id: RequestId::Integer(3),
|
||||
request: Box::new(sample_turn_start_request_with_execution_environment(
|
||||
"thread-2",
|
||||
/*request_id*/ 3,
|
||||
Some(TurnExecutionEnvironment::Remote),
|
||||
)),
|
||||
},
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::ClientResponse {
|
||||
connection_id: 7,
|
||||
response: Box::new(sample_turn_start_response("turn-2", /*request_id*/ 3)),
|
||||
},
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::Custom(CustomAnalyticsFact::TurnResolvedConfig(Box::new(
|
||||
sample_turn_resolved_config("turn-2"),
|
||||
))),
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::Notification(Box::new(sample_turn_completed_notification(
|
||||
"thread-2",
|
||||
"turn-2",
|
||||
AppServerTurnStatus::Completed,
|
||||
/*codex_error_info*/ None,
|
||||
))),
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
|
||||
let payload = serde_json::to_value(&out[0]).expect("serialize turn event");
|
||||
assert_eq!(
|
||||
payload["event_params"]["execution_environment"],
|
||||
json!("remote")
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn thread_execution_environment_flows_to_turn_and_steer_events() {
|
||||
async fn thread_execution_environment_flows_to_thread_turn_and_steer_events() {
|
||||
let mut reducer = AnalyticsReducer::default();
|
||||
let mut out = Vec::new();
|
||||
|
||||
@@ -2308,38 +2194,26 @@ async fn thread_execution_environment_flows_to_turn_and_steer_events() {
|
||||
ingest_thread_start_with_execution_environment(
|
||||
&mut reducer,
|
||||
&mut out,
|
||||
Some(TurnExecutionEnvironment::Remote),
|
||||
Some(ThreadExecutionEnvironment::Remote),
|
||||
)
|
||||
.await;
|
||||
|
||||
let thread_payload = serde_json::to_value(&out[0]).expect("serialize thread event");
|
||||
assert_eq!(
|
||||
thread_payload["event_params"]["execution_environment"],
|
||||
json!("remote")
|
||||
);
|
||||
out.clear();
|
||||
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::ClientRequest {
|
||||
connection_id: 7,
|
||||
request_id: RequestId::Integer(3),
|
||||
request: Box::new(sample_turn_start_request("thread-2", /*request_id*/ 3)),
|
||||
},
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::ClientResponse {
|
||||
connection_id: 7,
|
||||
response: Box::new(sample_turn_start_response("turn-2", /*request_id*/ 3)),
|
||||
},
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::Custom(CustomAnalyticsFact::TurnResolvedConfig(Box::new(
|
||||
sample_turn_resolved_config("turn-2"),
|
||||
))),
|
||||
&mut out,
|
||||
)
|
||||
.await;
|
||||
ingest_turn_prerequisites(
|
||||
&mut reducer,
|
||||
&mut out,
|
||||
/*include_initialize*/ false,
|
||||
/*include_resolved_config*/ true,
|
||||
/*include_started*/ false,
|
||||
/*include_token_usage*/ false,
|
||||
)
|
||||
.await;
|
||||
reducer
|
||||
.ingest(
|
||||
AnalyticsFact::ClientRequest {
|
||||
@@ -2415,11 +2289,8 @@ async fn accepted_steers_increment_turn_steer_count() {
|
||||
AnalyticsFact::ClientRequest {
|
||||
connection_id: 7,
|
||||
request_id: RequestId::Integer(4),
|
||||
request: Box::new(sample_turn_steer_request_with_execution_environment(
|
||||
"thread-2",
|
||||
"turn-2",
|
||||
/*request_id*/ 4,
|
||||
Some(TurnExecutionEnvironment::Remote),
|
||||
request: Box::new(sample_turn_steer_request(
|
||||
"thread-2", "turn-2", /*request_id*/ 4,
|
||||
)),
|
||||
},
|
||||
&mut out,
|
||||
@@ -2498,10 +2369,6 @@ async fn accepted_steers_increment_turn_steer_count() {
|
||||
.find(|event| matches!(event, TrackEventRequest::TurnEvent(_)))
|
||||
.expect("turn event should be emitted");
|
||||
let payload = serde_json::to_value(turn_event).expect("serialize turn event");
|
||||
assert_eq!(
|
||||
payload["event_params"]["execution_environment"],
|
||||
json!("remote")
|
||||
);
|
||||
assert_eq!(payload["event_params"]["steer_count"], json!(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::facts::TurnSteerResult;
|
||||
use crate::facts::TurnSubmissionType;
|
||||
use crate::now_unix_seconds;
|
||||
use codex_app_server_protocol::CodexErrorInfo;
|
||||
use codex_app_server_protocol::TurnExecutionEnvironment;
|
||||
use codex_app_server_protocol::ThreadExecutionEnvironment;
|
||||
use codex_login::default_client::originator;
|
||||
use codex_plugin::PluginTelemetryMetadata;
|
||||
use codex_protocol::approvals::NetworkApprovalProtocol;
|
||||
@@ -115,7 +115,7 @@ pub(crate) struct ThreadInitializedEventParams {
|
||||
pub(crate) initialization_mode: ThreadInitializationMode,
|
||||
pub(crate) subagent_source: Option<String>,
|
||||
pub(crate) parent_thread_id: Option<String>,
|
||||
pub(crate) execution_environment: Option<TurnExecutionEnvironment>,
|
||||
pub(crate) execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
pub(crate) created_at: u64,
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ pub(crate) struct CodexTurnEventParams {
|
||||
pub(crate) initialization_mode: ThreadInitializationMode,
|
||||
pub(crate) subagent_source: Option<String>,
|
||||
pub(crate) parent_thread_id: Option<String>,
|
||||
pub(crate) execution_environment: Option<TurnExecutionEnvironment>,
|
||||
pub(crate) execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
pub(crate) model: Option<String>,
|
||||
pub(crate) model_provider: String,
|
||||
pub(crate) sandbox_policy: Option<&'static str>,
|
||||
@@ -521,7 +521,7 @@ pub(crate) struct CodexTurnSteerEventParams {
|
||||
pub(crate) thread_source: Option<String>,
|
||||
pub(crate) subagent_source: Option<String>,
|
||||
pub(crate) parent_thread_id: Option<String>,
|
||||
pub(crate) execution_environment: Option<TurnExecutionEnvironment>,
|
||||
pub(crate) execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
pub(crate) num_input_images: usize,
|
||||
pub(crate) result: TurnSteerResult,
|
||||
pub(crate) rejection_reason: Option<TurnSteerRejectionReason>,
|
||||
|
||||
@@ -53,7 +53,7 @@ use codex_app_server_protocol::CodexErrorInfo;
|
||||
use codex_app_server_protocol::InitializeParams;
|
||||
use codex_app_server_protocol::RequestId;
|
||||
use codex_app_server_protocol::ServerNotification;
|
||||
use codex_app_server_protocol::TurnExecutionEnvironment;
|
||||
use codex_app_server_protocol::ThreadExecutionEnvironment;
|
||||
use codex_app_server_protocol::TurnSteerResponse;
|
||||
use codex_app_server_protocol::UserInput;
|
||||
use codex_git_utils::collect_git_info;
|
||||
@@ -90,14 +90,14 @@ struct ThreadMetadataState {
|
||||
initialization_mode: ThreadInitializationMode,
|
||||
subagent_source: Option<String>,
|
||||
parent_thread_id: Option<String>,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
}
|
||||
|
||||
impl ThreadMetadataState {
|
||||
fn from_thread_metadata(
|
||||
session_source: &SessionSource,
|
||||
initialization_mode: ThreadInitializationMode,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
) -> Self {
|
||||
let (subagent_source, parent_thread_id) = match session_source {
|
||||
SessionSource::SubAgent(subagent_source) => (
|
||||
@@ -129,20 +129,18 @@ enum RequestState {
|
||||
}
|
||||
|
||||
struct PendingThreadInitializedState {
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
}
|
||||
|
||||
struct PendingTurnStartState {
|
||||
thread_id: String,
|
||||
num_input_images: usize,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
}
|
||||
|
||||
struct PendingTurnSteerState {
|
||||
thread_id: String,
|
||||
expected_turn_id: String,
|
||||
num_input_images: usize,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
created_at: u64,
|
||||
}
|
||||
|
||||
@@ -159,7 +157,6 @@ struct TurnState {
|
||||
thread_id: Option<String>,
|
||||
num_input_images: Option<usize>,
|
||||
resolved_config: Option<TurnResolvedConfigFact>,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
started_at: Option<u64>,
|
||||
token_usage: Option<TokenUsage>,
|
||||
completed: Option<CompletedTurnState>,
|
||||
@@ -361,7 +358,6 @@ impl AnalyticsReducer {
|
||||
RequestState::TurnStart(PendingTurnStartState {
|
||||
thread_id: params.thread_id,
|
||||
num_input_images: num_input_images(¶ms.input),
|
||||
execution_environment: params.execution_environment,
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -372,7 +368,6 @@ impl AnalyticsReducer {
|
||||
thread_id: params.thread_id,
|
||||
expected_turn_id: params.expected_turn_id,
|
||||
num_input_images: num_input_images(¶ms.input),
|
||||
execution_environment: params.execution_environment,
|
||||
created_at: now_unix_seconds(),
|
||||
}),
|
||||
);
|
||||
@@ -394,7 +389,6 @@ impl AnalyticsReducer {
|
||||
thread_id: None,
|
||||
num_input_images: None,
|
||||
resolved_config: None,
|
||||
execution_environment: None,
|
||||
started_at: None,
|
||||
token_usage: None,
|
||||
completed: None,
|
||||
@@ -417,7 +411,6 @@ impl AnalyticsReducer {
|
||||
thread_id: None,
|
||||
num_input_images: None,
|
||||
resolved_config: None,
|
||||
execution_environment: None,
|
||||
started_at: None,
|
||||
token_usage: None,
|
||||
completed: None,
|
||||
@@ -597,7 +590,6 @@ impl AnalyticsReducer {
|
||||
thread_id: None,
|
||||
num_input_images: None,
|
||||
resolved_config: None,
|
||||
execution_environment: None,
|
||||
started_at: None,
|
||||
token_usage: None,
|
||||
completed: None,
|
||||
@@ -606,7 +598,6 @@ impl AnalyticsReducer {
|
||||
turn_state.connection_id = Some(connection_id);
|
||||
turn_state.thread_id = Some(pending_request.thread_id);
|
||||
turn_state.num_input_images = Some(pending_request.num_input_images);
|
||||
turn_state.execution_environment = pending_request.execution_environment;
|
||||
self.maybe_emit_turn_event(&turn_id, out);
|
||||
}
|
||||
ClientResponse::TurnSteer {
|
||||
@@ -682,7 +673,6 @@ impl AnalyticsReducer {
|
||||
thread_id: None,
|
||||
num_input_images: None,
|
||||
resolved_config: None,
|
||||
execution_environment: None,
|
||||
started_at: None,
|
||||
token_usage: None,
|
||||
completed: None,
|
||||
@@ -702,7 +692,6 @@ impl AnalyticsReducer {
|
||||
thread_id: None,
|
||||
num_input_images: None,
|
||||
resolved_config: None,
|
||||
execution_environment: None,
|
||||
started_at: None,
|
||||
token_usage: None,
|
||||
completed: None,
|
||||
@@ -737,7 +726,7 @@ impl AnalyticsReducer {
|
||||
thread: codex_app_server_protocol::Thread,
|
||||
model: String,
|
||||
initialization_mode: ThreadInitializationMode,
|
||||
execution_environment: Option<TurnExecutionEnvironment>,
|
||||
execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
out: &mut Vec<TrackEventRequest>,
|
||||
) {
|
||||
let thread_source: SessionSource = thread.source.into();
|
||||
@@ -778,7 +767,7 @@ impl AnalyticsReducer {
|
||||
&mut self,
|
||||
connection_id: u64,
|
||||
request_id: RequestId,
|
||||
) -> Option<TurnExecutionEnvironment> {
|
||||
) -> Option<ThreadExecutionEnvironment> {
|
||||
match self.requests.remove(&(connection_id, request_id)) {
|
||||
Some(RequestState::ThreadInitialized(pending_request)) => {
|
||||
pending_request.execution_environment
|
||||
@@ -841,9 +830,6 @@ impl AnalyticsReducer {
|
||||
return;
|
||||
};
|
||||
if let Some(turn_state) = self.turns.get_mut(&response.turn_id) {
|
||||
if pending_request.execution_environment.is_some() {
|
||||
turn_state.execution_environment = pending_request.execution_environment;
|
||||
}
|
||||
turn_state.steer_count += 1;
|
||||
}
|
||||
self.emit_turn_steer_event(
|
||||
@@ -886,9 +872,7 @@ impl AnalyticsReducer {
|
||||
thread_source: thread_metadata.thread_source.map(str::to_string),
|
||||
subagent_source: thread_metadata.subagent_source.clone(),
|
||||
parent_thread_id: thread_metadata.parent_thread_id.clone(),
|
||||
execution_environment: pending_request
|
||||
.execution_environment
|
||||
.or(thread_metadata.execution_environment),
|
||||
execution_environment: thread_metadata.execution_environment,
|
||||
num_input_images: pending_request.num_input_images,
|
||||
result,
|
||||
rejection_reason,
|
||||
@@ -1003,9 +987,7 @@ fn codex_turn_event_params(
|
||||
initialization_mode: thread_metadata.initialization_mode,
|
||||
subagent_source: thread_metadata.subagent_source.clone(),
|
||||
parent_thread_id: thread_metadata.parent_thread_id.clone(),
|
||||
execution_environment: turn_state
|
||||
.execution_environment
|
||||
.or(thread_metadata.execution_environment),
|
||||
execution_environment: thread_metadata.execution_environment,
|
||||
model: Some(model),
|
||||
model_provider,
|
||||
sandbox_policy: Some(sandbox_policy_mode(
|
||||
|
||||
+6
-6
@@ -3296,6 +3296,12 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ThreadExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ThreadForkParams": {
|
||||
"description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.",
|
||||
"properties": {
|
||||
@@ -4091,12 +4097,6 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"TurnInterruptParams": {
|
||||
"properties": {
|
||||
"threadId": {
|
||||
|
||||
+6
-6
@@ -14564,6 +14564,12 @@
|
||||
"title": "ThreadCompactStartResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ThreadExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ThreadForkParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.",
|
||||
@@ -17088,12 +17094,6 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"TurnInterruptParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
|
||||
+6
-6
@@ -12450,6 +12450,12 @@
|
||||
"title": "ThreadCompactStartResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ThreadExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ThreadForkParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.",
|
||||
@@ -14974,12 +14980,6 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"TurnInterruptParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
|
||||
@@ -404,7 +404,7 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"ThreadExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
|
||||
@@ -1262,7 +1262,7 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"ThreadExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
|
||||
@@ -438,6 +438,12 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ThreadExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ThreadStartSource": {
|
||||
"enum": [
|
||||
"startup",
|
||||
@@ -459,12 +465,6 @@
|
||||
"environmentId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
|
||||
@@ -651,12 +651,6 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"UserInput": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
||||
@@ -43,12 +43,6 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"TurnExecutionEnvironment": {
|
||||
"enum": [
|
||||
"remote"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"UserInput": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type TurnExecutionEnvironment = "remote";
|
||||
export type ThreadExecutionEnvironment = "remote";
|
||||
+1
-1
@@ -333,6 +333,7 @@ export type { ThreadArchivedNotification } from "./ThreadArchivedNotification";
|
||||
export type { ThreadClosedNotification } from "./ThreadClosedNotification";
|
||||
export type { ThreadCompactStartParams } from "./ThreadCompactStartParams";
|
||||
export type { ThreadCompactStartResponse } from "./ThreadCompactStartResponse";
|
||||
export type { ThreadExecutionEnvironment } from "./ThreadExecutionEnvironment";
|
||||
export type { ThreadForkParams } from "./ThreadForkParams";
|
||||
export type { ThreadForkResponse } from "./ThreadForkResponse";
|
||||
export type { ThreadGoal } from "./ThreadGoal";
|
||||
@@ -400,7 +401,6 @@ export type { TurnCompletedNotification } from "./TurnCompletedNotification";
|
||||
export type { TurnDiffUpdatedNotification } from "./TurnDiffUpdatedNotification";
|
||||
export type { TurnEnvironmentParams } from "./TurnEnvironmentParams";
|
||||
export type { TurnError } from "./TurnError";
|
||||
export type { TurnExecutionEnvironment } from "./TurnExecutionEnvironment";
|
||||
export type { TurnInterruptParams } from "./TurnInterruptParams";
|
||||
export type { TurnInterruptResponse } from "./TurnInterruptResponse";
|
||||
export type { TurnPlanStep } from "./TurnPlanStep";
|
||||
|
||||
@@ -3481,7 +3481,7 @@ pub struct ThreadStartParams {
|
||||
/// Optional thread-scoped execution environment.
|
||||
#[experimental("thread/start.executionEnvironment")]
|
||||
#[ts(optional = nullable)]
|
||||
pub execution_environment: Option<TurnExecutionEnvironment>,
|
||||
pub execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
/// Optional sticky environments for this thread.
|
||||
///
|
||||
/// Omitted selects the default environment when environment access is
|
||||
@@ -3630,7 +3630,7 @@ pub struct ThreadResumeParams {
|
||||
/// Optional thread-scoped execution environment.
|
||||
#[experimental("thread/resume.executionEnvironment")]
|
||||
#[ts(optional = nullable)]
|
||||
pub execution_environment: Option<TurnExecutionEnvironment>,
|
||||
pub execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
/// If true, persist additional rollout EventMsg variants required to
|
||||
/// reconstruct a richer thread history on subsequent resume/fork/read.
|
||||
#[experimental("thread/resume.persistFullHistory")]
|
||||
@@ -3731,7 +3731,7 @@ pub struct ThreadForkParams {
|
||||
/// Optional thread-scoped execution environment.
|
||||
#[experimental("thread/fork.executionEnvironment")]
|
||||
#[ts(optional = nullable)]
|
||||
pub execution_environment: Option<TurnExecutionEnvironment>,
|
||||
pub execution_environment: Option<ThreadExecutionEnvironment>,
|
||||
/// If true, persist additional rollout EventMsg variants required to
|
||||
/// reconstruct a richer thread history on subsequent resume/fork/read.
|
||||
#[experimental("thread/fork.persistFullHistory")]
|
||||
@@ -5266,7 +5266,7 @@ pub struct TurnEnvironmentParams {
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[ts(rename_all = "snake_case", export_to = "v2/")]
|
||||
pub enum TurnExecutionEnvironment {
|
||||
pub enum ThreadExecutionEnvironment {
|
||||
Remote,
|
||||
}
|
||||
|
||||
@@ -5282,10 +5282,6 @@ pub struct TurnStartParams {
|
||||
#[experimental("turn/start.responsesapiClientMetadata")]
|
||||
#[ts(optional = nullable)]
|
||||
pub responsesapi_client_metadata: Option<HashMap<String, String>>,
|
||||
/// Optional turn-scoped execution environment.
|
||||
#[experimental("turn/start.executionEnvironment")]
|
||||
#[ts(optional = nullable)]
|
||||
pub execution_environment: Option<TurnExecutionEnvironment>,
|
||||
/// Optional turn-scoped environments.
|
||||
///
|
||||
/// Omitted uses the thread sticky environments. Empty disables
|
||||
@@ -5435,10 +5431,6 @@ pub struct TurnSteerParams {
|
||||
#[experimental("turn/steer.responsesapiClientMetadata")]
|
||||
#[ts(optional = nullable)]
|
||||
pub responsesapi_client_metadata: Option<HashMap<String, String>>,
|
||||
/// Optional turn-scoped execution environment.
|
||||
#[experimental("turn/steer.executionEnvironment")]
|
||||
#[ts(optional = nullable)]
|
||||
pub execution_environment: Option<TurnExecutionEnvironment>,
|
||||
/// Required active turn id precondition. The request fails when it does not
|
||||
/// match the currently active turn.
|
||||
pub expected_turn_id: String,
|
||||
@@ -10786,7 +10778,6 @@ mod tests {
|
||||
thread_id: "thread_123".to_string(),
|
||||
input: vec![],
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
environments: None,
|
||||
cwd: None,
|
||||
approval_policy: None,
|
||||
|
||||
@@ -758,7 +758,6 @@ async fn turn_start_jsonrpc_span_parents_core_turn_spans() -> Result<()> {
|
||||
text_elements: Vec::new(),
|
||||
}],
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
cwd: None,
|
||||
approval_policy: None,
|
||||
sandbox_policy: None,
|
||||
|
||||
@@ -179,7 +179,6 @@ async fn turn_steer_updates_client_metadata_on_follow_up_responses_request_v2()
|
||||
text_elements: Vec::new(),
|
||||
}],
|
||||
responsesapi_client_metadata: Some(steer_metadata.clone()),
|
||||
execution_environment: None,
|
||||
expected_turn_id: turn_id.clone(),
|
||||
})
|
||||
.await?;
|
||||
|
||||
@@ -67,7 +67,6 @@ async fn turn_steer_requires_active_turn() -> Result<()> {
|
||||
text_elements: Vec::new(),
|
||||
}],
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
expected_turn_id: "turn-does-not-exist".to_string(),
|
||||
})
|
||||
.await?;
|
||||
@@ -177,7 +176,6 @@ async fn turn_steer_rejects_oversized_text_input() -> Result<()> {
|
||||
text_elements: Vec::new(),
|
||||
}],
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
expected_turn_id: turn.id.clone(),
|
||||
})
|
||||
.await?;
|
||||
@@ -286,7 +284,6 @@ async fn turn_steer_returns_active_turn_id() -> Result<()> {
|
||||
text_elements: Vec::new(),
|
||||
}],
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
expected_turn_id: turn.id.clone(),
|
||||
})
|
||||
.await?;
|
||||
|
||||
@@ -754,7 +754,6 @@ async fn run_exec_session(args: ExecRunArgs) -> anyhow::Result<()> {
|
||||
thread_id: primary_thread_id_for_span.clone(),
|
||||
input: items.into_iter().map(Into::into).collect(),
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
environments: None,
|
||||
cwd: Some(default_cwd),
|
||||
approval_policy: Some(default_approval_policy.into()),
|
||||
|
||||
@@ -569,7 +569,6 @@ impl AppServerSession {
|
||||
thread_id: thread_id.to_string(),
|
||||
input: items.into_iter().map(Into::into).collect(),
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
environments: None,
|
||||
cwd: Some(cwd),
|
||||
approval_policy: Some(approval_policy.into()),
|
||||
@@ -627,7 +626,6 @@ impl AppServerSession {
|
||||
thread_id: thread_id.to_string(),
|
||||
input: items.into_iter().map(Into::into).collect(),
|
||||
responsesapi_client_metadata: None,
|
||||
execution_environment: None,
|
||||
expected_turn_id: turn_id,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user