generated from coulomb/repo-seed
feat(shell): add interactive cya shell session (CYA-WP-0007)
Implement the full interactive shell REPL with session persistence, opt-in capped/redacted shell history, State Hub orientation and explicit slash-command writes, orchestrator/safety wiring, end-session learning hooks, weakness hints, docs, and tests.
This commit is contained in:
@@ -8,3 +8,39 @@ import pytest
|
||||
|
||||
# Future: common fixtures for envelopes, fake adapters, etc.
|
||||
# For now this file exists to establish the test layout.
|
||||
|
||||
# The llm-connect integration tests mock llm_connect symbols. When the optional
|
||||
# sibling package is not installed in a default dev checkout, provide a tiny
|
||||
# import target so unittest.mock.patch can attach to it. Real installations win.
|
||||
def pytest_configure(config):
|
||||
import importlib.util
|
||||
import sys
|
||||
import types
|
||||
|
||||
if importlib.util.find_spec("llm_connect") is not None:
|
||||
return
|
||||
if "llm_connect" in sys.modules:
|
||||
return
|
||||
|
||||
llm_connect = types.ModuleType("llm_connect")
|
||||
llm_config = types.ModuleType("llm_connect.config")
|
||||
llm_models = types.ModuleType("llm_connect.models")
|
||||
|
||||
class RunConfig:
|
||||
def __init__(self, *, model_name, temperature, max_tokens):
|
||||
self.model_name = model_name
|
||||
self.temperature = temperature
|
||||
self.max_tokens = max_tokens
|
||||
|
||||
def _missing_create_adapter(*args, **kwargs):
|
||||
raise RuntimeError("llm_connect test stub was not patched")
|
||||
|
||||
llm_connect.create_adapter = _missing_create_adapter
|
||||
llm_config.resolve_api_key = lambda env_var=None: None
|
||||
llm_models.RunConfig = RunConfig
|
||||
llm_connect.config = llm_config
|
||||
llm_connect.models = llm_models
|
||||
|
||||
sys.modules["llm_connect"] = llm_connect
|
||||
sys.modules["llm_connect.config"] = llm_config
|
||||
sys.modules["llm_connect.models"] = llm_models
|
||||
|
||||
Reference in New Issue
Block a user