Skip to content

Commit e67e3b6

Browse files
committed
loop: nudge to install platform tools
1 parent 9c74cb9 commit e67e3b6

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

loop/agent.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,20 +2401,22 @@ type systemPromptData struct {
24012401
InitialCommit string
24022402
Codebase *onstart.Codebase
24032403
UseSketchWIP bool
2404+
InstallationNudge bool
24042405
Branch string
24052406
SpecialInstruction string
24062407
}
24072408

24082409
// renderSystemPrompt renders the system prompt template.
24092410
func (a *Agent) renderSystemPrompt() string {
24102411
data := systemPromptData{
2411-
ClientGOOS: a.config.ClientGOOS,
2412-
ClientGOARCH: a.config.ClientGOARCH,
2413-
WorkingDir: a.workingDir,
2414-
RepoRoot: a.repoRoot,
2415-
InitialCommit: a.SketchGitBase(),
2416-
Codebase: a.codebase,
2417-
UseSketchWIP: a.config.InDocker,
2412+
ClientGOOS: a.config.ClientGOOS,
2413+
ClientGOARCH: a.config.ClientGOARCH,
2414+
WorkingDir: a.workingDir,
2415+
RepoRoot: a.repoRoot,
2416+
InitialCommit: a.SketchGitBase(),
2417+
Codebase: a.codebase,
2418+
UseSketchWIP: a.config.InDocker,
2419+
InstallationNudge: a.config.InDocker,
24182420
}
24192421
now := time.Now()
24202422
if now.Month() == time.September && now.Day() == 19 {

loop/agent_system_prompt.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ for, including creating a git commit. Do not forget to run tests.
4343
Commit work to the 'sketch-wip' branch. Changes on other branches will not be pushed to the user.
4444
{{ end }}
4545

46+
{{ if .InstallationNudge }}
47+
For programming platform versions, install the required versions rather than giving up.
48+
Suggest to the user that they update dear_llm.md or set up a custom container image
49+
with the platform versions they require.
50+
{{ end }}
51+
4652
When communicating with the user, take it easy on the emoji, don't be over-enthusiastic, and be concise.
4753

4854
Docker is available. Before running the docker command, start dockerd as a background process.

loop/testdata/agent_loop.httprr

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
httprr trace v1
2-
18101 2303
2+
18105 2423
33
POST https://api.anthropic.com/v1/messages HTTP/1.1
44
Host: api.anthropic.com
55
User-Agent: Go-http-client/1.1
6-
Content-Length: 17903
6+
Content-Length: 17907
77
Anthropic-Version: 2023-06-01
88
Content-Type: application/json
99

@@ -546,7 +546,7 @@ Content-Type: application/json
546546
],
547547
"system": [
548548
{
549-
"text": "You are the expert software engineer and architect powering Sketch,\nan agentic coding environment that helps users accomplish coding tasks through autonomous analysis and implementation.\n\n\u003cworkflow\u003e\nStart by asking concise clarifying questions as needed.\nOnce the intent is clear, work autonomously.\nWhenever possible, do end-to-end testing, to ensure fully working functionality.\nAim for a small diff size while thoroughly completing the requested task.\nPrioritize thoughtful analysis and critical engagement over agreeability.\n\nBreak down the overall goal into a series of smaller steps.\nUse the todo_read and todo_write tools to organize and track your work systematically.\n\nFollow this broad workflow:\n\n- Think about how the current step fits into the overall plan.\n- Do research. Good tool choices: bash, think, keyword_search\n- Make edits.\n- If you have completed a standalone chunk of work, make a git commit.\n- Update your todo task list.\n- Repeat.\n\nTo make edits reliably and efficiently, first think about the intent of the edit,\nand what set of patches will achieve that intent.\nThen use the patch tool to make those edits. Combine all edits to any given file into a single patch tool call.\n\nYou may run tool calls in parallel.\n\nComplete every task exhaustively - no matter how repetitive or tedious.\nPartial work, pattern demonstrations, or stubs with TODOs are not acceptable, unless explicitly permitted by the user.\n\nThe done tool provides a checklist of items you MUST verify and\nreview before declaring that you are done. Before executing\nthe done tool, run all the tools the done tool checklist asks\nfor, including creating a git commit. Do not forget to run tests.\n\n\n\nWhen communicating with the user, take it easy on the emoji, don't be over-enthusiastic, and be concise.\n\nDocker is available. Before running the docker command, start dockerd as a background process.\nAlways use --network=host when running docker containers.\n\u003c/workflow\u003e\n\n\u003cstyle\u003e\nDefault coding guidelines:\n- Clear is better than clever.\n- Minimal inline comments: non-obvious logic and key decisions only.\n- When no commit message style guidance is provided: write a single lowercase line starting with an imperative verb, ≤50 chars, no period\n\u003c/style\u003e\n\n\u003csystem_info\u003e\n\u003cplatform\u003e\nlinux/amd64\n\u003c/platform\u003e\n\u003cpwd\u003e\n/\n\u003c/pwd\u003e\n\u003c/system_info\u003e\n\n\u003cgit_info\u003e\n\u003cgit_root\u003e\n\n\u003c/git_root\u003e\n\u003cHEAD\u003e\nHEAD\n\u003c/HEAD\u003e\n\n\u003c/git_info\u003e\n\n",
549+
"text": "You are the expert software engineer and architect powering Sketch,\nan agentic coding environment that helps users accomplish coding tasks through autonomous analysis and implementation.\n\n\u003cworkflow\u003e\nStart by asking concise clarifying questions as needed.\nOnce the intent is clear, work autonomously.\nWhenever possible, do end-to-end testing, to ensure fully working functionality.\nAim for a small diff size while thoroughly completing the requested task.\nPrioritize thoughtful analysis and critical engagement over agreeability.\n\nBreak down the overall goal into a series of smaller steps.\nUse the todo_read and todo_write tools to organize and track your work systematically.\n\nFollow this broad workflow:\n\n- Think about how the current step fits into the overall plan.\n- Do research. Good tool choices: bash, think, keyword_search\n- Make edits.\n- If you have completed a standalone chunk of work, make a git commit.\n- Update your todo task list.\n- Repeat.\n\nTo make edits reliably and efficiently, first think about the intent of the edit,\nand what set of patches will achieve that intent.\nThen use the patch tool to make those edits. Combine all edits to any given file into a single patch tool call.\n\nYou may run tool calls in parallel.\n\nComplete every task exhaustively - no matter how repetitive or tedious.\nPartial work, pattern demonstrations, or stubs with TODOs are not acceptable, unless explicitly permitted by the user.\n\nThe done tool provides a checklist of items you MUST verify and\nreview before declaring that you are done. Before executing\nthe done tool, run all the tools the done tool checklist asks\nfor, including creating a git commit. Do not forget to run tests.\n\n\n\n\n\nWhen communicating with the user, take it easy on the emoji, don't be over-enthusiastic, and be concise.\n\nDocker is available. Before running the docker command, start dockerd as a background process.\nAlways use --network=host when running docker containers.\n\u003c/workflow\u003e\n\n\u003cstyle\u003e\nDefault coding guidelines:\n- Clear is better than clever.\n- Minimal inline comments: non-obvious logic and key decisions only.\n- When no commit message style guidance is provided: write a single lowercase line starting with an imperative verb, ≤50 chars, no period\n\u003c/style\u003e\n\n\u003csystem_info\u003e\n\u003cplatform\u003e\nlinux/amd64\n\u003c/platform\u003e\n\u003cpwd\u003e\n/\n\u003c/pwd\u003e\n\u003c/system_info\u003e\n\n\u003cgit_info\u003e\n\u003cgit_root\u003e\n\n\u003c/git_root\u003e\n\u003cHEAD\u003e\nHEAD\n\u003c/HEAD\u003e\n\n\u003c/git_info\u003e\n\n",
550550
"type": "text",
551551
"cache_control": {
552552
"type": "ephemeral"
@@ -557,24 +557,24 @@ Content-Type: application/json
557557
Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
558558
Anthropic-Ratelimit-Input-Tokens-Limit: 2000000
559559
Anthropic-Ratelimit-Input-Tokens-Remaining: 2000000
560-
Anthropic-Ratelimit-Input-Tokens-Reset: 2025-07-24T22:15:37Z
560+
Anthropic-Ratelimit-Input-Tokens-Reset: 2025-07-24T23:55:06Z
561561
Anthropic-Ratelimit-Output-Tokens-Limit: 400000
562562
Anthropic-Ratelimit-Output-Tokens-Remaining: 400000
563-
Anthropic-Ratelimit-Output-Tokens-Reset: 2025-07-24T22:15:42Z
563+
Anthropic-Ratelimit-Output-Tokens-Reset: 2025-07-24T23:55:10Z
564564
Anthropic-Ratelimit-Requests-Limit: 4000
565565
Anthropic-Ratelimit-Requests-Remaining: 3999
566-
Anthropic-Ratelimit-Requests-Reset: 2025-07-24T22:15:36Z
566+
Anthropic-Ratelimit-Requests-Reset: 2025-07-24T23:55:05Z
567567
Anthropic-Ratelimit-Tokens-Limit: 2400000
568568
Anthropic-Ratelimit-Tokens-Remaining: 2400000
569-
Anthropic-Ratelimit-Tokens-Reset: 2025-07-24T22:15:37Z
569+
Anthropic-Ratelimit-Tokens-Reset: 2025-07-24T23:55:06Z
570570
Cf-Cache-Status: DYNAMIC
571-
Cf-Ray: 9646c6f5691fce74-SJC
571+
Cf-Ray: 964758ac38ba7acd-SJC
572572
Content-Type: application/json
573-
Date: Thu, 24 Jul 2025 22:15:42 GMT
574-
Request-Id: req_011CRScfwLXsX2Ug7WSdEZnN
573+
Date: Thu, 24 Jul 2025 23:55:10 GMT
574+
Request-Id: req_011CRSkFtyQxXFGwZsBb7RY3
575575
Server: cloudflare
576576
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
577577
Via: 1.1 google
578578
X-Robots-Tag: none
579579

580-
{"id":"msg_01So9qajkJgERbHBwNUwEkmF","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"Here are the tools available to me:\n\n**File & Code Management:**\n- `bash` - Execute shell commands\n- `keyword_search` - Search for files/content in codebases\n- `patch` - Modify files with precise text edits\n\n**Task Management:**\n- `think` - Record thoughts and plans\n- `todo_read` / `todo_write` - Manage task lists\n- `done` - Mark completion with checklist verification\n\n**Development Workflow:**\n- `codereview` - Run automated code review\n- `about_sketch` - Get help with Sketch functionality\n\n**Browser Automation:**\n- `browser_navigate` - Navigate to URLs\n- `browser_click` / `browser_type` - Interact with elements\n- `browser_wait_for` / `browser_get_text` - Wait for and read content\n- `browser_eval` - Execute JavaScript\n- `browser_scroll_into_view` / `browser_resize` - Control viewport\n- `browser_take_screenshot` / `read_image` - Capture and read images\n- `browser_recent_console_logs` / `browser_clear_console_logs` - Access console output"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":4142,"cache_read_input_tokens":0,"output_tokens":269,"service_tier":"standard"}}
580+
{"id":"msg_01KEJ5q4EwEz9kvMsouiGC9P","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"Here are the tools available to me:\n\n**File & Code Management:**\n- `bash` - Execute shell commands\n- `keyword_search` - Search files by keywords/concepts\n- `patch` - Modify files with precise text edits\n\n**Task Management:**\n- `think` - Internal note-taking and planning\n- `todo_read` / `todo_write` - Track and manage task lists\n- `done` - Mark completion with checklist verification\n- `codereview` - Run automated code review\n\n**Browser Automation:**\n- `browser_navigate` - Navigate to URLs\n- `browser_click` - Click elements\n- `browser_type` - Type into input fields\n- `browser_wait_for` - Wait for elements\n- `browser_get_text` - Read element text\n- `browser_eval` - Execute JavaScript\n- `browser_scroll_into_view` - Scroll to elements\n- `browser_resize` - Resize browser window\n- `browser_recent_console_logs` - Get console logs\n- `browser_clear_console_logs` - Clear console logs\n- `browser_take_screenshot` - Capture screenshots\n\n**Media:**\n- `read_image` - Read and encode image files\n\n**Help:**\n- `about_sketch` - Get information about Sketch environment"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":4142,"cache_read_input_tokens":0,"output_tokens":296,"service_tier":"standard"}}

0 commit comments

Comments
 (0)