As an autonomous agent, you MUST execute this "pre-flight check" workflow BEFORE attempting any heavy or resource-intensive operations such as:
npm installdocker buildmakepip install requiring local gcc compilation)Execute the necessary commands on the active environment to assess system resources:
free -mdf -huptimeDefine the threshold for a safe build environment. For example:
Evaluate the gathered resource parameters to determine the STATUS.
If STATUS: FAIL is determined (resources fall below safe operational thresholds):
ANALYSIS: Identify memory-hogging processes by executing:
top -b -n1 | head -n 20
PROPOSAL: Output the analysis and proactively ask the user if they want to:
docker system prune, npm cache clean --force, or apt clean).DO NOT attempt to "force" the build. Stop execution and wait for the user's explicit response.
If STATUS: PASS is determined (resources are healthy):