Execute approved tool calls
CI / Rust Checks (push) Successful in 1h31m49s
CI / UI Checks (push) Successful in 5s
CI / Frontend E2E (push) Has been cancelled
CI / Deployment Manifests (push) Has been cancelled
CI / Deploy (push) Has been cancelled

This commit is contained in:
github-ops
2026-06-24 12:49:57 +00:00
parent 78d3052a61
commit 267061e226
9 changed files with 282 additions and 26 deletions
@@ -187,6 +187,49 @@ impl PostgresRegistry {
row.map(map_approval_request_row).transpose()
}
pub async fn finish_approval_request(
&self,
request: FinishApprovalRequest<'_>,
) -> Result<Option<ApprovalRequestRecord>, RegistryError> {
let row = sqlx::query(
"update approval_requests
set status = $1,
response_payload_json = $2,
decision_note = coalesce($3, decision_note)
where workspace_id = $4
and agent_id = $5
and id = $6
and status = 'approved'
returning
id,
workspace_id,
agent_id,
operation_id,
operation_version,
status,
risk_level,
confirmation_title,
confirmation_body,
request_payload_json,
response_payload_json,
created_at,
expires_at,
decided_at,
decided_by_key_id,
decision_note",
)
.bind(serialize_enum_text(&request.status, "approval_status")?)
.bind(request.response_payload.as_ref().map(Json))
.bind(request.decision_note)
.bind(request.workspace_id.as_str())
.bind(request.agent_id.as_str())
.bind(request.approval_id.as_str())
.fetch_optional(&self.pool)
.await?;
row.map(map_approval_request_row).transpose()
}
}
fn map_approval_request_row(row: PgRow) -> Result<ApprovalRequestRecord, RegistryError> {