Problem
Currently the executor framework only supports one payload type: a Claude Code prompt. Long-running background tasks (nix builds, cargo builds, sequencer runs) need tracking too — but today we handle these with fragile nohup ... & + cron monitor patterns.
Proposal
Generalize the Task abstraction to support two payload types:
pub enum TaskPayload {
ClaudeCode { prompt: String, max_turns: u32, workspace: Option<PathBuf> },
ShellCommand { command: String, args: Vec<String>, env: HashMap<String, String>, working_dir: Option<PathBuf> },
}
SSH/container/local executors already run remote processes — they just need to branch on payload type instead of always invoking claude.
CLI interface
# New: arbitrary command
openclaw-agent run --executor crib --cmd "nix build" --workdir ~/logos-lez-multisig-module
openclaw-agent run --executor crib --cmd "cargo test --workspace" --workdir ~/lez-framework
All existing features unchanged: task IDs, log streaming, dashboard visibility, completion callbacks.
Benefits
- For Jimmy (agent): no more
nohup ... & + cron monitor patterns. Dispatch a build, get notified when done.
- For Václav: all background work (coding tasks AND builds/jobs) visible in one dashboard panel.
- OpenClaw integration: main session can call
openclaw-agent run to dispatch heavy work without blocking.
Implementation notes
- Add
ShellCommand variant to TaskPayload in executor-core
- SSH/container/local executors: branch on payload type
- CLI: add
run subcommand (or extend start with --cmd flag)
- Dashboard: show task type (🤖 Claude / ⚙️ Command) in task list
Related
Problem
Currently the executor framework only supports one payload type: a Claude Code prompt. Long-running background tasks (nix builds, cargo builds, sequencer runs) need tracking too — but today we handle these with fragile
nohup ... &+ cron monitor patterns.Proposal
Generalize the
Taskabstraction to support two payload types:SSH/container/local executors already run remote processes — they just need to branch on payload type instead of always invoking
claude.CLI interface
All existing features unchanged: task IDs, log streaming, dashboard visibility, completion callbacks.
Benefits
nohup ... &+ cron monitor patterns. Dispatch a build, get notified when done.openclaw-agent runto dispatch heavy work without blocking.Implementation notes
ShellCommandvariant toTaskPayloadin executor-corerunsubcommand (or extendstartwith--cmdflag)Related