SIGN IN SIGN UP

fix(deepagents): return recoverable errors for invalid/denied filesystem tool paths instead of throwing (#693)

### Summary

Invalid (non-absolute, `..`, or `~`) or denied filesystem paths passed
by an agent cause the tool to throw which raises a `MiddlewareError` and
causes the whole agent run to crash.

This PR replaces `enforcePermission` which was re-validating the path
without a try/catch with `checkPermission` which returns the error to
the model as a normal tool result so the model can correct the path and
try again instead of crashing.

### Tests

Updated the three permission suites to assert an error result instead of
a throw and added a regression block for `~`/relative/`..` paths that
returns a recoverable error and never calls the backend.
C
Colin Francis committed
2ebb1785e4625ecf82635582e17fe41fbfbac603
Parent: f127e3d
Committed by GitHub <noreply@github.com> on 7/17/2026, 9:58:14 PM