mirror of
https://github.com/openai/codex.git
synced 2026-11-10 21:00:47 +00:00
## What changed Add a save RPC that accepts the existing report options and an absolute `savePath` on the server host. Save the report, selected attachments, and a manifest without uploading, and return `savedPath`, `threadId`, and `promptHash`. Local exports remain available when uploads are disabled by configuration. Publish archives atomically without replacing existing files. Bound uncompressed contents to 200 MiB and attachments to 128, preserve duplicate attachment names safely, and fail without publishing a partial ZIP when a selected file cannot be read. Honor `includeLogs` and omit automatic rollouts for untouched threads without materializing them. Update protocol schemas and generated TypeScript and Python types. ## Testing Add coverage for local-only saves, disabled uploads, path validation, overwrite protection, log consent, archive budgets, duplicate names, missing files, and rollout selection before materialization and after writer shutdown. GitOrigin-RevId: 222c0fe7ab923904de9c8a9f12ad27f7a0104875
58 lines
2.0 KiB
Rust
58 lines
2.0 KiB
Rust
use crate::JsonSchema;
|
|
use crate::TS;
|
|
use codex_utils_path_uri::LegacyAppPathString;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
use std::collections::BTreeMap;
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct FeedbackUploadParams {
|
|
pub classification: String,
|
|
#[ts(optional = nullable)]
|
|
pub reason: Option<String>,
|
|
#[ts(optional = nullable)]
|
|
pub thread_id: Option<String>,
|
|
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
|
pub include_logs: bool,
|
|
#[ts(optional = nullable)]
|
|
pub extra_log_files: Option<Vec<PathBuf>>,
|
|
#[ts(optional = nullable)]
|
|
pub tags: Option<BTreeMap<String, String>>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct FeedbackUploadResponse {
|
|
pub thread_id: String,
|
|
/// Whitespace-normalized SHA-256 of the session base instructions, matching the
|
|
/// uploaded `prompt_hash` tag. Does not include later developer messages.
|
|
/// Null when the reported rollout has no prompt metadata.
|
|
#[serde(default)]
|
|
pub prompt_hash: Option<String>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct FeedbackSaveParams {
|
|
#[serde(flatten)]
|
|
pub feedback: FeedbackUploadParams,
|
|
/// Absolute, previously unused ZIP path on the app-server host.
|
|
/// The caller owns this file, including after a disconnected RPC.
|
|
pub save_path: LegacyAppPathString,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct FeedbackSaveResponse {
|
|
pub saved_path: LegacyAppPathString,
|
|
pub thread_id: String,
|
|
/// Same prompt hash as feedback/upload; null when prompt metadata is absent.
|
|
pub prompt_hash: Option<String>,
|
|
}
|