- 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 первым)
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
import ssl
|
|
import sys
|
|
import typing
|
|
|
|
# Hold on to the original class so we can create it consistently
|
|
# even if we inject our own SSLContext into the ssl module.
|
|
_original_SSLContext = ssl.SSLContext
|
|
_original_super_SSLContext = super(_original_SSLContext, _original_SSLContext)
|
|
|
|
# CPython is known to be good, but non-CPython implementations
|
|
# may implement SSLContext differently so to be safe we don't
|
|
# subclass the SSLContext.
|
|
|
|
# This is returned by truststore.SSLContext.__class__()
|
|
_truststore_SSLContext_dunder_class: typing.Optional[type]
|
|
|
|
# This value is the superclass of truststore.SSLContext.
|
|
_truststore_SSLContext_super_class: type
|
|
|
|
if sys.implementation.name == "cpython":
|
|
_truststore_SSLContext_super_class = _original_SSLContext
|
|
_truststore_SSLContext_dunder_class = None
|
|
else:
|
|
_truststore_SSLContext_super_class = object
|
|
_truststore_SSLContext_dunder_class = _original_SSLContext
|
|
|
|
|
|
def _set_ssl_context_verify_mode(
|
|
ssl_context: ssl.SSLContext, verify_mode: ssl.VerifyMode
|
|
) -> None:
|
|
_original_super_SSLContext.verify_mode.__set__(ssl_context, verify_mode) # type: ignore[attr-defined]
|