fix: address potential indentation on commit messages trailings (#3106)

Andrey Nering created

Some models like Qwen take this intentation too literally and add them
to the commit message. The new system prompt fixes that.

Change summary

internal/agent/testdata/TestCoderAgent/glm-5.1/bash_tool.yaml           | 2 
internal/agent/testdata/TestCoderAgent/glm-5.1/download_tool.yaml       | 2 
internal/agent/testdata/TestCoderAgent/glm-5.1/fetch_tool.yaml          | 6 
internal/agent/testdata/TestCoderAgent/glm-5.1/glob_tool.yaml           | 2 
internal/agent/testdata/TestCoderAgent/glm-5.1/grep_tool.yaml           | 2 
internal/agent/testdata/TestCoderAgent/glm-5.1/ls_tool.yaml             | 2 
internal/agent/testdata/TestCoderAgent/glm-5.1/multiedit_tool.yaml      | 2 
internal/agent/testdata/TestCoderAgent/glm-5.1/parallel_tool_calls.yaml | 6 
internal/agent/testdata/TestCoderAgent/glm-5.1/read_a_file.yaml         | 3 
internal/agent/testdata/TestCoderAgent/glm-5.1/simple_test.yaml         | 3 
internal/agent/testdata/TestCoderAgent/glm-5.1/sourcegraph_tool.yaml    | 3 
internal/agent/testdata/TestCoderAgent/glm-5.1/update_a_file.yaml       | 3 
internal/agent/testdata/TestCoderAgent/glm-5.1/write_tool.yaml          | 3 
internal/agent/tools/bash.md.tpl                                        | 6 
14 files changed, 26 insertions(+), 19 deletions(-)

Detailed changes

internal/agent/testdata/TestCoderAgent/glm-5.1/read_a_file.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 774
+    content_length: 33902
     host: ""
-    body: '{"messages":[{"content":"You will generate a short title based on the first message a user begins a conversation with.\n\n<rules>\n- Keep the title in the same language that the user wrote their message in.\n- Ensure it is not more than 50 characters long.\n- The title should be a summary of the user''s message.\n- It should be one line long.\n- Do not use quotes or colons.\n- The entire text you return will be used as the title.\n- Never return anything that is more than one sentence (one line) long.\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nRead the go mod\n <think>\n\n</think>","role":"user"}],"model":"gpt-oss-120b","max_completion_tokens":40,"stream_options":{"include_usage":true},"stream":true}'

internal/agent/testdata/TestCoderAgent/glm-5.1/simple_test.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 764
+    content_length: 33892
     host: ""
-    body: '{"messages":[{"content":"You will generate a short title based on the first message a user begins a conversation with.\n\n<rules>\n- Keep the title in the same language that the user wrote their message in.\n- Ensure it is not more than 50 characters long.\n- The title should be a summary of the user''s message.\n- It should be one line long.\n- Do not use quotes or colons.\n- The entire text you return will be used as the title.\n- Never return anything that is more than one sentence (one line) long.\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nHello\n <think>\n\n</think>","role":"user"}],"model":"gpt-oss-120b","max_completion_tokens":40,"stream_options":{"include_usage":true},"stream":true}'

internal/agent/testdata/TestCoderAgent/glm-5.1/sourcegraph_tool.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 819
+    content_length: 33952
     host: ""
-    body: '{"messages":[{"content":"You will generate a short title based on the first message a user begins a conversation with.\n\n<rules>\n- Keep the title in the same language that the user wrote their message in.\n- Ensure it is not more than 50 characters long.\n- The title should be a summary of the user''s message.\n- It should be one line long.\n- Do not use quotes or colons.\n- The entire text you return will be used as the title.\n- Never return anything that is more than one sentence (one line) long.\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse sourcegraph to search for ''func main'' in Go repositories\n <think>\n\n</think>","role":"user"}],"model":"gpt-oss-120b","max_completion_tokens":40,"stream_options":{"include_usage":true},"stream":true}'

internal/agent/testdata/TestCoderAgent/glm-5.1/update_a_file.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 828
+    content_length: 33958
     host: ""
-    body: '{"messages":[{"content":"You will generate a short title based on the first message a user begins a conversation with.\n\n<rules>\n- Keep the title in the same language that the user wrote their message in.\n- Ensure it is not more than 50 characters long.\n- The title should be a summary of the user''s message.\n- It should be one line long.\n- Do not use quotes or colons.\n- The entire text you return will be used as the title.\n- Never return anything that is more than one sentence (one line) long.\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nupdate the main.go file by changing the print to say hello from crush\n <think>\n\n</think>","role":"user"}],"model":"gpt-oss-120b","max_completion_tokens":40,"stream_options":{"include_usage":true},"stream":true}'

internal/agent/testdata/TestCoderAgent/glm-5.1/write_tool.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 868
+    content_length: 33995
     host: ""
-    body: '{"messages":[{"content":"You will generate a short title based on the first message a user begins a conversation with.\n\n<rules>\n- Keep the title in the same language that the user wrote their message in.\n- Ensure it is not more than 50 characters long.\n- The title should be a summary of the user''s message.\n- It should be one line long.\n- Do not use quotes or colons.\n- The entire text you return will be used as the title.\n- Never return anything that is more than one sentence (one line) long.\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse write to create a new file called config.json with content ''{\"name\": \"test\", \"version\": \"1.0.0\"}''\n <think>\n\n</think>","role":"user"}],"model":"gpt-oss-120b","max_completion_tokens":40,"stream_options":{"include_usage":true},"stream":true}'

internal/agent/tools/bash.md.tpl 🔗

@@ -68,14 +68,14 @@ When user asks to create git commit:
    Commit message here.
 
 {{ if .Attribution.GeneratedWith }}
-   💘 Generated with Crush
+💘 Generated with Crush
 {{ end}}
 {{if eq .Attribution.TrailerStyle "assisted-by" }}
 
-   Assisted-by: Crush:{{ .ModelID }}
+Assisted-by: Crush:{{ .ModelID }}
 {{ else if eq .Attribution.TrailerStyle "co-authored-by" }}
 
-   Co-Authored-By: Crush <crush@charm.land>
+Co-Authored-By: Crush <crush@charm.land>
 {{ end }}
 
    EOF