5a581c78a2
Build / build (push) Has been cancelled
Docker / build (push) Has been cancelled
Lint / ruff (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.11) (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.12) (push) Has been cancelled
Test / pytest (windows-latest, 3.11) (push) Has been cancelled
Test / pytest (windows-latest, 3.12) (push) Has been cancelled
Introduce provider, model, and invocation contracts with encrypted configuration persistence. Add web runtime fencing, route fallback, recovery middleware, workspace scoping, and comprehensive tests.
54 lines
1.6 KiB
Python
54 lines
1.6 KiB
Python
from __future__ import annotations
|
|
|
|
from EvoScientist.middleware import recoverable_tools
|
|
|
|
|
|
def test_tool_effect_context_prefers_dedicated_grant(monkeypatch):
|
|
monkeypatch.setattr(
|
|
"langgraph.config.get_config",
|
|
lambda: {
|
|
"configurable": {
|
|
"ai4sci_model_proxy": {
|
|
"gateway_url": "http://gateway",
|
|
"run_id": "model-run",
|
|
"envelope_signature": "model-signature",
|
|
},
|
|
"ai4sci_tool_effect": {
|
|
"gateway_url": "http://gateway",
|
|
"run_id": "tool-run",
|
|
"envelope_signature": "tool-signature",
|
|
},
|
|
},
|
|
"metadata": {},
|
|
},
|
|
)
|
|
|
|
proxy, _ = recoverable_tools._context()
|
|
|
|
assert proxy == {
|
|
"gateway_url": "http://gateway",
|
|
"run_id": "tool-run",
|
|
"envelope_signature": "tool-signature",
|
|
}
|
|
|
|
|
|
def test_evomemory_never_falls_back_to_parent_model_proxy(monkeypatch):
|
|
monkeypatch.setattr(
|
|
"langgraph.config.get_config",
|
|
lambda: {
|
|
"configurable": {
|
|
"ai4sci_model_proxy": {
|
|
"gateway_url": "http://gateway",
|
|
"run_id": "parent-run",
|
|
"envelope_signature": "parent-signature",
|
|
},
|
|
},
|
|
"metadata": {"run_kind": "evomemory_turn_worker"},
|
|
},
|
|
)
|
|
|
|
proxy, metadata = recoverable_tools._context()
|
|
|
|
assert proxy is None
|
|
assert metadata["run_kind"] == "evomemory_turn_worker"
|