Skip to content

[Bug] tree-sitter and tree-sitter-bash version constraints too loose, causing crash on bash tool invocation #33

@Prodesire

Description

@Prodesire

Bug Description

The version constraints for tree-sitter and tree-sitter-bash in pyproject.toml are too loose (>=0.23 for both). When installed via pip without the uv lockfile, pip's dependency resolver can pick incompatible versions (e.g., tree-sitter==0.24.0 + tree-sitter-bash==0.25.1), causing a crash whenever the bash tool's permission check is triggered.

Steps to Reproduce

  1. Install iac-code via pip install iac-code (without using the uv lockfile)
  2. Verify installed versions: pip show tree-sitter tree-sitter-bash — may show tree-sitter 0.24.0 and tree-sitter-bash 0.25.1
  3. Run iac-code -p "run echo hello" --max-turns 3

Expected Behavior

The bash tool executes the command and returns the result.

Actual Behavior

The CLI crashes with a full traceback:

  File ".../iac_code/tools/bash/command_parser.py", line 16, in <module>
    _parser = Parser(_BASH_LANGUAGE)
              ^^^^^^^^^^^^^^^^^^^^^^
ValueError: Incompatible Language version 15. Must be between 13 and 14

Root Cause

In pyproject.toml:

"tree-sitter>=0.23",
"tree-sitter-bash>=0.23",

tree-sitter 0.24.x supports language versions 13-14, but tree-sitter-bash 0.25.x provides language version 15. These two packages must be at compatible versions (both 0.24.x or both 0.25.x).

The uv lockfile correctly resolves to tree-sitter==0.25.2 + tree-sitter-bash==0.25.1, but users installing via plain pip are not protected.

Suggested Fix

Tighten the version constraints to ensure compatibility:

"tree-sitter>=0.25,<0.26",
"tree-sitter-bash>=0.25,<0.26",

Operating System

macOS

Python Version

3.12.7

iac-code Version

0.2.3

LLM Provider

Alibaba Cloud (DashScope / Qwen)

IaC Type

Not applicable

Additional Context

The dev environment (using uv sync with the lockfile) works correctly since uv.lock pins tree-sitter==0.25.2 and tree-sitter-bash==0.25.1. This only affects users who install via pip install iac-code directly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions