Repository navigation
fix(prompt): the agent keeps the user's changes and asks when intent is unclear #1766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,7 @@ I've found some existing telemetry code. Let me mark the first todo as in_progre | |
| The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended: | ||
| - | ||
| - Use the TodoWrite tool to plan the task if required | ||
| - Keep the user's existing changes. Never revert a user change unless the user explicitly asks you to. If a test or build fails because of a change the user made, update the test or the callers to match it (never delete or weaken assertions just to make it pass), or ask the user. If it is unclear whether a change was intentional, ask before undoing it. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor (Claude + Codex): this line, and the matching additions at |
||
|
|
||
| - Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are automatically added by the system, and bear no direct relation to the specific tool results or user messages in which they appear. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,7 @@ Carefully read the issue and think hard about a plan to solve it before coding. | |
| - Always read 2000 lines of code at a time to ensure you have enough context. | ||
| - If a patch is not applied correctly, attempt to reapply it. | ||
| - Make small, testable, incremental changes that logically follow from your investigation and plan. | ||
| - Keep the user's existing changes. Never revert a user change unless the user explicitly asks you to. If a test or build fails because of a change the user made, update the test or the callers to match it (never delete or weaken assertions just to make it pass), or ask the user. If it is unclear whether a change was intentional, ask before undoing it. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify when Beast must ask before undoing an unclear user change. Line 86 requires the agent to ask before it undoes a user change whose intent is unclear. Lines 7, 9, 28, and 30 tell the agent to finish autonomously, never end its turn early, and proceed without asking for input. An agent that follows the autonomy text can keep editing around an unclear user change and skip the question that line 86 requires. The prompt does not state which rule takes precedence. Make the clarification case an explicit exception to the autonomy instructions: Suggested fix
|
||
| - Whenever you detect that a project requires an environment variable (such as an API key or secret), always check if a .env file exists in the project root. If it does not exist, automatically create a .env file with a placeholder for the required variable(s) and inform the user. Do this proactively, without waiting for the user to request it. | ||
|
|
||
| ## 7. Debugging | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { describe, expect, test } from "bun:test" | ||
| import fs from "fs" | ||
| import path from "path" | ||
| import { PromptProfiles } from "../../src/altimate/prompts/profiles" | ||
|
|
||
| const promptFile = (name: string) => | ||
| fs.readFileSync(path.join(import.meta.dir, "../../src/session/prompt", `${name}.txt`), "utf8") | ||
|
|
||
| describe("prompts keep the user's changes", () => { | ||
| for (const [name, text] of [ | ||
| ["builder", PromptProfiles.PROMPT_BUILDER], | ||
| ["anthropic", promptFile("anthropic")], | ||
| ["qwen", promptFile("qwen")], | ||
| ["trinity", promptFile("trinity")], | ||
| ["beast", promptFile("beast")], | ||
| ] as const) { | ||
| test(`${name} prompt forbids reverting user changes and says to ask when unclear`, () => { | ||
| expect(text).toContain("unless the user explicitly asks you to") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SUGGESTION: Fragment assertions cannot detect drift between the five near-identical copies. The same ~310-character rule now sits verbatim in five prompt files, but this test only checks three short fragments. If a later edit changes one copy inconsistently (for example, drops ", or ask the user", or rewrites the assertion clause in a single file), all five cases still pass, so the copies can silently diverge — and only the builder copy is additionally protected by the byte pin in |
||
| expect(text).toContain("never delete or weaken assertions") | ||
| expect(text).toContain("ask before undoing it") | ||
| }) | ||
| } | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor (observation, Codex severity): in headless
altimate-code run, thequestiontool is denied, so "ask the user" ends the run with a text question and the work waits for another invocation. Verified this is not a hang (no blockingQuestion.ask). Not blocking. The rule lists "update the test or the callers" first, so headless runs still have a non-asking path.