chenhg5/cc-connect · error
%s: %s
Error message
%s: %s
What it means
rpcRequestOverIO matched the JSON-RPC response to its request id, but the response carried a non-null `error` field; the server-side error message is returned prefixed with the RPC method name. This is an application-level error reported by the codex app-server itself for the requested method.
Source
Thrown at agent/codex/session.go:756
var probe map[string]json.RawMessage
if err := json.Unmarshal(bytes.TrimSpace(line), &probe); err != nil {
continue
}
if _, ok := probe["id"]; !ok {
continue
}
var resp rpcResponseEnvelope
if err := json.Unmarshal(bytes.TrimSpace(line), &resp); err != nil {
continue
}
respID, ok := rpcIDToInt64(resp.ID)
if !ok || respID != id {
continue
}
if resp.Error != nil {
return fmt.Errorf("%s: %s", method, strings.TrimSpace(resp.Error.Message))
}
if out != nil {
if err := json.Unmarshal(resp.Result, out); err != nil {
return fmt.Errorf("%s decode response: %w", method, err)
}
}
return nil
}
}
func rpcNotifyOverIO(stdin io.Writer, method string, params any) error {
payload := map[string]any{
"jsonrpc": "2.0",
"method": method,
"params": params,
}
return writeRPCMessage(stdin, payload)
}View on GitHub (pinned to 4000b2338a)
Solutions
- Read the embedded message after the method prefix — it states exactly why the server rejected the call.
- Update the Codex CLI so the app-server supports the RPC methods/params the connector sends.
- Re-authenticate (`codex login`) if the message indicates missing or expired credentials.
- Retry later for rate-limit/quota-style messages.
- Check the app-server's stderr logs for the full error context around the failing method.
Defensive patterns
Strategy: fallback
Validate before calling
// check version compatibility before RPC
codecVersion := queryCodexVersion(cfg.Command) // `codex --version`
if semver.Compare(codecVersion, minSupported) < 0 {
return fmt.Errorf("codex %s too old for app-server RPC; need >= %s", codecVersion, minSupported)
} Try / catch
err := rpcRequestOverIO(stdin, stdout, ctx, "initialize", params, &out)
if err != nil && isMethodLevelError(err) {
// message after the method prefix explains the server-side rejection
slog.Warn("app-server rejected method", "detail", err)
// fallback: use defaults instead of runtime config
} Prevention
- Keep codex and cc-connect versions in sync (both upgrade together)
- Read the embedded server message — it names the exact rejection reason
- Fall back to default runtime config when the RPC is rejected so the session can still start
- Re-authenticate when the message references credentials or quotas
When it happens
Trigger: A JSON-RPC response with matching id contains resp.Error != nil; the trimmed Error.Message is surfaced as `"<method>: <message>"` to the caller (loadCodexRuntimeConfig).
Common situations: Calling an RPC method unsupported by the installed codex version (method-not-found style errors); the app-server rejects the initialize params (bad protocol version, malformed capabilities); auth/quota errors returned over RPC.
Related errors
- codex app-server resume returned empty thread id
- codex app-server start returned empty thread id
- codex app-server turn/start: %w
- turn failed (no details)
- %s
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/7442dbfed79e8f0d.
Report an issue: GitHub.