From e049e4e104daba1d946733a4be687668ffd4606e Mon Sep 17 00:00:00 2001 From: goulustis Date: Sat, 7 Mar 2026 14:52:19 +0800 Subject: [PATCH] sanity check for shell shell configs --- lang_agent/fs_bkends/localshell.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lang_agent/fs_bkends/localshell.py b/lang_agent/fs_bkends/localshell.py index ba634e8..3af8e0f 100644 --- a/lang_agent/fs_bkends/localshell.py +++ b/lang_agent/fs_bkends/localshell.py @@ -38,4 +38,24 @@ class LocalShell(BaseFilesystemBackend): self.backend = LocalShellBackend(root_dir=self.config.workspace_dir, virtual_mode=True, # env={"PATH": "/usr/bin:/bin"} - inherit_env=True) \ No newline at end of file + inherit_env=True) + + + +if __name__ == "__main__": + import sys + + # Instantiate a LocalShell instance with the default config + config = LocalShellConfig() + shell = LocalShell(config) + + # Try checking access to 'npx' + try: + result = shell.backend.execute("npx --version") + if result.exit_code == 0: + print("npx is available, version:", result.output.strip()) + else: + print("npx returned non-zero exit code:", result.exit_code, file=sys.stderr) + print("output:", result.output, file=sys.stderr) + except Exception as e: + print("Could not access 'npx':", str(e), file=sys.stderr) \ No newline at end of file