feat: add Memory Gateway integration with async support for memory snapshots and user management
This commit is contained in:
@ -85,6 +85,49 @@ def test_config_loader_reads_channels(tmp_path) -> None:
|
||||
assert channel.secrets == {"ignored_for_status": "secret-value"}
|
||||
|
||||
|
||||
def test_config_loader_reads_memory_gateway_config(tmp_path) -> None:
|
||||
config_path = tmp_path / "config.json"
|
||||
config_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"memory": {
|
||||
"mode": "gateway",
|
||||
"gateway": {
|
||||
"baseUrl": "http://127.0.0.1:1934",
|
||||
"apiKey": "gateway-key",
|
||||
"defaultUserId": "default-user",
|
||||
"timeoutSeconds": 12,
|
||||
"snapshotSearchLimit": 7,
|
||||
"commitOnRunComplete": False,
|
||||
},
|
||||
},
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
config = load_config(config_path=config_path)
|
||||
|
||||
assert config.memory.mode == "gateway"
|
||||
assert config.memory.gateway.base_url == "http://127.0.0.1:1934"
|
||||
assert config.memory.gateway.api_key == "gateway-key"
|
||||
assert config.memory.gateway.default_user_id == "default-user"
|
||||
assert config.memory.gateway.timeout_seconds == 12
|
||||
assert config.memory.gateway.snapshot_search_limit == 7
|
||||
assert config.memory.gateway.commit_on_run_complete is False
|
||||
|
||||
|
||||
def test_config_loader_defaults_to_local_memory(tmp_path) -> None:
|
||||
config_path = tmp_path / "config.json"
|
||||
config_path.write_text(json.dumps({}), encoding="utf-8")
|
||||
|
||||
config = load_config(config_path=config_path)
|
||||
|
||||
assert config.memory.mode == "local"
|
||||
assert config.memory.gateway.base_url == ""
|
||||
assert config.memory.gateway.commit_on_run_complete is True
|
||||
|
||||
|
||||
def test_provider_resolution_ignores_custom_and_disabled_overrides(tmp_path) -> None:
|
||||
config_path = tmp_path / "config.json"
|
||||
config_path.write_text(
|
||||
|
||||
Reference in New Issue
Block a user