llama-atmosphere-agent: general-purpose default prompt; cross-platform ShellToolTest - #450
Merged
Merged
Conversation
…or any command
The default system prompt called the agent a "careful coding agent" and described
run_command as a way "to build, test or inspect the project"; the tool description
said "build, test, grep or list files". Qwen3-4B read that as a prohibition and
refused "list the docker images" ("my tools are only for files") although the tool
was registered and docker was on PATH -- in a fresh single-turn run too, so it was
the prompt, not the chat history.
- LocalAgent.systemPrompt: a general-purpose assistant on the user's machine. With
--allow-shell it states that run_command executes any command line through the
named shell, starting in the workspace but not limited to it, and that the model
should run a command instead of explaining one; without it, the prompt says
commands are unavailable and names the flag. Answers in the user's language.
- ShellTool: description widened to "any command line on this machine through
<shell>"; isWindows()/shellName() shared with the prompt.
- READMEs: general-purpose wording, an "everything at once" example with
--allow-shell --system, a "The system prompt" section, generic paths only.
- CLAUDE.md: why the prompt must not be narrowed back; ShellToolTest is POSIX-only.
Verified with Qwen3-4B-Instruct-2507 on Vulkan: the same question now calls
run_command {command=docker images} with the default prompt.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2h8gXyyE5UeimkL9vQv9G
ShellToolTest used POSIX commands (ls, sleep, printf, `; exit 3`) and failed 4 of 5 tests on Windows, where ShellTool runs cmd.exe /c. Each test now picks its command line with ShellTool.isWindows() -- the same detection ShellTool.run uses to choose the shell -- so it always speaks the shell the tool actually starts: - ls / dir /b - `echo boom 1>&2; exit 3` / `echo boom 1>&2 & exit 3` - truncation: echo on both, the expected length counts the platform's line separator (\n from sh, \r\n from cmd.exe) - sleep 30 / ping -n 30 127.0.0.1 >nul (also a child of the shell, so the descendant kill stays covered) Verified: Windows 11 (all 31 agent tests), Linux in maven:3.9-eclipse-temurin-21 (ShellToolTest 5/5, AgentOptionsTest 11/11). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2h8gXyyE5UeimkL9vQv9G
bernardladenthin
had a problem deploying
to
maven-central
September 21, 2026 19:18 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
maven-central
September 21, 2026 19:18 — with
GitHub Actions
Failure
The system prompt and the run_command description were Java string
concatenations. They are now plain text next to the classes, in
src/main/resources/net/ladenthin/llama/atmosphere/:
- system-prompt.txt ({workspace}, {shell_section})
- system-prompt-shell.txt ({shell}; the section with --allow-shell)
- system-prompt-no-shell.txt (the section without it)
- run-command-tool.txt ({shell}; the tool description)
each with a .license sidecar so REUSE stays green without an SPDX comment
reaching the model. LocalAgent.prompt(name) loads them (UTF-8, trimmed; a
missing file throws). New test promptResourcesLoadAndEveryPlaceholderIsFilled
fails on a missing file or a placeholder left unfilled; the tool-description
test checks the same. README and CLAUDE.md point at the files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2h8gXyyE5UeimkL9vQv9G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
With
--allow-shell, Qwen3-4B refused "lokal läuft docker, kannst du alle verfügbaren images listen" ("my tools are only for files") althoughrun_commandwas registered anddockerwas onPATH. A fresh single-turn run refused too, so the chat history was not the cause — the prompt was: the default called the agent a "careful coding agent" and describedrun_commandas a way "to build, test or inspect the project"; the tool description said "build, test, grep or list files".Experiments (Qwen3-4B-Instruct-2507, Vulkan, RTX 3070):
docker imageswith run_command"--system"run_command executes ANY command…"run_command {command=docker images}What
LocalAgent.systemPrompt: a general-purpose assistant on the user's machine. With--allow-shellit states thatrun_commandexecutes any command line through the named shell (cmd.exeon Windows,shelsewhere), starting in the workspace but not limited to it, and that the model should run a command instead of explaining one. Without the flag it says commands are unavailable and names the flag. Answers in the user's language.ShellTool: description widened;isWindows()/shellName()shared with the prompt.ShellToolTestruns on every platform: each test picks its command withShellTool.isWindows()(the same detectionShellTool.runuses), instead of POSIX-only commands that failed 4 of 5 on Windows.--allow-shell --system '…', a "The system prompt" section, generic paths only. CLAUDE.md: why the prompt must not be narrowed back.--allow-shellstays opt-in.Verified
spotless:checkgreen.maven:3.9-eclipse-temurin-21):ShellToolTest5/5,AgentOptionsTest11/11.🤖 Generated with Claude Code
https://claude.ai/code/session_01E2h8gXyyE5UeimkL9vQv9G