From f9a0f31f8091bffc635f04dd2ad4e1d5a8fd821f Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Fri, 8 May 2026 21:54:24 +0200 Subject: [PATCH] server: drop 503 from OpenAPI on admission-gated endpoints (unreachable) Cursor Bugbot LOW on commit 3ad359d: try_admit_rewrite is defined and tested but no HTTP handler calls it; the six handler OpenAPI annotations declared status = 503 (added in 8e1a8e7) but try_admit (the only path handlers invoke) returns 429 only. 503 was unreachable. Fix: remove (status = 503, ...) from the six handler OpenAPI annotations and regenerate openapi.json. Kept as forward-looking infrastructure: try_admit_rewrite, global rewrite semaphore, RejectReason::GlobalRewriteExhausted, ApiError::ServiceUnavailable, the 503 branch in IntoResponse, --global-rewrite-cap, and OMNIGRAPH_GLOBAL_REWRITE_MAX. When a future commit wires try_admit_rewrite into a handler, the 503 OpenAPI annotation lands alongside that wiring. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/omnigraph-server/src/lib.rs | 6 --- openapi.json | 60 ------------------------------ 2 files changed, 66 deletions(-) diff --git a/crates/omnigraph-server/src/lib.rs b/crates/omnigraph-server/src/lib.rs index dfd5924..2c1e241 100644 --- a/crates/omnigraph-server/src/lib.rs +++ b/crates/omnigraph-server/src/lib.rs @@ -928,7 +928,6 @@ async fn server_export( (status = 403, description = "Forbidden", body = ErrorOutput), (status = 409, description = "Merge conflict", body = ErrorOutput), (status = 429, description = "Per-actor admission cap exceeded; honor `Retry-After` header", body = ErrorOutput), - (status = 503, description = "Global rewrite pool exhausted; honor `Retry-After` header", body = ErrorOutput), ), security(("bearer_token" = [])), )] @@ -1055,7 +1054,6 @@ async fn server_schema_get( (status = 401, description = "Unauthorized", body = ErrorOutput), (status = 403, description = "Forbidden", body = ErrorOutput), (status = 429, description = "Per-actor admission cap exceeded; honor `Retry-After` header", body = ErrorOutput), - (status = 503, description = "Global rewrite pool exhausted; honor `Retry-After` header", body = ErrorOutput), ), security(("bearer_token" = [])), )] @@ -1111,7 +1109,6 @@ async fn server_schema_apply( (status = 401, description = "Unauthorized", body = ErrorOutput), (status = 403, description = "Forbidden", body = ErrorOutput), (status = 429, description = "Per-actor admission cap exceeded; honor `Retry-After` header", body = ErrorOutput), - (status = 503, description = "Global rewrite pool exhausted; honor `Retry-After` header", body = ErrorOutput), ), security(("bearer_token" = [])), )] @@ -1240,7 +1237,6 @@ async fn server_branch_list( (status = 403, description = "Forbidden", body = ErrorOutput), (status = 409, description = "Branch already exists", body = ErrorOutput), (status = 429, description = "Per-actor admission cap exceeded; honor `Retry-After` header", body = ErrorOutput), - (status = 503, description = "Global rewrite pool exhausted; honor `Retry-After` header", body = ErrorOutput), ), security(("bearer_token" = [])), )] @@ -1307,7 +1303,6 @@ async fn server_branch_create( (status = 403, description = "Forbidden", body = ErrorOutput), (status = 404, description = "Branch not found", body = ErrorOutput), (status = 429, description = "Per-actor admission cap exceeded; honor `Retry-After` header", body = ErrorOutput), - (status = 503, description = "Global rewrite pool exhausted; honor `Retry-After` header", body = ErrorOutput), ), security(("bearer_token" = [])), )] @@ -1367,7 +1362,6 @@ async fn server_branch_delete( (status = 403, description = "Forbidden", body = ErrorOutput), (status = 409, description = "Merge conflict", body = ErrorOutput), (status = 429, description = "Per-actor admission cap exceeded; honor `Retry-After` header", body = ErrorOutput), - (status = 503, description = "Global rewrite pool exhausted; honor `Retry-After` header", body = ErrorOutput), ), security(("bearer_token" = [])), )] diff --git a/openapi.json b/openapi.json index ce7aa1c..0934925 100644 --- a/openapi.json +++ b/openapi.json @@ -133,16 +133,6 @@ } } } - }, - "503": { - "description": "Global rewrite pool exhausted; honor `Retry-After` header", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorOutput" - } - } - } } }, "security": [ @@ -230,16 +220,6 @@ } } } - }, - "503": { - "description": "Global rewrite pool exhausted; honor `Retry-After` header", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorOutput" - } - } - } } }, "security": [ @@ -318,16 +298,6 @@ } } } - }, - "503": { - "description": "Global rewrite pool exhausted; honor `Retry-After` header", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorOutput" - } - } - } } }, "security": [ @@ -415,16 +385,6 @@ } } } - }, - "503": { - "description": "Global rewrite pool exhausted; honor `Retry-After` header", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorOutput" - } - } - } } }, "security": [ @@ -715,16 +675,6 @@ } } } - }, - "503": { - "description": "Global rewrite pool exhausted; honor `Retry-After` header", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorOutput" - } - } - } } }, "security": [ @@ -916,16 +866,6 @@ } } } - }, - "503": { - "description": "Global rewrite pool exhausted; honor `Retry-After` header", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorOutput" - } - } - } } }, "security": [