Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

1.6 KB
Raw Blame

Fixed a gap in the notes-API audit-log preview helper (_log_value_preview, #5497): a dict-shaped rejected value still cost O(N log N) time and touched every element, because reprlib's repr_dict runs an internal sorted() over the whole container before truncating it. A wide, flat attacker-sized dict now previews in well under a millisecond instead of ~10-25 ms, and a truncated preview now states what was truncated: an ending of , ...} / , ...] / , ...) means entries were omitted from some container (the payload was oversized at the item level — flat or nested anywhere in the value), while a bare ... ending means the value merely exceeded the 100-char preview length with every container the preview walk visits — those below the depth cap — at or under the entry limit. The two endings differ in their final character and so can never be byte-equal; previews that fit are emitted unchanged. Scope, so this is not read as broader than it is: the guarantee covers containers up to the preview depth cap (maxlevel 4) — a container nested at or past the cap collapses to {...} regardless of its item count — and the fix bounds container breadth only; a deeply nested value (e.g. a 10-way fanout five levels down, ~1 MB of JSON) is bounded by reprlib's own maxlevel at a few milliseconds both before and after this change, and is deliberately left unchanged here because bounding it further is a design change rather than a fix. set/frozenset values are bounded by the same code, but no JSON body can deliver one (JSON has no set literal), so the reachable win is the dict case.