Add guidance for waiting on background processes to system prompt#1694
Add guidance for waiting on background processes to system prompt#1694
Conversation
Add instructions to the PROCESS_MANAGEMENT section explaining how to wait for background processes to finish using tail --pid. This allows the agent to monitor long-running background tasks and automatically continue when they complete. The pattern is: 1. Start background process: command > output.log 2>&1 & 2. Capture PID: PID=$! 3. Wait and monitor: tail --pid=$PID -f output.log Co-authored-by: openhands <openhands@all-hands.dev>
all-hands-bot
left a comment
There was a problem hiding this comment.
The PR adds helpful guidance for waiting on background processes, but is missing important information about checking exit codes. See inline comment for details.
…ocess waiting - Update system prompt to include guidance on checking exit status with 'wait $PID' after tail exits - Add integration test t10_wait_for_background_process.py to verify agent can wait for background processes Co-authored-by: openhands <openhands@all-hands.dev>
Updated the guidance to use nohup when starting background processes, which protects them from being terminated if the terminal breaks or resets. Co-authored-by: openhands <openhands@all-hands.dev>
|
Good point! Since the terminal can break/reset in rare cases, using nohup command > output.log 2>&1 &
PID=$!
tail --pid=$PID -f output.log
wait $PIDThis ensures the background process continues running even if the terminal session is disrupted. |
|
Hi! I started running the integration tests on your PR. You will receive a comment with the results shortly. |
🧪 Integration Tests ResultsOverall Success Rate: 96.4% 📁 Detailed Logs & ArtifactsClick the links below to access detailed agent/LLM logs showing the complete reasoning process for each model. On the GitHub Actions page, scroll down to the 'Artifacts' section to download the logs.
📊 Summary
📋 Detailed Resultslitellm_proxy_moonshot_kimi_k2_thinking
Skipped Tests:
litellm_proxy_mistral_devstral_2512
Skipped Tests:
Failed Tests:
litellm_proxy_deepseek_deepseek_chat
Skipped Tests:
litellm_proxy_vertex_ai_gemini_3_pro_preview
litellm_proxy_claude_sonnet_4_5_20250929
litellm_proxy_gpt_5.1_codex_max
Skipped Tests:
Failed Tests:
|
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
|
Hi! I started running the integration tests on your PR. You will receive a comment with the results shortly. |
🧪 Condenser Tests ResultsOverall Success Rate: 92.2% 📁 Detailed Logs & ArtifactsClick the links below to access detailed agent/LLM logs showing the complete reasoning process for each model. On the GitHub Actions page, scroll down to the 'Artifacts' section to download the logs.
📊 Summary
📋 Detailed Resultslitellm_proxy_gpt_5.1_codex_max
Failed Tests:
litellm_proxy_mistral_devstral_2512
Skipped Tests:
Failed Tests:
litellm_proxy_vertex_ai_gemini_3_pro_preview
litellm_proxy_deepseek_deepseek_chat
Skipped Tests:
Failed Tests:
litellm_proxy_claude_sonnet_4_5_20250929
litellm_proxy_moonshot_kimi_k2_thinking
Skipped Tests:
|
Co-authored-by: openhands <openhands@all-hands.dev>
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
Summary
This PR adds guidance to the system prompt's PROCESS_MANAGEMENT section explaining how agents can wait for background processes to finish using
tail --pid.Fixes #619
The new guidance teaches the agent to:
command > output.log 2>&1 &PID=$!tail --pid=$PID -f output.logThis pattern allows the agent to monitor long-running background tasks and automatically continue when they complete, which is useful for tasks like installations, builds, or tests that may take a while.
Checklist
@xingyaoww can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:a2a20e4-pythonRun
All tags pushed for this build
About Multi-Architecture Support
a2a20e4-python) is a multi-arch manifest supporting both amd64 and arm64a2a20e4-python-amd64) are also available if needed