Skip to content

Background agents ignore initial prompt - stuck until manually messaged #21211

Closed as not planned

Description

@shrijit37

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

  1. Launch a background agent with a prompt:
task(
  run_in_background=true,
  subagent_type="explore",
  prompt="List files in /tmp"
)
  1. Wait for agent completion (it will never complete on its own)

  2. Notice the agent shows status "running" but produces no output

  3. 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.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 6, 2026
  2. FilJed commented on Apr 14, 2026

    @FilJed

    I cannot see mentioning "run_in_background=true" anywhere in docs or in code search. Is it even working in opencode?

  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions