From 4a51a54554c602a17ff6c3fce36ce3e30726902b Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Thu, 28 May 2026 10:33:17 +0300 Subject: [PATCH] fix(helexa-acp): describe Stage 3 tools in the default system prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Stage 2 prompt told the model it had no tools, which models trained for caution then dutifully repeat back ("Stage 2 build: no tools available — I can't read files…"). Stage 3 ships tools in the CompletionRequest.tools array, but the system message was still overriding that. Update the default prompt to list the five tools and instruct the model to use them rather than asking the user to paste contents. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/helexa-acp/src/prompt.rs | 37 ++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/crates/helexa-acp/src/prompt.rs b/crates/helexa-acp/src/prompt.rs index 90520ce..2613366 100644 --- a/crates/helexa-acp/src/prompt.rs +++ b/crates/helexa-acp/src/prompt.rs @@ -1,25 +1,38 @@ //! System prompt assembly. //! -//! Stage 2 ships a small built-in prompt aimed at coding assistance: -//! it tells the model the working directory and reminds it that no -//! tools are available yet. Users who want something different point -//! `HELEXA_ACP_SYSTEM_PROMPT_PATH` (env) or `system_prompt_path` (TOML) -//! at a file and we read that verbatim. The literal token `{cwd}` in -//! a user-supplied file is substituted with the session's working -//! directory so editor templates can include it without templating. +//! The built-in prompt tells the model the working directory and +//! enumerates the tools it actually has — without this, models trained +//! to "be safe when you don't know your environment" tend to refuse +//! tool use and ask the user to paste content instead. Override with +//! `HELEXA_ACP_SYSTEM_PROMPT_PATH` (env) or `system_prompt_path` +//! (TOML); the literal token `{cwd}` in a user-supplied file is +//! substituted with the session's working directory. use anyhow::Context; use std::path::Path; const DEFAULT_PROMPT: &str = "\ -You are helexa-acp, a coding assistant. +You are helexa-acp, a coding assistant working inside an editor. Working directory: {cwd} -Stage 2 build: you have no tools available — answer with text only. -When you need to refer to files or directories, describe paths -relative to the working directory above. Be concise; the user is -reading your output in an editor pane."; +You have the following tools. Call them whenever the user's request +involves looking at or modifying files, or running commands — do not +ask the user to paste file contents you could read yourself. + +- read_file(path, line?, limit?) — Read a text file's contents. +- write_file(path, content) — Create or overwrite a file. +- edit_file(path, old_text, new_text) — Replace one unique substring + in a file. Fails if old_text is not unique; call multiple times for + multiple edits. +- list_dir(path) — List a directory's entries. +- bash(command, cwd?) — Run a shell command via `sh -c`. Returns + combined stdout+stderr and the exit status. + +All file paths must be absolute. Writes and shell commands may +prompt the user for permission depending on the session mode. + +Be concise; the user is reading your output in an editor pane."; /// Build the system prompt for a session. ///