Skip to content

v3.5.91

Latest

Choose a tag to compare

@chauncygu chauncygu released this 04 Dec 14:56
· 3 commits to main since this release
a462580
  • December 3, 2026 (v3.5.91): A file sandbox that covers every tool, cost budgets that see every model, and Keenable web search. Issue #198 reported by @tunguyen1993; PR #203 by @Mattbusel; PR #205 by @KGKallasmaa. 91 new tests.
    • (1) File sandbox on every path-taking tool (#198). 56 new tests in tests/test_tool_path_sandbox.py.
      • Problem. _check_path_allowed confines file access to config["allowed_root"] (or a worktree's directory) and refuses the credential denylist (~/.ssh/id_*, ~/.aws, ~/.gnupg, ~/.kube, ~/.docker, ~/.netrc, ~/.pgpass, /etc/shadow, /etc/sudoers, /root, …). Only Read, Write, Edit, MultiEdit and ApplyPatch called it. ReadPDF, ReadImage, ReadSpreadsheet, SummarizeLargeFile, NotebookEdit, GetDiagnostics, Grep and Glob opened Path(file_path) directly. Most of these are read_only, so in auto mode they ran without a prompt: with allowed_root set to the project, ReadSpreadsheet on a CSV outside it returned the rows, and Grep pattern=. path=~/.aws output_mode=content printed the credentials. NotebookEdit under accept-all could write outside the root.
      • Fix: one check before dispatch. tools/__init__.py now keeps _PATH_PARAMS, the path parameters of every built-in path-taking tool (file_path, notebook_path, Grep/Glob's path). execute_tool() vets them all with _check_path_allowed before the read cache and before any permission prompt — it used to do this for Read alone — so a denied Write/Edit/NotebookEdit is refused without asking. The refusal is the existing message: Error: path '…' is outside the allowed root '…' or Error: path '…' is on the credential denylist ….
      • Fix: and again inside each tool. _read_pdf, _read_image, _read_excel and _read_file_for_summary check on entry, before the optional-dependency check, and the NotebookEdit, GetDiagnostics, Grep and Glob registrations check in their wrappers. Callers that go through the tool registry directly get the same answer.
      • Glob and Grep. A path check on the search root is not enough for tools that walk a tree. Glob now drops each match outside the root or on the denylist, so pattern="../outside/*" or a symlink out of the workspace lists nothing. Grep passes --glob '!<name>' (ripgrep) or --exclude-dir/--exclude (grep) for the dot-named credential stores (new security._secret_search_excludes()), so searching ~ no longer reads ~/.aws or ~/.ssh. Only dot-names are excluded: the basename of /root would otherwise hide a project's own root/ directory. CHEETAHCLAWS_FS_NO_SANDBOX=1 lifts these excludes along with the denylist.
      • Already fixed. The report's second half, _is_safe_bash auto-approving git -c core.fsmonitor=…, git --exec-path=… and rg --pre/--pre-glob, was closed by the v3.5.90 Bash hardening (_GLOBAL_BANNED_FLAGS, the rg flag guard, long-option prefix matching); all four now prompt.
      • Plugin tools are not in _PATH_PARAMS; a plugin that opens a path should call _check_path_allowed(path, config) itself. Docs: security guide, architecture.
    • (2) Cost: every offered model has a price (PR #203). 27 tests in tests/test_list_prices.py (13 from the PR, extended).
      • Problem. calc_cost() fell back to (0.0, 0.0) for any model not typed into COSTS, and most first-party models in PROVIDERS were not: gpt-5, gpt-5-mini, gpt-5-nano, gpt-4.1, gpt-4.1-mini, gpt-4-turbo, o1, o3, o4-mini, claude-opus-4-5, claude-sonnet-4-5. Sessions on them recorded $0.00, so session_cost_budget / daily_cost_budget never tripped, and quota.output_room() applied no cost cap. Typed rows had drifted too: claude-opus-4-6 was $15/$75 (list price $5/$25) and claude-haiku-4-5-20251001 $0.80/$4 ($1/$5).
      • Fix: one rate lookup. New providers.model_rates() is used by both calc_cost() and quota.output_room(), so the recorded cost and the budget check always agree. output_room() used to look up COSTS by bare_model() only, so a gateway route like openrouter/openai/gpt-5 got no cost cap; it now resolves the same way as calc_cost().
      • Fix: lookup order COSTS → llm-prices → $0. COSTS now has a list-price row for every Anthropic, OpenAI and Gemini model in PROVIDERS (a test keeps it that way), with Opus 4.6 and Haiku 4.5 corrected. A first-party model missing from the table (a release newer than this version) is priced from llm-prices, a zero-dependency table of dated, source-cited list prices with the vendors' cache-read / cache-write rates. A COSTS row always wins, so a package upgrade never changes a price fixed in the table. Other providers (NIM free tier, DeepSeek, Qwen, Moonshot, GLM, MiniMax, local models) are never priced from the package.
      • Optional dependency. The PR added llm-prices as a core dependency; it is now the pricing extra (pip install cheetahclaws[pricing], also in all), pinned >=1.8.0,<2. Without it, or if a future release fails, cost math falls back to COSTS / $0 and never interrupts a turn.
      • Behaviour change. Users with a cost budget on one of the previously unpriced models will now see it enforced. Docs: reference (/cost), architecture (Quota).
    • (3) Keenable web search for /research (PR #205). 8 tests in tests/test_research.py (4 from the PR, 4 added).
      • What. A 22nd /research source in the web domain, beside Tavily and Brave. It is tier="optional" and off by default: set KEENABLE_API_KEY (or keenable_api_key) for the keyed endpoint, or KEENABLE_KEYLESS=1 (or keenable_keyless: true) for the keyless public endpoint, which needs no account and is rate-limited per IP. Keyless calls identify themselves as CheetahClaws through the X-Keenable-Title header the endpoint requires. It reuses the shared post_json helper (retries, 429 backoff), so no new dependency.
      • Follow-up fixes. A bounded --range / --since / --until is now sent as published_after / published_before (YYYY-MM-DD, inclusive), and each result's published_at is mapped onto Result.published, so recency ranking and date filters apply to Keenable like Tavily. /research sources shows [needs KEENABLE_API_KEY or KEENABLE_KEYLESS=1] rather than telling keyless users they need a key.
      • Data. Keenable logs and stores queries with or without a key, and its terms allow using them to improve and train its products; only an Enterprise zero-data-retention plan differs. The research guide row says so; leave it off for sensitive topics.