From 9b72488c92e433722ea803da5e5dcb865c97f1e4 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 29 Sep 2026 21:40:43 -0400 Subject: [PATCH] docs + unit test fix --- docs/advanced/configuration.mdx | 8 ++++++++ tests/test_cost_tracking.py | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/advanced/configuration.mdx b/docs/advanced/configuration.mdx index d2108e68f..a444b4974 100644 --- a/docs/advanced/configuration.mdx +++ b/docs/advanced/configuration.mdx @@ -49,6 +49,14 @@ Configure Strix using environment variables or a config file. Timeout in seconds for memory compression operations (context summarization). + + Send a per-agent `session_id` on OpenRouter requests, so each agent's calls stay on one upstream provider and its prompt cache carries over between turns. When unset, OpenRouter routes every request freely. + + + + Token block size that providers cache prompts in. A turn counts as a cache miss in the run report only when the cached tokens fall at least this many tokens short of the previous prompt and the prompt did not shrink. Lower it for providers with smaller blocks (DeepSeek and GLM use 64; vLLM defaults to 16). + + ### Dedicated deduplication model Finding deduplication is a cheap, structured classification task. By default it diff --git a/tests/test_cost_tracking.py b/tests/test_cost_tracking.py index 5b108abde..6a2f81a38 100644 --- a/tests/test_cost_tracking.py +++ b/tests/test_cost_tracking.py @@ -381,11 +381,11 @@ def test_openrouter_request_carries_agent_session_id() -> None: assert "session_id" not in body() token = request_log.bind_call_context("a1b2c3d4", "root") try: - session_id = body()["session_id"] - assert str(uuid.UUID(session_id)) == session_id - assert body()["session_id"] == session_id + assert "session_id" not in body() with patch("strix.config.models.load_settings") as settings: - settings.return_value.llm.openrouter_sticky_sessions = False - assert "session_id" not in body() + settings.return_value.llm.openrouter_sticky_sessions = True + session_id = body()["session_id"] + assert str(uuid.UUID(session_id)) == session_id + assert body()["session_id"] == session_id finally: request_log.reset_call_context(token)