Skip to content

feat: native task completion callback — remove need for openclaw system event in prompts #6

@jimmy-claw

Description

@jimmy-claw

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:

  1. 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
  2. Streaming logs — logs flow back through the executor transport rather than requiring tail-polling of a remote log file
  3. Status trackingopenclaw-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

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