diff --git a/pyproject.toml b/pyproject.toml index 37224b6..d6ad611 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "trobz-agent" -version = "1.0.1" +version = "1.0.2" description = "Run an AI agent" authors = [{name = "Hai Lang", email = "hailn@trobz.com"}] requires-python = ">=3.10" diff --git a/tests/test_agent.py b/tests/test_agent.py new file mode 100644 index 0000000..94fad2e --- /dev/null +++ b/tests/test_agent.py @@ -0,0 +1,6 @@ +import unittest + + +class TestMethods(unittest.TestCase): + def test_dummy(self): + self.assertEqual(1, 1) diff --git a/trobz_agent/agent.py b/trobz_agent/agent.py index c089031..51b8797 100644 --- a/trobz_agent/agent.py +++ b/trobz_agent/agent.py @@ -73,11 +73,20 @@ def commit_if_change(cwd, step): changes = run_read(cwd, "git", "status", "--short") if not changes.strip(): return + changed = False + for line in changes.split("\n"): + line = line[3:].strip() + if not line or line.startswith(".."): + continue + changed = True + break + if not changed: + return run(cwd, "git", "add", ".") message = step["commit_if_change"] if message == True: # noqa: E712 message = step["name"] - run(cwd, "git", "commit", "-m", message) + run(cwd, "git", "commit", "--no-verify", "-m", message) def run_workflow(workflow_dir, workflow, backend, mode, model): # noqa: C901 diff --git a/uv.lock b/uv.lock index 6336fb1..8329d2f 100644 --- a/uv.lock +++ b/uv.lock @@ -343,7 +343,7 @@ wheels = [ [[package]] name = "trobz-agent" -version = "1.0.1" +version = "1.0.2" source = { editable = "." } dependencies = [ { name = "typer" },