[Bug]: Glob masks malformed helper output as no matching files
Reproduction
On main c0a5762, configure a backend whose successful helper invocation returns ExecResult(0, b"not-json", b""), with is_dir() returning true, then call Glob(backend=backend)(pattern="*.py", path="/workspace").
Actual behavior
The tool returns a normal final result saying No files found matching pattern: *.py. Invalid JSON is caught and replaced with an empty list. Valid JSON of the wrong shape is also unchecked: null raises TypeError and a string is treated as a sequence of matching paths.
Expected behavior
Report an error for invalid helper output, reserving the no-matches result for a valid empty array. Validate that the decoded output is an array of strings before pagination.
I can submit a focused fix with offline regression tests. Reproduction was assisted by Codex.
Source: agentscope-ai/agentscope