Merge pull request #1733 from NousResearch/fix/defensive-hardening
fix: defensive hardening — logging, dedup, locks, dead code
This commit is contained in:
commit
af118501b9
4 changed files with 8 additions and 13 deletions
|
|
@ -94,10 +94,9 @@ DEFAULT_CONTEXT_LENGTHS = {
|
||||||
"gpt-5": 128000,
|
"gpt-5": 128000,
|
||||||
"gpt-5-codex": 128000,
|
"gpt-5-codex": 128000,
|
||||||
"gpt-5-nano": 128000,
|
"gpt-5-nano": 128000,
|
||||||
"claude-opus-4-6": 200000,
|
# Bare model IDs without provider prefix (avoid duplicates with entries above)
|
||||||
"claude-opus-4-5": 200000,
|
"claude-opus-4-5": 200000,
|
||||||
"claude-opus-4-1": 200000,
|
"claude-opus-4-1": 200000,
|
||||||
"claude-sonnet-4-6": 200000,
|
|
||||||
"claude-sonnet-4-5": 200000,
|
"claude-sonnet-4-5": 200000,
|
||||||
"claude-sonnet-4": 200000,
|
"claude-sonnet-4": 200000,
|
||||||
"claude-haiku-4-5": 200000,
|
"claude-haiku-4-5": 200000,
|
||||||
|
|
@ -108,11 +107,7 @@ DEFAULT_CONTEXT_LENGTHS = {
|
||||||
"minimax-m2.5": 204800,
|
"minimax-m2.5": 204800,
|
||||||
"minimax-m2.5-free": 204800,
|
"minimax-m2.5-free": 204800,
|
||||||
"minimax-m2.1": 204800,
|
"minimax-m2.1": 204800,
|
||||||
"glm-5": 202752,
|
|
||||||
"glm-4.7": 202752,
|
|
||||||
"glm-4.6": 202752,
|
"glm-4.6": 202752,
|
||||||
"kimi-k2.5": 262144,
|
|
||||||
"kimi-k2-thinking": 262144,
|
|
||||||
"kimi-k2": 262144,
|
"kimi-k2": 262144,
|
||||||
"qwen3-coder": 32768,
|
"qwen3-coder": 32768,
|
||||||
"big-pickle": 128000,
|
"big-pickle": 128000,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import stat
|
import stat
|
||||||
import sys
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
|
||||||
|
|
@ -350,6 +350,7 @@ class SessionDB:
|
||||||
.replace("%", "\\%")
|
.replace("%", "\\%")
|
||||||
.replace("_", "\\_")
|
.replace("_", "\\_")
|
||||||
)
|
)
|
||||||
|
with self._lock:
|
||||||
cursor = self._conn.execute(
|
cursor = self._conn.execute(
|
||||||
"SELECT id FROM sessions WHERE id LIKE ? ESCAPE '\\' ORDER BY started_at DESC LIMIT 2",
|
"SELECT id FROM sessions WHERE id LIKE ? ESCAPE '\\' ORDER BY started_at DESC LIMIT 2",
|
||||||
(f"{escaped}%",),
|
(f"{escaped}%",),
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ def _discover_tools():
|
||||||
try:
|
try:
|
||||||
importlib.import_module(mod_name)
|
importlib.import_module(mod_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug("Could not import %s: %s", mod_name, e)
|
logger.warning("Could not import tool module %s: %s", mod_name, e)
|
||||||
|
|
||||||
|
|
||||||
_discover_tools()
|
_discover_tools()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue