fix(helexa-acp): describe Stage 3 tools in the default system prompt
Some checks failed
build-prerelease / Build cortex binary (push) Blocked by required conditions
CI / Test (push) Waiting to run
build-prerelease / Resolve version stamps (push) Successful in 35s
CI / Format (push) Successful in 42s
CI / Clippy (push) Successful in 2m39s
build-prerelease / Build neuron-ada (push) Has been cancelled
build-prerelease / Package cortex RPM (push) Has been cancelled
build-prerelease / Package helexa-neuron-ada RPM (push) Has been cancelled
build-prerelease / Package helexa-neuron-ampere RPM (push) Has been cancelled
build-prerelease / Package helexa-neuron-blackwell RPM (push) Has been cancelled
build-prerelease / Publish to rpm.lair.cafe (unstable) (push) Has been cancelled
CI / Build cortex SRPM (push) Has been cancelled
CI / Build neuron SRPM (push) Has been cancelled
CI / Publish cortex to COPR (push) Has been cancelled
CI / Publish neuron to COPR (push) Has been cancelled
CI / Bump version in source (push) Has been cancelled
build-prerelease / Build neuron-ampere (push) Has been cancelled
build-prerelease / Build neuron-blackwell (push) Has been cancelled
Some checks failed
build-prerelease / Build cortex binary (push) Blocked by required conditions
CI / Test (push) Waiting to run
build-prerelease / Resolve version stamps (push) Successful in 35s
CI / Format (push) Successful in 42s
CI / Clippy (push) Successful in 2m39s
build-prerelease / Build neuron-ada (push) Has been cancelled
build-prerelease / Package cortex RPM (push) Has been cancelled
build-prerelease / Package helexa-neuron-ada RPM (push) Has been cancelled
build-prerelease / Package helexa-neuron-ampere RPM (push) Has been cancelled
build-prerelease / Package helexa-neuron-blackwell RPM (push) Has been cancelled
build-prerelease / Publish to rpm.lair.cafe (unstable) (push) Has been cancelled
CI / Build cortex SRPM (push) Has been cancelled
CI / Build neuron SRPM (push) Has been cancelled
CI / Publish cortex to COPR (push) Has been cancelled
CI / Publish neuron to COPR (push) Has been cancelled
CI / Bump version in source (push) Has been cancelled
build-prerelease / Build neuron-ampere (push) Has been cancelled
build-prerelease / Build neuron-blackwell (push) Has been cancelled
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) <noreply@anthropic.com>
This commit is contained in:
@@ -1,25 +1,38 @@
|
|||||||
//! System prompt assembly.
|
//! System prompt assembly.
|
||||||
//!
|
//!
|
||||||
//! Stage 2 ships a small built-in prompt aimed at coding assistance:
|
//! The built-in prompt tells the model the working directory and
|
||||||
//! it tells the model the working directory and reminds it that no
|
//! enumerates the tools it actually has — without this, models trained
|
||||||
//! tools are available yet. Users who want something different point
|
//! to "be safe when you don't know your environment" tend to refuse
|
||||||
//! `HELEXA_ACP_SYSTEM_PROMPT_PATH` (env) or `system_prompt_path` (TOML)
|
//! tool use and ask the user to paste content instead. Override with
|
||||||
//! at a file and we read that verbatim. The literal token `{cwd}` in
|
//! `HELEXA_ACP_SYSTEM_PROMPT_PATH` (env) or `system_prompt_path`
|
||||||
//! a user-supplied file is substituted with the session's working
|
//! (TOML); the literal token `{cwd}` in a user-supplied file is
|
||||||
//! directory so editor templates can include it without templating.
|
//! substituted with the session's working directory.
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
const DEFAULT_PROMPT: &str = "\
|
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}
|
Working directory: {cwd}
|
||||||
|
|
||||||
Stage 2 build: you have no tools available — answer with text only.
|
You have the following tools. Call them whenever the user's request
|
||||||
When you need to refer to files or directories, describe paths
|
involves looking at or modifying files, or running commands — do not
|
||||||
relative to the working directory above. Be concise; the user is
|
ask the user to paste file contents you could read yourself.
|
||||||
reading your output in an editor pane.";
|
|
||||||
|
- 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.
|
/// Build the system prompt for a session.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user