simbiot-harness/venv/lib/python3.12/site-packages/httpx2/websockets/_exceptions.py
Simbiot Harness b60439152b Simbiot Harness v0.1: тактовая лестница на Strands + CQRS/ES-спина
- harness/es.py: append-only event store + проекции (образец — кооп-портал)
- harness/levels.py: уровни 1с/1м/1ч/1д, контекст ∝ масштабу
- harness/scheduler.py: уровневые потоки, идемпотентные тики, absorbed-стабы
- harness/isolated_runner.py + _llm_worker.py: LLM-тик в сабпроцессе
  (глобальный asyncio-рантайм Strands не переживает 2+ create_harness)
- cli.py: init/task/tasks/status/events + requeue (написан самим минутным агентом)
- 9router: отдельный ключ sk-simbiot, модель auto (glm-5.3 первым)
2026-09-29 15:28:50 +00:00

55 lines
1.3 KiB
Python

from __future__ import annotations
import typing
if typing.TYPE_CHECKING:
import wsproto
from .._models import Response
class HTTPXWSException(Exception):
"""
Base exception class for HTTPX WS.
"""
class WebSocketUpgradeError(HTTPXWSException):
"""
Raised when the initial connection didn't correctly upgrade to a WebSocket session.
"""
def __init__(self, response: Response) -> None:
self.response = response
class WebSocketDisconnect(HTTPXWSException):
"""
Raised when the server closed the WebSocket session.
Args:
code:
The integer close code to indicate why the connection has closed.
reason:
Additional reasoning for why the connection has closed.
"""
def __init__(self, code: int = 1000, reason: str | None = None) -> None:
self.code = code
self.reason = reason or ""
class WebSocketInvalidTypeReceived(HTTPXWSException):
"""
Raised when an event is not of the expected type.
"""
def __init__(self, event: wsproto.events.Event) -> None:
self.event = event
class WebSocketNetworkError(HTTPXWSException):
"""
Raised when a network error occured,
typically if the underlying stream has closed or timeout.
"""