router-for-me/CLIProxyAPI · critical
Codex live response requires an SDP answer
Error message
Codex live response requires an SDP answer
What it means
C.malloc failed for the small host-context pointer block created alongside the host API struct. Same class as the host-api allocation failure: process out of memory or a corrupted C allocator. Partial allocations are freed and the library closed before returning.
Source
Thrown at internal/client/codex/live/live.go:748
payload["sdp"] = encodedSDP
encoded, errMarshal := json.Marshal(payload)
if errMarshal != nil {
return nil, "", fmt.Errorf("failed to encode Codex live call request: %w", errMarshal)
}
return encoded, "application/json", nil
}
func callResponseSDP(body []byte, contentType string) (string, error) {
mediaType, _, errMediaType := mime.ParseMediaType(contentType)
if errMediaType == nil && strings.EqualFold(mediaType, "application/json") {
var payload struct {
SDP string `json:"sdp"`
}
if errUnmarshal := json.Unmarshal(body, &payload); errUnmarshal != nil {
return "", fmt.Errorf("failed to decode Codex live response: %w", errUnmarshal)
}
if strings.TrimSpace(payload.SDP) == "" {
return "", errors.New("Codex live response requires an SDP answer")
}
return payload.SDP, nil
}
if strings.TrimSpace(string(body)) == "" {
return "", errors.New("Codex live response requires an SDP answer")
}
return string(body), nil
}
func modelFromJSON(body []byte) string {
var payload struct {
Model string `json:"model"`
Session struct {
Model string `json:"model"`
} `json:"session"`
}
if errUnmarshal := json.Unmarshal(body, &payload); errUnmarshal != nil {
return ""View on GitHub (pinned to 78f0c4079e)
Solutions
- Increase memory limits or unload unused plugins.
- Profile native (CGO) memory usage — Go heap metrics alone will not show C-side exhaustion.
- Isolate suspicious plugins to identify allocator corruption if memory is genuinely available.
Defensive patterns
Strategy: fallback
Prevention
- Account for CGO/native memory, not just Go heap, when sizing containers.
- Unload unused plugins to release native resources.
- Audit native plugins for allocator corruption if failures recur with free memory.
When it happens
Trigger: Loading a plugin while the process is out of memory; native memory exhaustion from CGO-heavy workloads.
Common situations: Memory-capped containers; leaks in other native plugins consuming the C heap.
Related errors
- Codex live media relay requires an SDP or JSON call request
- Codex live remote TCP proxy does not support cancellation
- Codex live media relay capacity exhausted
- auth file not found
- count must be a positive integer
AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15).
Data as JSON: /api/errors/8ae3247ff22ddfe7.
Report an issue: GitHub.