Problem
Currently, when a coding agent task finishes, the only way to notify the orchestrating session is to append a shell command to the task prompt:
When completely finished, run: openclaw system event --text "Done: ..." --mode now
This is fragile:
- Fails if the gateway is not reachable from the executor host (e.g. remote SSH)
- Relies on
openclaw CLI being installed on the executor
- Requires no auth — security concern
- Claude sometimes skips it or gets the syntax wrong
- No structured result — just a freeform text string
Proposed solution
The executor should handle completion notification natively:
- Task completion callback — when a task finishes (success or failure), the executor reports back to the OpenClaw session that spawned it, including exit code, final log tail, and any structured output
- Streaming logs — logs flow back through the executor transport rather than requiring tail-polling of a remote log file
- Status tracking —
openclaw-agent list already tracks task state; surface this back to the main session automatically on completion
Result
Once this is in place, the openclaw system event hack in task prompts becomes unnecessary. The executor is the notification mechanism — clean, structured, and transport-aware.
Notes
- SSH executor could POST completion to a local OpenClaw webhook/socket
- Or: OpenClaw polls
openclaw-agent list on a short interval and reacts to state transitions
- Related: current workaround used in lez-framework #27 e2e test task
Problem
Currently, when a coding agent task finishes, the only way to notify the orchestrating session is to append a shell command to the task prompt:
This is fragile:
openclawCLI being installed on the executorProposed solution
The executor should handle completion notification natively:
openclaw-agent listalready tracks task state; surface this back to the main session automatically on completionResult
Once this is in place, the
openclaw system eventhack in task prompts becomes unnecessary. The executor is the notification mechanism — clean, structured, and transport-aware.Notes
openclaw-agent liston a short interval and reacts to state transitions