Bug Description
Background agents launched with run_in_background=true ignore their initial prompt and wait indefinitely until manually messaged via session_id.
Steps to Reproduce
- Launch a background agent with a prompt:
task(
run_in_background=true,
subagent_type="explore",
prompt="List files in /tmp"
)
-
Wait for agent completion (it will never complete on its own)
-
Notice the agent shows status "running" but produces no output
-
Only when sending a continuation message via session_id does the agent actually work:
task(
session_id="ses_xxx",
prompt="Execute your task now"
)
Expected Behavior
- Agent should process the initial prompt immediately upon launch
- No manual continuation message should be required
Actual Behavior
- Agent launches, shows "running" status
- Never processes initial prompt
- Stays stuck until explicitly messaged again
Workaround
Use run_in_background=false for synchronous execution, which works correctly.
Environment
- OpenCode Desktop app (macOS)
- Model: opencode/big-pickle (parent), nvidia/gemma-4-31b-it (subagent)
Additional Context
This makes background agents unusable for parallel workloads as they effectively become synchronous anyway.
Bug Description
Background agents launched with
run_in_background=trueignore their initial prompt and wait indefinitely until manually messaged viasession_id.Steps to Reproduce
Wait for agent completion (it will never complete on its own)
Notice the agent shows status "running" but produces no output
Only when sending a continuation message via
session_iddoes the agent actually work:Expected Behavior
Actual Behavior
Workaround
Use
run_in_background=falsefor synchronous execution, which works correctly.Environment
Additional Context
This makes background agents unusable for parallel workloads as they effectively become synchronous anyway.