v0.1.38 — Agent Loop Hardening + Compaction Overhaul
What changed
Driven by real small-model testing with Qwen 3.6-35B-A3B on local compute.
Interrupt handling
- Ctrl+C double-press — first press interrupts the running stream/tools/compaction, second press within 800ms exits cleanly. No more instant-kill.
Browser tool
js_evalaction —page.evaluate()for running arbitrary JavaScript against the live page. Read DOM state, call functions, inspect variables directly.- Screenshot loop prevention — read-only actions no longer reset the stagnant-state counter. Screenshot streak detector nudges after 3+ consecutive screenshots. Action-repeat tracker nudges after 3+ identical calls.
File tools
edit_fileworks after partial reads — no longer requires a fullread_filefirst. Partial reads accepted; old_string match against disk content is the safety check.
Compaction overhaul
Four changes that collectively double the usable context runway between compaction cycles:
- Tool outputs in kept rounds cleared during compaction (keeps 4 most recent, replaces older ones with placeholders)
- Microcompact keeps 4 most recent tool results (was 8)
- System prompt measurement uses the full assembled prompt instead of the short profile prompt
- Default
keep_recent_roundslowered from 6 to 2 for tool-heavy profiles
Vision
- Thinking-model fix — falls back to
reasoning_contentwhencontentis empty (fixes Qwen 3.x analysis). Defaultmax_tokensraised to 16384.
Testing infrastructure
- New
scripts/sandbox_runner.py+scripts/sandbox_scenarios.py— 4-tier E2E testing framework for small-model behavior observation.
Verification
ruff check src tests— all cleanpytest -q— 1362 passed