Skip to content

fix: notify agent session on background exec completion by default#741

Open
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-46926-fix-exec-wake-on-exit
Open

fix: notify agent session on background exec completion by default#741
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-46926-fix-exec-wake-on-exit

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Background exec processes that complete successfully with empty output currently silently exit without notifying the parent agent session. This is the #1 UX gap in multi-agent orchestration workflows.

Problem

When an orchestrator agent (e.g., Hikari) dispatches a coding agent (Claude Code, Codex) via exec background:true, the coding agent finishes but the orchestrator is never woken up — users see silence until they manually check in.

Root cause: notifyOnExitEmptySuccess defaults to false, so successful exits with empty/cleared output skip the system event + heartbeat wake entirely.

Related issue: openclaw#18237

Changes

Change Before After
notifyOnExitEmptySuccess default false true
Exec exit wake coalesce delay 250ms 50ms
Config docs "default: false" "default: true"
Tests Assert empty-success is skipped Assert empty-success is emitted

Why

  1. Agents should always know when background work finishes. A silent success is indistinguishable from a hang or crash from the orchestrator's perspective.
  2. 50ms coalesce is appropriate for exec exit events — they are time-sensitive in orchestration flows where the agent needs to report results or start the next phase immediately.
  3. Backward compatible — users who prefer the old behavior can set tools.exec.notifyOnExitEmptySuccess: false.

Testing

  • All 24 tests in bash-tools.test.ts pass ✅
  • Test cases updated to reflect new default behavior

Fixes openclaw#18237

Previously, successful background exec processes with empty output
would silently complete without notifying the parent agent session.
This caused a major UX gap in multi-agent orchestration workflows
where an orchestrator agent dispatches coding agents (Claude Code,
Codex) in background — the orchestrator was never woken up on
completion, leaving users waiting indefinitely.

Changes:
- Default notifyOnExitEmptySuccess to true (was false)
  Background processes that complete successfully now always enqueue
  a system event, even when stdout is empty. Agents should always
  know when their dispatched work finishes.
- Align runExecProcess default with createExecTool (both use !== false)
- Reduce exec exit wake coalesce delay to 50ms (was 250ms)
  Exec completion is time-sensitive for orchestration flows.
- Update tests and config docs to reflect new defaults

Users who want the old behavior can set:
  tools.exec.notifyOnExitEmptySuccess: false

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Async exec callback — inject result back to session when process exits

2 participants