Skip to content

Commit ba03e14

Browse files
authored
docs: add agent guidance for resolving runtime binaries by full path (#175)
1 parent 400754b commit ba03e14

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

bin/AGENTS.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,7 @@ Scope: shell CLI and operational scripts under `bin/`.
1818
- Reuse shared helpers (`shell-common.sh`, `paths-common.sh`, `release-common.sh`, etc.) instead of duplicating constants or logging/error patterns.
1919
- Prefer portable shell patterns; distro-specific branches are acceptable when reliability improves.
2020
- Any security-relevant shell change must include/adjust tests.
21-
- **Never call `node`, `npm`, or other runtime binaries by bare name** in scripts that run as root or outside the agent user's shell. These binaries live in the agent's embedded runtime (`/home/baudbot_agent/opt/node/bin/`) and are not on root's PATH. Use `runtime-node.sh` helpers (e.g. `bb_resolve_runtime_node_bin`, `bb_resolve_runtime_node_bin_dir`) to resolve the full path, then invoke via a variable. Fall back to bare name only as a last resort.
22-
23-
```bash
24-
# ✅ Good: resolve then invoke
25-
source "$SCRIPT_DIR/lib/runtime-node.sh"
26-
node_bin_dir="$(bb_resolve_runtime_node_bin_dir "$agent_home")"
27-
"$node_bin_dir/npm" ci --omit=dev
28-
29-
# ❌ Bad: bare name breaks when not on PATH
30-
npm ci --omit=dev
31-
```
21+
- **Never call `node`, `npm`, etc. by bare name** in scripts that run as root. The embedded runtime is not on root's PATH. Use `runtime-node.sh` helpers (`bb_resolve_runtime_node_bin`, `bb_resolve_runtime_node_bin_dir`) to resolve the full path first.
3222

3323
## Critical files
3424

0 commit comments

Comments
 (0)