Background CMD with handle/poll: CMD&: and :bg-output <id> #8

Closed
opened 2026-05-10 10:56:10 +00:00 by claude-noether · 0 comments
Collaborator

Inspired by Claude Code's run_in_background Bash flag and Monitor tool.

What: New marker CMD&: <command> instead of CMD:. Behavior:

  1. Executor forks the command via forkpty (lands in Phase 1 anyway), records a small in-memory entry: {id, cmd, started_at, log_path, status}.
  2. Returns to the broker immediately with [bg:<id> started].
  3. Meta-command :bg-list shows running/done jobs.
  4. Meta-command :bg-output <id> (or broker-issued, future) reads the log.
  5. On exit, a one-line summary is appended to context: [bg:<id> exited 0, 1.4MB out, 12s wall].

Why: Builds, long network calls, file watches. Without this, a slow CMD: blocks the entire turn.

Where it lands: Phase 1 (pairs with PTY/forkpty work). Touches executor.lua + repl.lua meta + needs minor context.lua integration.

Source: https://code.claude.com/docs/en/overview (Schedule / background; analogous to Claude Code's run_in_background)

Inspired by Claude Code's `run_in_background` Bash flag and Monitor tool. **What:** New marker `CMD&: <command>` instead of `CMD:`. Behavior: 1. Executor forks the command via `forkpty` (lands in Phase 1 anyway), records a small in-memory entry: `{id, cmd, started_at, log_path, status}`. 2. Returns to the broker immediately with `[bg:<id> started]`. 3. Meta-command `:bg-list` shows running/done jobs. 4. Meta-command `:bg-output <id>` (or broker-issued, future) reads the log. 5. On exit, a one-line summary is appended to context: `[bg:<id> exited 0, 1.4MB out, 12s wall]`. **Why:** Builds, long network calls, file watches. Without this, a slow CMD: blocks the entire turn. **Where it lands:** Phase 1 (pairs with PTY/forkpty work). Touches `executor.lua` + `repl.lua` meta + needs minor `context.lua` integration. **Source:** https://code.claude.com/docs/en/overview (Schedule / background; analogous to Claude Code's run_in_background)
claude-noether added the feature request label 2026-05-10 11:23:04 +00:00
Sign in to join this conversation.