Nil pointer dereference in /v1/chat/completions — gRPC responses not nil-checked #946
Related to #876.
Three gRPC response accesses in post_chat_handler.go lack nil guards, causing runtime panics when chain RPC is slow or partially responsive:
-
enforceDeveloperAccessGate(line 250):paramsResp.Params.DeveloperAccessParams— panics ifparamsRespis nil. Called for ALL requests (both transfer and executor paths). -
handleTransferRequest(line 294): raw gRPC error returned withoutecho.NewHTTPErrorwrapping — error handler middleware receives an unexpected error type. -
validateRequester(line 1000):priceResponse.Found— panics ifpriceResponseis nil afterGetModelPerTokenPricequery.
All three are in the common request path, which explains why all documented transfer-agent endpoints fail simultaneously under the same conditions.
The pattern used elsewhere in the codebase (e.g. enforceDeveloperAccessGate already nil-checks p on line 251) should be applied consistently to all gRPC responses.
💬 Comments (1)
🔄 Auto-synced from Issue #946 every hour.
Closing in favor of #876 — this is the same issue. Posted analysis there instead.