@cloudflare/shell@0.4.2

cloudflare/agents@cloudflare/shell@0.4.2Jul 22, 2026by github-actions[bot]

AI Summary

This patch fixes a critical bug in the shell's workspace removal and glob prefiltering where D1 databases rejected complex SQL pattern matching queries. The fix switches to primary-key range scans to bypass these limits and improve performance.

Key Highlights

  • Fixed Workspace.rm({ recursive: true }) to use primary-key range scans instead of complex LIKE queries.
  • Fixed glob prefiltering to avoid D1 errors related to pattern complexity.
  • Eliminated the need for escaping special characters in path names.

Full Release Notes

### Patch Changes

-   [#1716](https://github.com/cloudflare/agents/pull/1716) [`8ecdb61`](https://github.com/cloudflare/agents/commit/8ecdb618ada65fa393367374ea8b852d52bc92b5) Thanks [@mattzcarey](https://github.com/mattzcarey)! - fix(shell): replace LIKE pattern matching with primary-key range scans in `Workspace.rm({ recursive: true })` and the `glob` prefilter. D1 can reject the previous `LIKE ? ESCAPE ?` queries with `D1_ERROR: LIKE or GLOB pattern too complex: SQLITE_ERROR`; the range predicate (`path >= '{dir}/' AND path < '{dir}0'`) avoids that limit, scans the `path` index directly, and needs no escaping of `%`/`_` in path names.