From f157f455cf54e0912ce024cb6f7e19044b38f3a5 Mon Sep 17 00:00:00 2001 From: Philip Zeyliger Date: Mon, 5 Jan 2026 05:50:01 +0000 Subject: [PATCH] test: use --no-verify in git commit tests to skip hooks Prompt: Fix the test certainly. The TestGitStateChangeCreatesGitInfoMessage test was failing because a global commit-msg hook at ~/.config/git/hooks/commit-msg requires agent-driven commits to include a 'Prompt:' section. Fix by adding --no-verify to git commit commands in two places: 1. The runCmd helper function for setup commits 2. The predictable service message that triggers the agent commit --- test/server_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/server_test.go b/test/server_test.go index dfc908a446d459ac2e6f19deb70f0b0bc2817099..f2eb2cb9db795ab90648dc2a329a4a60d7bbc251 100644 --- a/test/server_test.go +++ b/test/server_test.go @@ -1021,6 +1021,12 @@ func TestGitStateChangeCreatesGitInfoMessage(t *testing.T) { // Initialize git repo runCmd := func(name string, args ...string) { + // For git commits, use --no-verify to skip hooks + if name == "git" && len(args) > 0 && args[0] == "commit" { + newArgs := []string{"commit", "--no-verify"} + newArgs = append(newArgs, args[1:]...) + args = newArgs + } cmd := exec.Command(name, args...) cmd.Dir = workDir out, err := cmd.CombinedOutput() @@ -1074,8 +1080,9 @@ func TestGitStateChangeCreatesGitInfoMessage(t *testing.T) { // The test command creates a file and commits it. We use explicit paths to avoid bash safety checks. // NOTE: We must set cwd when creating the conversation so the tools run in our git repo. + // Use --no-verify to skip commit hooks that may interfere with tests. chatReq := map[string]interface{}{ - "message": "bash: echo 'new content' > newfile.txt && git add newfile.txt && git commit -m 'Add new file'", + "message": "bash: echo 'new content' > newfile.txt && git add newfile.txt && git commit --no-verify -m 'Add new file'", "model": "predictable", "cwd": workDir, }