From da2bf4f78ee067257ffe8ab82308cf1511d7ac24 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 29 Nov 2026 12:57:58 +0100 Subject: [PATCH] Let 32k models back into free-best; count the temp dir as scratch The todoImplementer board's pi turns now fit a 32k window (T2631: tool results clipped, each request cut to the window), so the combo floor drops from 100k to 32k and SEA-LION and ovhanon's gpt-oss come back. free-llm-check-dir refused files under $TMPDIR (/var/disktmp here), so test_hook and test_privacy failed on this PC: the system temp dir now counts as scratch, as /tmp does. Bug-class-check: scratch roots hard-coded /tmp; now include tempfile.gettempdir() (todoImplementer T2631) Co-Authored-By: Claude Opus 5.5 --- omniroute_offload/omniroute_offload/_gw_combo.py | 8 ++++---- omniroute_offload/omniroute_offload/_privacy.py | 10 ++++++---- .../omniroute_offload/tests/test_gw_combo.py | 16 ++++++++++++---- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/omniroute_offload/omniroute_offload/_gw_combo.py b/omniroute_offload/omniroute_offload/_gw_combo.py index 914653e..d570b5b 100644 --- a/omniroute_offload/omniroute_offload/_gw_combo.py +++ b/omniroute_offload/omniroute_offload/_gw_combo.py @@ -29,10 +29,10 @@ if TYPE_CHECKING: MIN_PROMPT = 16_000 MIN_TETRIS = 0.85 -# OmniRoute caps a combo's input at its smallest member's limit; a board turn sends -# 35k+ tokens and grows, so one 32k member failed every turn with "Input exceeds -# context window" (todoImplementer T2628). -MIN_CONTEXT = 100_000 +# OmniRoute caps a combo's input at its smallest member's limit. A board turn once +# sent 35k+ tokens and grew, so one 32k member failed every turn (T2628); since T2631 +# the board's pi turns fit a 32k window (piturn.WINDOW), so 32k members are in again. +MIN_CONTEXT = 32_000 # testStatus (or lastErrorType) of a login that is gone: kuhy reconnects it DEAD = frozenset({"expired", "unauthorized"}) diff --git a/omniroute_offload/omniroute_offload/_privacy.py b/omniroute_offload/omniroute_offload/_privacy.py index e4dc50b..bf3aad6 100644 --- a/omniroute_offload/omniroute_offload/_privacy.py +++ b/omniroute_offload/omniroute_offload/_privacy.py @@ -1,7 +1,8 @@ """Fail-closed checks on what may be sent to free (logging, maybe training) providers. -A file may go out only if it lives in a PUBLIC GitHub repo, or under /tmp or -/var/log, and is not a secret-shaped file. Every text is scanned for credential +A file may go out only if it lives in a PUBLIC GitHub repo, or under /tmp, +/var/log or the system temp dir ($TMPDIR, /var/disktmp on kuhy's PC), and is +not a secret-shaped file. Every text is scanned for credential patterns; that scan has no override. """ @@ -11,13 +12,14 @@ import json import re import subprocess import sys +import tempfile import time from fnmatch import fnmatch from pathlib import Path CACHE = Path.home() / ".cache/omniroute_offload/visibility.json" CACHE_TTL_S = 86400 -SCRATCH_ROOTS = (Path("/tmp"), Path("/var/log")) +SCRATCH_ROOTS = (Path("/tmp"), Path("/var/log"), Path(tempfile.gettempdir())) DENIED_HOME_DIRS = (".ssh", ".config", ".gnupg", ".aws", ".claude") DENIED_NAMES = ( ".env", @@ -58,7 +60,7 @@ def path_refusal(path: Path, *, home: Path) -> str | None: return f"{path}: under ~/{sub}" if _repo_root(path) or any(path.is_relative_to(root) for root in SCRATCH_ROOTS): return None - return f"{path}: not in a public repo, /tmp or /var/log" + return f"{path}: not in a public repo, /tmp, /var/log or the temp dir" def file_refusal(path: Path, *, home: Path) -> str | None: diff --git a/omniroute_offload/omniroute_offload/tests/test_gw_combo.py b/omniroute_offload/omniroute_offload/tests/test_gw_combo.py index 3578e6f..d34dd1e 100644 --- a/omniroute_offload/omniroute_offload/tests/test_gw_combo.py +++ b/omniroute_offload/omniroute_offload/tests/test_gw_combo.py @@ -267,24 +267,32 @@ def test_keep_live_survives_an_unreachable_api( def test_refresh_leaves_out_a_model_under_the_context_floor( cfg: gwc.Config, admins: list[FakeAdmin], capsys: pytest.CaptureFixture[str] ) -> None: - """OmniRoute caps a combo at its smallest member: a 32k one failed 35k turns.""" + """OmniRoute caps a combo at its smallest member; board turns fit 32k (T2631).""" _write( cfg, HEADER + "nv/big\tyes\t1.0\t128000\n" + "sea/small\tyes\t0.9\t128000\n" + + "sea/tiny\tyes\t0.9\t128000\n" + "groq/measured\tyes\t0.9\t16000\n" + "or/unknown\tyes\t0.9\t128000\n", ) - CONTEXTS.update({"nv/big": 128000, "sea/small": 32768, "groq/measured": 400000}) + CONTEXTS.update( + { + "nv/big": 128000, + "sea/small": 32768, + "sea/tiny": 16384, + "groq/measured": 400000, + } + ) assert combo.refresh(cfg) is True - assert admins[0].upserts == [(api.COMBO, ["nv/big", "or/unknown"])] + assert admins[0].upserts == [(api.COMBO, ["nv/big", "sea/small", "or/unknown"])] def test_refresh_keeps_the_combo_when_no_model_is_big_enough( cfg: gwc.Config, admins: list[FakeAdmin], capsys: pytest.CaptureFixture[str] ) -> None: - _write(cfg, HEADER + "sea/small\tyes\t0.9\t32000\n") + _write(cfg, HEADER + "sea/small\tyes\t0.9\t30000\n") assert combo.refresh(cfg) is False assert admins[0].upserts == [] assert "dead: none" in capsys.readouterr().err