Worker windows: delegated work as at-claude windows the hub shows as its agents (ATC-256) #391

Merged
merge-queue merged 2 commits from atc-256-worker-windows into main 2026-12-02 19:12:46 -08:00
Owner

Work package: https://openproject.home.romaine.life/wp/ATC-256 (this session's: https://openproject.home.romaine.life/wp/ATC-258)

Delegated work on home PCs runs as an at-claude window of its own in the agents tmux session, never a sub-agent. This makes such a worker window count as one of the background agents of the window that opened it (the hub), shown where a sub-agent was, until both agree it is done.

Added

  • at-claude worker open -name -dir -brief-file, worker send <name> (text on stdin), worker done <name>, through the hub's host (a Low or agents-account claude's tools may ask). Open saves the brief in ~/.claude-spawn with a note telling the worker its final reply each turn is its report, opens the window with the installed claude-pane (as open-window does), marks the tmux window with @at-claude-hub and @at-claude-worker, and moves it to agents with tmux's own movew, making the session if missing (CP-1).
  • The worker's host reads those marks as its claude starts, so only this command makes a worker (a /new-window session never is), and the marks survive a window restart. It tells the hub's host it started, its progress after each tool call (the call in words, call count, tokens from its replies' usage), and each turn's final reply as its report.
  • The hub's host lists workers in the Background work table (Worker: <name>), in at-claude agents, and on the strip through tmux-strip agents with strip's WindowStart/WindowStop (strip PR 21, released as v0.1.18). It gives Claude each report as a wake in a new at-claude-worker tag, which the window draws as that worker's message, folded like a sub-agent's report, beside the face its own window shows. send wakes the worker in an at-claude-hub tag. done closes the worker's window (its claude ends with the session saved) and drops it everywhere. A worker window closed by hand is dropped too, and the hub's Claude told.
  • Each window's SessionStart context now names the worker commands beside at-claude agents.

Changed / left alone

  • Design change from the brief: the worker is identified by tmux window options the hub sets, not an env var. claude-pane's --env takes only follow-up settings, and a protocol restart (respawn-pane) drops env but keeps window options.
  • host.Protocol stays 3: new optional fields (Request.Worker, BackgroundTask.Window, a workers event an older window drops), a new role an older host closes on, and new Moved fields so a move hands on the list and the worker's tie to its hub.
  • Stop-task still stops only Claude Code's own tasks; a worker ends with done.
  • Not here: tmux-strip's panel wording for a window (its own PR).

Proven

  • Tests: internal/host/worker_test.go runs two real hosts with the fake claude end to end (open, marks, move, start, progress, report waking the hub, follow-up, done, strip events), plus notes from below Medium refused, gone, and a move. Parsing, transcript and window-row tests are listed in TESTING.md.
  • On a throwaway tmux server with stand-in claudes: open created agents and moved the window there; the worker's report woke the hub, which showed 1 agent report and the Worker: review-diff row; at-claude agents listed it; a follow-up reached the worker and its next report the hub; done closed its window and emptied the lists; a second worker's window killed by hand was dropped with the hub told. The real tmux-strip agents took both events without error.
  • Not proven: a real Claude's tool calls as a worker (progress with real token counts), and the hub's own Claude running worker open as a tool (driven from outside here).

🤖 Generated with Claude Code

Work package: https://openproject.home.romaine.life/wp/ATC-256 (this session's: https://openproject.home.romaine.life/wp/ATC-258) Delegated work on home PCs runs as an at-claude window of its own in the `agents` tmux session, never a sub-agent. This makes such a worker window count as one of the background agents of the window that opened it (the hub), shown where a sub-agent was, until both agree it is done. **Added** - `at-claude worker open -name -dir -brief-file`, `worker send <name>` (text on stdin), `worker done <name>`, through the hub's host (a Low or agents-account claude's tools may ask). Open saves the brief in `~/.claude-spawn` with a note telling the worker its final reply each turn is its report, opens the window with the installed claude-pane (as open-window does), marks the tmux window with `@at-claude-hub` and `@at-claude-worker`, and moves it to `agents` with tmux's own `movew`, making the session if missing (CP-1). - The worker's host reads those marks as its claude starts, so only this command makes a worker (a /new-window session never is), and the marks survive a window restart. It tells the hub's host it started, its progress after each tool call (the call in words, call count, tokens from its replies' usage), and each turn's final reply as its report. - The hub's host lists workers in the Background work table (`Worker: <name>`), in `at-claude agents`, and on the strip through `tmux-strip agents` with strip's `WindowStart`/`WindowStop` (strip PR 21, released as v0.1.18). It gives Claude each report as a wake in a new `at-claude-worker` tag, which the window draws as that worker's message, folded like a sub-agent's report, beside the face its own window shows. `send` wakes the worker in an `at-claude-hub` tag. `done` closes the worker's window (its claude ends with the session saved) and drops it everywhere. A worker window closed by hand is dropped too, and the hub's Claude told. - Each window's SessionStart context now names the worker commands beside `at-claude agents`. **Changed / left alone** - Design change from the brief: the worker is identified by tmux window options the hub sets, not an env var. claude-pane's `--env` takes only follow-up settings, and a protocol restart (`respawn-pane`) drops env but keeps window options. - `host.Protocol` stays 3: new optional fields (`Request.Worker`, `BackgroundTask.Window`, a `workers` event an older window drops), a new role an older host closes on, and new `Moved` fields so a move hands on the list and the worker's tie to its hub. - Stop-task still stops only Claude Code's own tasks; a worker ends with `done`. - Not here: tmux-strip's panel wording for a window (its own PR). **Proven** - Tests: `internal/host/worker_test.go` runs two real hosts with the fake claude end to end (open, marks, move, start, progress, report waking the hub, follow-up, done, strip events), plus notes from below Medium refused, gone, and a move. Parsing, transcript and window-row tests are listed in TESTING.md. - On a throwaway tmux server with stand-in claudes: open created `agents` and moved the window there; the worker's report woke the hub, which showed `1 agent report` and the `Worker: review-diff` row; `at-claude agents` listed it; a follow-up reached the worker and its next report the hub; done closed its window and emptied the lists; a second worker's window killed by hand was dropped with the hub told. The real `tmux-strip agents` took both events without error. - Not proven: a real Claude's tool calls as a worker (progress with real token counts), and the hub's own Claude running `worker open` as a tool (driven from outside here). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Worker windows: delegated work as at-claude windows the hub shows as its agents (ATC-256)
Some checks failed
Suite default / scope (pull_request) Has been cancelled
Suite default / check-fetches (pull_request) Has been cancelled
Suite default / check-rules (pull_request) Has been cancelled
Suite default / check-logs (pull_request) Has been cancelled
Suite default / reused-checks (pull_request) Has been cancelled
Suite go / scope (pull_request) Has been cancelled
Suite go / check-format (pull_request) Has been cancelled
Suite go / check-test-linux (pull_request) Has been cancelled
Suite go / check-test-windows (pull_request) Has been cancelled
Suite go / check-services (pull_request) Has been cancelled
Suite go / reused-checks (pull_request) Has been cancelled
Suite release / scope (pull_request) Has been cancelled
Suite release / module (pull_request) Has been cancelled
Suite release / reserve (pull_request) Has been cancelled
Suite release / finalize (pull_request) Has been cancelled
Suite release / deliver (pull_request) Has been cancelled
Suite release / deliver-prune (pull_request) Has been cancelled
Suite release / publish (pull_request) Has been cancelled
Suite release / check-package (pull_request) Has been cancelled
Suite release / check-manifest (pull_request) Has been cancelled
Suite release / deploy-image (pull_request) Has been cancelled
Suite release / reused-checks (pull_request) Has been cancelled
fc44524316
Merge branch 'main' into atc-256-worker-windows
All checks were successful
Suite release / module (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite go / check-test-windows (pull_request) Has been skipped
Suite go / check-services (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 6s
Suite release / deliver-prune (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 5s
Suite default / check-logs (pull_request) Successful in 5s
Suite go / check-format (pull_request) Successful in 6s
Suite default / reused-checks (pull_request) Successful in 5s
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Successful in 10s
Suite default / scope (pull_request) Successful in 5s
Suite go / scope (pull_request) Successful in 5s
Suite release / check-manifest (pull_request) Has been skipped
Suite release / check-package (pull_request) Successful in 6s
Suite go / reused-checks (pull_request) Successful in 3s
Suite release / publish (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Successful in 4s
Suite go / check-test-linux (pull_request) Successful in 28s
merge-queue landed on main
a189046718
merge-queue deleted branch atc-256-worker-windows 2026-12-02 19:12:46 -08:00
Sign in to join this conversation.
No reviewers
No labels
queue
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/at-claude!391
No description provided.