loop: update git commit instruction to use --trailer, add Change-ID
We have run 'git config' for the user, so we can trim those instructions and simplify.
(And in unsafe mode, the user has 'git config' set up anyway.)
Instead of prompting the model to manually add 'Co-Authored-By' as a line in the
commit message, now instruct it to use the --trailer option.
This streamlines adding a Change-ID trailer with a random string (s<random_hex>k format).
I'd actually like to use precommmit hooks to automatically do all the trailer,
but that doesn't play nicely with -unsafe, so for now, do it this way.
At least we'll have Change-IDs that we can start using.
(Pity the official change-id support in git hasn't landed yet.)
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s9b68cbfa4c7eeb82k
diff --git a/loop/testdata/agent_loop.httprr b/loop/testdata/agent_loop.httprr
index 752b78a..f022747 100644
--- a/loop/testdata/agent_loop.httprr
+++ b/loop/testdata/agent_loop.httprr
@@ -1,9 +1,9 @@
httprr trace v1
-14353 2161
+14290 2143
POST https://api.anthropic.com/v1/messages HTTP/1.1
Host: api.anthropic.com
User-Agent: Go-http-client/1.1
-Content-Length: 14155
+Content-Length: 14092
Anthropic-Version: 2023-06-01
Content-Type: application/json
@@ -151,7 +151,7 @@
},
"git_commit": {
"$ref": "#/definitions/checklistItem",
- "description": "Create git commits for any code changes you made. Match the style of recent commit messages. Include 'Co-Authored-By: sketch \u003chello@sketch.dev\u003e' and the original user prompt. Use GIT_AUTHOR_NAME=\"Test Agent\" GIT_AUTHOR_EMAIL=\"totallyhuman@sketch.dev\" (not git config)."
+ "description": "Create git commits for any code changes you made, adding --trailer 'Co-Authored-By: sketch \u003chello@sketch.dev\u003e' and --trailer 'Change-ID: s$(openssl rand -hex 8)k'. The git user is already configured correctly."
}
},
"additionalProperties": {
@@ -447,25 +447,25 @@
}HTTP/2.0 200 OK
Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
Anthropic-Ratelimit-Input-Tokens-Limit: 200000
-Anthropic-Ratelimit-Input-Tokens-Remaining: 200000
-Anthropic-Ratelimit-Input-Tokens-Reset: 2025-05-08T01:39:51Z
+Anthropic-Ratelimit-Input-Tokens-Remaining: 199000
+Anthropic-Ratelimit-Input-Tokens-Reset: 2025-05-08T19:33:31Z
Anthropic-Ratelimit-Output-Tokens-Limit: 80000
Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
-Anthropic-Ratelimit-Output-Tokens-Reset: 2025-05-08T01:39:55Z
+Anthropic-Ratelimit-Output-Tokens-Reset: 2025-05-08T19:33:34Z
Anthropic-Ratelimit-Requests-Limit: 4000
Anthropic-Ratelimit-Requests-Remaining: 3999
-Anthropic-Ratelimit-Requests-Reset: 2025-05-08T01:39:51Z
+Anthropic-Ratelimit-Requests-Reset: 2025-05-08T19:33:30Z
Anthropic-Ratelimit-Tokens-Limit: 280000
-Anthropic-Ratelimit-Tokens-Remaining: 280000
-Anthropic-Ratelimit-Tokens-Reset: 2025-05-08T01:39:51Z
+Anthropic-Ratelimit-Tokens-Remaining: 279000
+Anthropic-Ratelimit-Tokens-Reset: 2025-05-08T19:33:31Z
Cf-Cache-Status: DYNAMIC
-Cf-Ray: 93c53ee3cb4dd009-SJC
+Cf-Ray: 93cb639e8ab4aaaf-SJC
Content-Type: application/json
-Date: Thu, 08 May 2025 01:39:55 GMT
-Request-Id: req_011CNuD9qppXzqGDHAS1LdBj
+Date: Thu, 08 May 2025 19:33:34 GMT
+Request-Id: req_011CNvd2SmLtiXBWXGsw6AKR
Server: cloudflare
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Via: 1.1 google
X-Robots-Tag: none
-{"id":"msg_014zVb75dymWbZ8AS2oTt532","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"Here are the tools available to me:\n\n1. bash - Execute shell commands\n2. keyword_search - Search for files and terms in a codebase\n3. think - Record thoughts, notes, or plans\n4. title - Set the conversation title\n5. precommit - Create a git branch for tracking work\n6. done - Mark completion of a task with a checklist\n7. codereview - Run an automated code review\n8. multiplechoice - Present multiple choice options to the user\n9. patch - Modify files with precise text edits\n10. Browser tools:\n - browser_navigate - Navigate to a URL\n - browser_click - Click an element\n - browser_type - Type text into a field\n - browser_wait_for - Wait for an element\n - browser_get_text - Get text from an element\n - browser_eval - Run JavaScript\n - browser_screenshot - Take a screenshot\n - browser_scroll_into_view - Scroll to an element"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":0,"cache_read_input_tokens":3343,"output_tokens":226}}
\ No newline at end of file
+{"id":"msg_012Z9qPA1jM4WNsAJi4cLo6J","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"Here are the tools available to me:\n\n1. bash - Execute shell commands\n2. keyword_search - Search for files with specific terms\n3. think - Record thoughts and plans (no external effects)\n4. title - Set conversation title\n5. precommit - Create a git branch for work\n6. done - Mark completion of user's goal\n7. codereview - Run automated code review\n8. multiplechoice - Present user with choices\n9. browser_navigate - Navigate to a URL\n10. browser_click - Click an element in browser\n11. browser_type - Type text into browser input\n12. browser_wait_for - Wait for element in browser\n13. browser_get_text - Get text from browser element\n14. browser_eval - Evaluate JavaScript in browser\n15. browser_screenshot - Take browser screenshot\n16. browser_scroll_into_view - Scroll to element\n17. patch - Make precise text edits to files"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3325,"cache_read_input_tokens":0,"output_tokens":213}}
\ No newline at end of file