mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
## What changed Add `Client::activate` to load a cloud thread through `UpdateConfig`, sending only the thread ID and `exclude_turns=true`. Return serializable resolved settings, thread metadata, and history cursors while leaving turns for separate pagination. Preserve the original thread protobuf, including unknown fields. Validate required fields and thread identity, reject unsupported security policies, and redact sensitive activation data in debug output. Treat activation as a mutation that is never retried, with uncertain outcomes reported through `MutationError::OutcomeUnknown`. ## Testing Add coverage for activation request encoding, settings and metadata preservation, serialization, compatibility defaults, unsupported policies, debug redaction, invalid input rejection, and explicit successful gRPC trailers. GitOrigin-RevId: cd925b7a05f518d782e5b4cf188556567dad9e21
58 lines
1.8 KiB
Rust
58 lines
1.8 KiB
Rust
//! Native paginated history envelopes. Raw rows and unary responses retain unknown fields.
|
|
use bytes::Bytes;
|
|
use prost::Message;
|
|
|
|
#[derive(Clone, Message)]
|
|
pub(super) struct TurnsRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub thread_id: String,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub cursor: Option<String>,
|
|
#[prost(uint32, optional, tag = "3")]
|
|
pub limit: Option<u32>,
|
|
#[prost(int32, optional, tag = "4")]
|
|
pub order: Option<i32>,
|
|
#[prost(int32, optional, tag = "6")]
|
|
pub access: Option<i32>,
|
|
}
|
|
#[derive(Clone, Message)]
|
|
pub(super) struct ItemsRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub thread_id: String,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub turn_id: Option<String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub cursor: Option<String>,
|
|
#[prost(uint32, optional, tag = "4")]
|
|
pub limit: Option<u32>,
|
|
#[prost(int32, optional, tag = "5")]
|
|
pub order: Option<i32>,
|
|
#[prost(int32, optional, tag = "6")]
|
|
pub access: Option<i32>,
|
|
}
|
|
#[derive(Clone, Message)]
|
|
pub(super) struct Page {
|
|
#[prost(message, optional, tag = "1")]
|
|
pub data: Option<Rows>,
|
|
#[prost(string, optional, tag = "2")]
|
|
pub next_cursor: Option<String>,
|
|
#[prost(string, optional, tag = "3")]
|
|
pub backwards_cursor: Option<String>,
|
|
}
|
|
#[derive(Clone, Message)]
|
|
pub(super) struct Rows {
|
|
#[prost(bytes = "bytes", repeated, tag = "1")]
|
|
pub values: Vec<Bytes>,
|
|
}
|
|
#[derive(Clone, Message)]
|
|
pub(super) struct ItemEntry {
|
|
#[prost(string, optional, tag = "1")]
|
|
pub turn_id: Option<String>,
|
|
#[prost(message, optional, tag = "2")]
|
|
pub item: Option<crate::item_wire::Item>,
|
|
#[prost(int64, optional, tag = "3")]
|
|
pub started_at_ms: Option<i64>,
|
|
#[prost(int64, optional, tag = "4")]
|
|
pub completed_at_ms: Option<i64>,
|
|
}
|