v0.7.0 β Security hardening & agent-loop upgrades
β οΈ Security release β please upgrade
This release fixes several security issues found in an internal audit. If you run PythonClaw with ClawHub skills or the web dashboard, upgrade as soon as possible:
pip install -U pythonclawSecurity fixes
- Zip-slip arbitrary file write in ClawHub skill installs β a crafted skill ZIP could write files outside the skill directory (escalating to code execution). Extraction now rejects absolute paths and
..traversal in both sync and async installers. - TLS verification was disabled on async hub downloads β combined with the above, a network attacker could deliver a malicious archive. Certificate verification is now on.
- Web dashboard bound to
0.0.0.0with no auth β anyone who could reach port 7788 could drive the agent (includingrun_command). It now binds to127.0.0.1by default and warns loudly if you opt into a public bind. - Path traversal guards for
memory_get(sibling-prefix bypass) and skill resource lookups. - Cross-session file delivery race β with multiple channels active,
send_filecould deliver a file to the wrong chat. The send callback is now per-agent.
Agent-loop upgrades (context engineering)
- Tool-output truncation with spill-over files β oversized outputs keep head+tail in context and save the full text to a file;
read_filegainsoffset/limitfor paging,run_commandgains atimeoutargument. - Turn-integrity pruning β the current turn's user message can no longer slide out of the context window during a long tool loop.
- Loop breaker β identical tool calls repeated 3+ times in one turn are short-circuited.
- Non-blocking tool timeouts β a hung tool no longer freezes the whole session.
- Pair-safe compaction β compaction never splits a tool call from its result; old summaries roll off instead of accumulating; token estimation now counts tool-call arguments and flat-rates images (one photo no longer trips auto-compaction every turn).
multi_searchβ parallel web-search fan-out, with partial results on timeout.
Reliability fixes
- Gemini tool use was completely broken (referenced SDK symbols that don't exist) β rewritten on
google.generativeai.protos, with parallel tool results batched into one turn. - Streamed conversations were never persisted β Telegram/web sessions now survive restarts.
- Anthropic: honor
tool_choice="none", never emit or replay truncated tool JSON,claude setup-tokenOAuth support, copy-on-merge (no history aliasing). - OpenAI-compatible streaming: tool calls keep the model's intended order.
- Session store: atomic writes, multimodal messages no longer crash persistence,
###/---content lines survive round-trips, private_tsmetadata is stripped from API payloads. - Memory store: atomic writes, values containing
##headings no longer corrupt on reload. - Cron: Unix weekday numbers remapped for APScheduler β
0 9 * * 1-5now fires MonβFri (was TueβSat). - Config: string-safe JSON5 stripping (
,}inside values no longer mutated), malformed config no longer brickspythonclaw stop. - Telegram: timeouts no longer release the session lock mid-run, edited messages don't crash handlers, UTF-16 mention offsets, flood-control-aware delivery.
- WhatsApp: webhook acks immediately (agent work off Meta's retry path), thread-safe locks.
- Discord: channel allowlist enforced for mentions, startup failures surfaced.
- STT: one failing fallback language no longer aborts voice transcription.
Tests
+23 regression tests covering the fixes above (174 total, all passing).
Full Changelog: 7787bb4...v0.7.0