Skip to content

Nil pointer dereference in /v1/chat/completions — gRPC responses not nil-checked #946

Closed @unameisfine opened 2026-03-25 15:52 UTC 1 comment Updated 2026-03-25 16:04 UTC

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:

  1. enforceDeveloperAccessGate (line 250): paramsResp.Params.DeveloperAccessParams — panics if paramsResp is nil. Called for ALL requests (both transfer and executor paths).

  2. handleTransferRequest (line 294): raw gRPC error returned without echo.NewHTTPError wrapping — error handler middleware receives an unexpected error type.

  3. validateRequester (line 1000): priceResponse.Found — panics if priceResponse is nil after GetModelPerTokenPrice query.

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)

@unameisfine commented 2026-03-25 16:04 UTC

Closing in favor of #876 — this is the same issue. Posted analysis there instead.


🔄 Auto-synced from Issue #946 every hour.