can1357/oh-my-pi · error · RpcTimeoutError
Timed out waiting for response to {command_type}. Stderr: {s
Error message
Timed out waiting for response to {command_type}. Stderr: {self.stderr} What it means
RpcTimeoutError raised by _request when no response for the given command_type arrives on the per-request response queue within self._request_timeout. The pending entry is removed and stderr is attached for diagnosis.
Source
Thrown at python/omp-rpc/src/omp_rpc/client.py:1399
response_queue: queue.Queue[JsonObject | BaseException] = queue.Queue(maxsize=1)
with self._state_lock:
self._pending[request_id] = _PendingRequest(
command=command_type, response_queue=response_queue
)
try:
self._write_json(process, envelope)
except BaseException:
with self._state_lock:
self._pending.pop(request_id, None)
raise
try:
response = response_queue.get(timeout=self._request_timeout)
except queue.Empty as exc:
with self._state_lock:
self._pending.pop(request_id, None)
raise RpcTimeoutError(
f"Timed out waiting for response to {command_type}. Stderr: {self.stderr}"
) from exc
if isinstance(response, BaseException):
raise response
if not bool(response.get("success", False)):
raw_code = response.get("code")
raise RpcCommandError(
command=str(response.get("command", command_type)),
error=str(response.get("error", "")),
code=raw_code if isinstance(raw_code, str) else None,
)
data = response.get("data")
if data is None:
return {}
return _clone_json_object(data)View on GitHub (pinned to 9690622007)
Solutions
- Increase the client's request_timeout at construction
- Avoid issuing synchronous commands while a prompt/stream is in flight; use async commands or wait for agent_end first
- Check client.stderr and server state to see whether the handler crashed or is blocked
- Retry the command after confirming the process is alive (catch RpcTimeoutError and re-issue)
Example fix
// before client = make_client(request_timeout=10) // after client = make_client(request_timeout=120) # tolerate slow session/model commands
Defensive patterns
Strategy: retry
Validate before calling
if client.poll() is not None:
raise RuntimeError("cannot send request; server process dead") Try / catch
for attempt in range(2):
try:
return client._request(command_type, **payload) # via public wrapper
except RpcTimeoutError as exc:
if attempt == 1:
raise
log.warning("request %s timed out, retrying", command_type) Prevention
- Configure request_timeout above your slowest command's latency
- Don't interleave sync requests with in-flight streaming prompts
- Verify process liveness before sending commands
When it happens
Trigger: Any synchronous RPC command (e.g. a request-style call) whose server-side handler takes longer than _request_timeout or never responds because the server is busy/hung/deadlocked.
Common situations: Slow commands (model listing, session load) on large sessions; server busy streaming a long prompt so request handling starves; request_timeout configured too low.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Timed out waiting for agent_end. Stderr: {self.stderr}
- bridge call {name!r} failed
- Timed out initializing daemon broker token in ${runtimeDir}
- Host URI write failed for ${url.href}
- Client already started
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/23c50e6ef8f36e4a.
Report an issue: GitHub.