Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

fix(spec): provider kernel follows production — openai is a Responses vendor, WS capability is id-gated

Rach Pradhanb0e7c90069a2
diff --git a/lean-proofs/Graff/Provider.lean b/lean-proofs/Graff/Provider.lean
index 16d278db..06774287 100644
--- a/lean-proofs/Graff/Provider.lean
+++ b/lean-proofs/Graff/Provider.lean
@@ -47,7 +47,7 @@ def specs : List Row :=
[ { id := "anthropic", kind := .anthropic, auth := .xApiKey, catalog := .anthropic }
, { id := "codegraff", kind := .openai, auth := .bearer, login := .codegraffDevice, catalog := .openai, takesEffort := true }
, { id := "deepseek", kind := .openai, auth := .bearer, takesEffort := true }
- , { id := "openai", kind := .openai, auth := .bearer }
+ , { id := "openai", kind := .responses, auth := .bearer }
, { id := "minimax", kind := .anthropic, auth := .bearer }
, { id := "xiaomi", kind := .openai, auth := .bearer }
, { id := "kilo", kind := .openai, auth := .bearer }
@@ -68,7 +68,11 @@ def ids : List String := specs.map (·.id)
def find (id : String) : Option Row := specs.find? (fun r => r.id == id)
-def wsCapable (r : Row) : Bool := r.kind == .responses
+/-- Production gates WS on provider id as well as wire kind (#514): only
+codex and xai actually serve a WebSocket endpoint — platform OpenAI's
+Responses wire has none. On the baked table that keeps codex the only
+WS row (xai's baked kind is openai; its Responses flip is runtime). -/
+def wsCapable (r : Row) : Bool := (r.id == "codex" || r.id == "xai") && r.kind == .responses
def responsesCount : Nat := countWhere (fun r => r.kind == .responses) specs
@@ -77,7 +81,7 @@ def xApiKeyCount : Nat := countWhere (fun r => r.auth == .xApiKey) specs
def providerRows : Nat := specs.length
theorem provider_cube : providerRows = 18 := by native_decide
-theorem one_responses_vendor : responsesCount = 1 := by native_decide
+theorem responses_vendors : responsesCount = 2 := by native_decide
theorem one_x_api_key : xApiKeyCount = 1 := by native_decide
theorem unique_ids : unique ids = true := by native_decide
diff --git a/spec/conformance.py b/spec/conformance.py
index 158d2283..9ec02bcb 100644
--- a/spec/conformance.py
+++ b/spec/conformance.py
@@ -335,8 +335,8 @@ def check_provider() -> int:
if len(PROVIDER_SPECS) != 18:
raise Counterexample("provider-count", None, f"n={len(PROVIDER_SPECS)} want=18")
responses = [r for r in PROVIDER_SPECS if r["kind"] == "responses"]
- if [r["id"] for r in responses] != ["codex"]:
- raise Counterexample("only-codex-responses", None, f"{responses}")
+ if [r["id"] for r in responses] != ["openai", "codex"]:
+ raise Counterexample("responses-vendors", None, f"{responses}")
x_key = [r for r in PROVIDER_SPECS if r["auth"] == "x_api_key"]
if [r["id"] for r in x_key] != ["anthropic"]:
raise Counterexample("only-anthropic-x-api-key", None, f"{x_key}")
diff --git a/spec/kernels/providers.json b/spec/kernels/providers.json
index 655a6807..0e3fd1c7 100644
--- a/spec/kernels/providers.json
+++ b/spec/kernels/providers.json
@@ -31,7 +31,7 @@
},
{
"id": "openai",
- "kind": "openai",
+ "kind": "responses",
"auth": "bearer",
"login": "api_key",
"catalog": "baked",
diff --git a/spec/ref/provider.py b/spec/ref/provider.py
index 0fb5edd7..cff88ef9 100644
--- a/spec/ref/provider.py
+++ b/spec/ref/provider.py
@@ -34,7 +34,7 @@ SPECS: list[dict] = [
row("anthropic", "anthropic", "x_api_key", catalog="anthropic"),
row("codegraff", "openai", "bearer", login="codegraff_device", catalog="openai", takes_effort=True),
row("deepseek", "openai", "bearer", takes_effort=True),
- row("openai", "openai", "bearer"),
+ row("openai", "responses", "bearer"),
row("minimax", "anthropic", "bearer"),
row("xiaomi", "openai", "bearer"),
row("kilo", "openai", "bearer"),
@@ -53,4 +53,5 @@ SPECS: list[dict] = [
def ws_capable(r: dict) -> bool:
- return r["kind"] == "responses"
+ # #514: only codex and xai serve a WS endpoint; platform OpenAI does not.
+ return r["id"] in ("codex", "xai") and r["kind"] == "responses"