fix: resolve conflict between "make changes" and "ask first" instructions in system prompt#462
Conversation
|
6a07b60 to
68c7651
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a07b60094
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| // Suppress DEP0190 deprecation warning for shell+args in this dev script. | ||
| // The args are safe (hardcoded paths + CLI flags forwarded by the user). | ||
| process.removeAllListeners('warning'); |
There was a problem hiding this comment.
Filter the warning instead of removing listeners
On the repo's Node 24.15.0, process.removeAllListeners('warning'); spawn('echo', ['hi'], { shell: true }) still prints [DEP0190] to stderr because removing listeners leaves Node's default warning output in place. This means Windows pnpm dev still shows the warning this change is trying to suppress, while also discarding any warning handlers installed via preloads; add a targeted warning listener/filter or avoid shell:true instead.
Useful? React with 👍 / 👎.
| cwd: APP_ROOT, | ||
| env, | ||
| stdio: 'inherit', | ||
| shell: useShell, |
There was a problem hiding this comment.
Avoid shelling out with forwarded CLI args
When pnpm dev runs on Windows, this shell: true path forwards cliArgs through the shell; Node's DEP0190 warning for child_process.spawn says these args are not escaped, only concatenated. Any prompt or flag value containing shell metacharacters such as &, |, or > is therefore interpreted by cmd.exe instead of being delivered literally to the CLI, which can corrupt normal dev invocations or execute an extra command copied into an argument; use a non-shell launch path for the .cmd wrapper or quote/escape the forwarded args.
Useful? React with 👍 / 👎.
…ions in system prompt The system prompt at Prompt and Tool Use section contained conflicting directives: 'MUST use tools to make actual changes — do not just describe' vs 'Ask the user for clarification if anything is unclear' in the Coding Guidelines section, with no priority defined. Changes: - Remove MUST/do-not-just-describe wording that overrides project AGENTS.md - Add 'if unclear, discuss first' qualifier directly into the same paragraph - Soften 'default to action' to 'default to action when requirements are clear' Closes MoonshotAI#459
68c7651 to
01beaef
Compare
Fixes #459
Problem
The system prompt (
packages/agent-core/src/profile/default/system.md) contains conflicting instructions:# Prompt and Tool Usesection: "you MUST use the appropriate tools to make actual changes — do not just describe the solution in text"# General Guidelines for Codingsection: "Ask the user for clarification if there is anything unclear"These two directives fight each other. The first uses strong language (MUST, do not just) that overrides the second, causing the agent to default to directly making changes without prior discussion.
Changes
Two minimal edits in
packages/agent-core/src/profile/default/system.md:Line 9: Added "when the requirements are clear" qualifier to "default to taking action with tools", so ambiguous situations are not automatically treated as tasks to execute immediately.
Line 11:
Effect
Before: two separate sections giving contradictory orders, no priority → agent behavior is erratic.
After: one coherent statement: "do it, but if unclear, ask first" — with the "ask first" part in the same paragraph as the "do it" part, so neither can override the other.