From fa9d5c61c967db44e6a861c16f07d28c8f5d1b70 Mon Sep 17 00:00:00 2001 From: Brandon Zhang Date: Fri, 27 Mar 2026 14:00:12 +0800 Subject: [PATCH] docs(agents): note that git commands require --no-pager to avoid terminal hang git may invoke less as a pager which blocks the terminal waiting for user interaction. Always use 'git --no-pager ' or pipe through Out-String/Format-List in PowerShell sessions. --- AGENTS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index bf169c2..0fec3f6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,3 +1,4 @@ ## Notes on calling tools * About `run_in_terminal` or some other similar tools that can make calls to external programs, be very careful about what programs/commands you call - some are blocking indefinitely by nature, like running servers, long-running monitors, etc. If you would like to execute such commands, make sure to run them in a non-blocking way, for example run/spawn them in another temp terminal session. Otherwise, your agent will be hung on the waiting indefinitely. -* About `AskUser`, `get_user_request` or other similar tools that can retrieve latest user input, if available, make sure to call them **AGGRESSIVELY** once you finished all tasks at hand, so as to AVOID ending the current task/work/session prematurely. NEVER end the current task/work/session on your own, the user will keep adding new instructions into this kind of tools in the background. You can be missing out CRITICAL instructions from user when you failed to call them aggressively. Also, sometimes these tools can fail to return any results due to technical issues. Just try to call again when that happens. \ No newline at end of file +* About `AskUser`, `get_user_request` or other similar tools that can retrieve latest user input, if available, make sure to call them **AGGRESSIVELY** once you finished all tasks at hand, so as to AVOID ending the current task/work/session prematurely. NEVER end the current task/work/session on your own, the user will keep adding new instructions into this kind of tools in the background. You can be missing out CRITICAL instructions from user when you failed to call them aggressively. Also, sometimes these tools can fail to return any results due to technical issues. Just try to call again when that happens. +* About `git` commands: **always use `git --no-pager`** (or pipe output through `| Out-String`) when running git commands in the terminal. Without this, git may invoke `less` as a pager, causing the terminal to hang waiting for user interaction. Example: `git --no-pager log --oneline -10`, `git --no-pager diff`, `git --no-pager status`. Similarly for any other command that may invoke a pager (e.g. `man`, `less`).