Skip to content

Commit 994c420

Browse files
committed
feat: don't apply 'timeout' wrapper on webserver startup commands
1 parent a3b415d commit 994c420

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.ai-ready/rules/no-long-running-commands.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ When using command execution tools (such as Bash, shell, or terminal tools), do
1010
- `ping` without count limit (`-c`)
1111
- `sleep` with large values
1212
- Infinite loops (`while true`, `for (;;)`)
13-
- Long-running servers or daemons
14-
- `npm start`, `yarn start`, `python -m http.server` without background mode
1513
- Database migrations on large datasets
1614
- Large file downloads without timeout
1715
- `find` or `grep` on entire filesystem without path constraints
1816

17+
## Background Commands
18+
19+
These commands should be executed in the background using the `&` operator, instead of the `timeout` command wrapper:
20+
21+
- Long-running servers or daemons (such as webservers: `npm start`, `yarn start`, `python -m http.server`)
22+
1923
## Best Practices
2024

2125
- Always set timeouts for network operations
2226
- Use `--timeout` or `-c` flags where available
23-
- Use `timeout <time_limit> <command>` command to wrap execution with a time limit
27+
- Use `timeout <time_limit> <command>` command to wrap execution with a time limit (except for server or daemon commands)
2428
- Run potentially long operations as subagent or with background task
2529
- Prefer quick, bounded operations
2630
- If a long-running command is required, inform the user and ask for confirmation first

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Do not execute commands that may run for an extended period:
4646
Best practices:
4747

4848
- Always set timeouts for network operations
49-
- Use `timeout <time_limit> <command>` to wrap execution with a time limit
49+
- If the command **is designed to run in background** (such as `&` appended), this rule **can be ignored**. Otherwise Use `timeout <time_limit> <command>` to wrap execution with a time limit
5050
- Run potentially long operations as background tasks
5151
- If a long-running command is required, ask the user for confirmation first
5252

0 commit comments

Comments
 (0)