Remove approval confirmation copy
This commit is contained in:
@@ -1086,8 +1086,6 @@ async fn maybe_create_pending_approval(
|
||||
},
|
||||
"expires_at": expires_at,
|
||||
"risk_level": policy.risk_level,
|
||||
"confirmation_title": policy.confirmation_title,
|
||||
"confirmation_body": policy.confirmation_body_template,
|
||||
"payload_preview": if policy.show_payload_preview {
|
||||
arguments.clone()
|
||||
} else {
|
||||
@@ -1102,8 +1100,6 @@ async fn maybe_create_pending_approval(
|
||||
operation_version: tool.operation.version,
|
||||
status: ApprovalRequestStatus::Pending,
|
||||
risk_level: policy.risk_level,
|
||||
confirmation_title: policy.confirmation_title.clone(),
|
||||
confirmation_body: policy.confirmation_body_template.clone(),
|
||||
request_payload: arguments.clone(),
|
||||
response_payload: None,
|
||||
created_at: now,
|
||||
|
||||
@@ -26,8 +26,6 @@ pub struct ApprovalRequest {
|
||||
pub operation_version: u32,
|
||||
pub status: ApprovalRequestStatus,
|
||||
pub risk_level: OperationApprovalRiskLevel,
|
||||
pub confirmation_title: String,
|
||||
pub confirmation_body: String,
|
||||
pub request_payload: Value,
|
||||
pub response_payload: Option<Value>,
|
||||
#[serde(with = "time::serde::rfc3339")]
|
||||
|
||||
@@ -125,8 +125,6 @@ pub enum OperationApprovalPayloadPreviewMode {
|
||||
pub struct OperationApprovalPolicy {
|
||||
pub required: bool,
|
||||
pub risk_level: OperationApprovalRiskLevel,
|
||||
pub confirmation_title: String,
|
||||
pub confirmation_body_template: String,
|
||||
pub ttl_seconds: u32,
|
||||
pub show_payload_preview: bool,
|
||||
pub payload_preview_mode: OperationApprovalPayloadPreviewMode,
|
||||
|
||||
@@ -568,8 +568,6 @@ pub async fn apply_postgres(pool: &PgPool) -> Result<(), sqlx::Error> {
|
||||
operation_version integer not null,
|
||||
status text not null,
|
||||
risk_level text not null,
|
||||
confirmation_title text not null,
|
||||
confirmation_body text not null,
|
||||
request_payload_json jsonb not null,
|
||||
response_payload_json jsonb null,
|
||||
created_at timestamptz not null,
|
||||
@@ -581,6 +579,13 @@ pub async fn apply_postgres(pool: &PgPool) -> Result<(), sqlx::Error> {
|
||||
)
|
||||
.execute(pool)
|
||||
.await?;
|
||||
|
||||
query("alter table approval_requests drop column if exists confirmation_title")
|
||||
.execute(pool)
|
||||
.await?;
|
||||
query("alter table approval_requests drop column if exists confirmation_body")
|
||||
.execute(pool)
|
||||
.await?;
|
||||
query(
|
||||
"create index if not exists approval_requests_agent_status_idx
|
||||
on approval_requests(workspace_id, agent_id, status, expires_at)",
|
||||
|
||||
@@ -14,8 +14,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -24,9 +22,9 @@ impl PostgresRegistry {
|
||||
decided_by_key_id,
|
||||
decision_note
|
||||
) values (
|
||||
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10,
|
||||
$11, $12::timestamptz, $13::timestamptz, $14::timestamptz,
|
||||
$15, $16
|
||||
$1, $2, $3, $4, $5, $6, $7, $8,
|
||||
$9, $10::timestamptz, $11::timestamptz, $12::timestamptz,
|
||||
$13, $14
|
||||
)",
|
||||
)
|
||||
.bind(request.approval.id.as_str())
|
||||
@@ -42,8 +40,6 @@ impl PostgresRegistry {
|
||||
&request.approval.risk_level,
|
||||
"approval_risk_level",
|
||||
)?)
|
||||
.bind(&request.approval.confirmation_title)
|
||||
.bind(&request.approval.confirmation_body)
|
||||
.bind(Json(&request.approval.request_payload))
|
||||
.bind(request.approval.response_payload.as_ref().map(Json))
|
||||
.bind(request.approval.created_at)
|
||||
@@ -77,8 +73,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -116,8 +110,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -157,8 +149,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -195,8 +185,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -241,8 +229,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -286,8 +272,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -328,8 +312,6 @@ impl PostgresRegistry {
|
||||
operation_version,
|
||||
status,
|
||||
risk_level,
|
||||
confirmation_title,
|
||||
confirmation_body,
|
||||
request_payload_json,
|
||||
response_payload_json,
|
||||
created_at,
|
||||
@@ -362,8 +344,6 @@ fn map_approval_request_row(row: PgRow) -> Result<ApprovalRequestRecord, Registr
|
||||
&row.get::<String, _>("risk_level"),
|
||||
"approval_risk_level",
|
||||
)?,
|
||||
confirmation_title: row.get("confirmation_title"),
|
||||
confirmation_body: row.get("confirmation_body"),
|
||||
request_payload: row.get::<Value, _>("request_payload_json"),
|
||||
response_payload: row.get::<Option<Value>, _>("response_payload_json"),
|
||||
created_at: row.get("created_at"),
|
||||
|
||||
@@ -487,8 +487,6 @@ async fn manages_approval_request_lifecycle() {
|
||||
operation_version: 1,
|
||||
status: ApprovalRequestStatus::Pending,
|
||||
risk_level: OperationApprovalRiskLevel::Dangerous,
|
||||
confirmation_title: "Confirm action".to_owned(),
|
||||
confirmation_body: "Check payload before running.".to_owned(),
|
||||
request_payload: json!({"amount": 100}),
|
||||
response_payload: None,
|
||||
created_at: timestamp("2026-03-25T12:01:00Z"),
|
||||
|
||||
Reference in New Issue
Block a user