Persist queryable AI action outcomes and zero-effect rejection receipts
Foundry Go checks / check (push) Successful in 2m51s
Foundry Go checks / check (pull_request) Successful in 3m6s

This commit is contained in:
2026-11-08 00:53:11 +08:00
parent 00ff738705
commit f12c4ad8bd
8 changed files with 300 additions and 99 deletions
+8
View File
@@ -181,6 +181,14 @@ func (s *service) getCanvasAIAdmission(w http.ResponseWriter, r *http.Request, p
return err
}
var body json.RawMessage
err = tx.QueryRowContext(r.Context(), `SELECT response_body FROM canvas_ai_requests WHERE project=$1 AND workspace_id=$2 AND board_id=$3 AND account_id=$4 AND request_id=$5`, project, workspace, board, account, key).Scan(&body)
if err == nil {
reply(w, 200, body)
return nil
}
if err != sql.ErrNoRows {
return err
}
err = tx.QueryRowContext(r.Context(), `SELECT create_response FROM canvas_ai_runs WHERE project=$1 AND workspace_id=$2 AND board_id=$3 AND account_id=$4 AND idempotency_key=$5`, project, workspace, board, account, key).Scan(&body)
if err == sql.ErrNoRows {
reply(w, 404, response{"protocol_version": 2, "request_id": key, "status": "unknown", "error": "ai_admission_unknown"})