Skip to content

[Bug]: background completion reminders arrive only after active parent turn ends in v4.2.2 #4164

@NICxKMS

Description

@NICxKMS

Prerequisites

  • I am writing this issue in English.
  • I searched existing issues and found related but not exact matches.
  • I am using the latest version of oh-my-openagent.
  • I checked the documentation / investigated with the repo context loaded.
  • I ran npx -y oh-my-openagent doctor and included the output below.

Bug Description

Background task completion reminders still appear to be delivered too late in oh-my-openagent v4.2.2.

A background child session can finish quickly, but the parent model does not receive [BACKGROUND TASK COMPLETED] or [ALL BACKGROUND TASKS COMPLETE] while its current turn is still active. The reminder is injected only after the parent turn ends and the parent has already sent its final response.

Steps to Reproduce

  1. Start a parent agent turn.
  2. Launch a trivial background task:
task(
  category="quick",
  load_skills=[],
  run_in_background=true,
  description="Hi only session",
  prompt="Respond exactly with `hi` and then stop."
)
  1. Keep the parent turn active with harmless file reads and sleeps for about a minute.
  2. Observe that the child session completes.
  3. Observe that no completion reminder reaches the active parent turn.
  4. Let the parent send its final response.
  5. Observe that [ALL BACKGROUND TASKS COMPLETE] arrives only after the parent turn has ended.

Expected Behavior

The active parent turn should receive the background completion reminder before it finalizes, so it can call background_output(...) during the same turn.

Actual Behavior

The child task completed in about 5 seconds, but no reminder reached the active parent turn.

Observed task:

  • Background task ID: bg_e8c2b5ef
  • Child session ID: ses_1c46e2af9ffeBguUcCF8zy5QVF
  • Child output: hi
  • Task duration: 5s

The parent stayed active for roughly a minute. After the parent final response, this arrived:

[ALL BACKGROUND TASKS COMPLETE]

Completed:
- bg_e8c2b5ef: Hi only session

After that, background_output(task_id="bg_e8c2b5ef") returned hi.

Doctor Output

$ npx -y oh-my-openagent doctor

oMoMoMoMo Doctor

✓ System OK (opencode 1.15.4 · oh-my-openagent ^4.2.2)

Error Logs

No exception or crash was observed. The failure is delayed notification timing.

Configuration

opencode --version:

1.15.4

npx -y oh-my-openagent --version:

4.2.2

C:\Users\Nicx\.config\opencode\opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "oh-my-openagent@^4.2.2"
  ],
  "provider": {},
  "mcp": {
    "stitch": {
      "type": "remote",
      "url": "https://stitch.googleapis.com/mcp",
      "headers": {
        "X-Goog-Api-Key": "<redacted>"
      },
      "enabled": true
    }
  }
}

C:\Users\Nicx\.config\opencode\oh-my-openagent.json relevant excerpt:

{
  "$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/oh-my-opencode.schema.json",
  "team_mode": {
    "enabled": true,
    "tmux_visualization": false,
    "max_parallel_members": 8,
    "max_members": 8,
    "max_messages_per_run": 10000,
    "max_wall_clock_minutes": 120,
    "max_member_turns": 500,
    "message_payload_max_bytes": 327680,
    "recipient_unread_max_bytes": 2621440,
    "mailbox_poll_interval_ms": 3000
  },
  "agents": {
    "sisyphus": {
      "model": "openai/gpt-5.5-fast",
      "variant": "xhigh",
      "fallback_models": [{ "model": "openai/gpt-5.5", "variant": "xhigh" }]
    },
    "sisyphus-junior": {
      "model": "openai/gpt-5.5-fast",
      "variant": "xhigh",
      "fallback_models": [{ "model": "openai/gpt-5.5", "variant": "xhigh" }]
    }
  },
  "categories": {
    "quick": {
      "model": "openai/gpt-5.5-fast",
      "variant": "xhigh",
      "fallback_models": [
        { "model": "openai/gpt-5.5-fast", "variant": "xhigh" },
        { "model": "openai/gpt-5.5", "variant": "xhigh" }
      ]
    }
  }
}

Additional Context

v4.2.2 includes the relevant parent-wake fixes and ParentWakeNotifier, but this live repro still shows delayed delivery.

Related but not exact duplicates:

Operating System

Windows

OpenCode Version

1.15.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions