server: dispatch, wait, claim and done, the tools that hand work between sessions #87

Closed
mikluko wants to merge 4 commits from room-work into serve-files
Owner

The server's side of the four tools of spec-bb1.40, stacked on #86 (serve-files); retarget to main once it merges.

  • Proto: HostService.Dispatch, Wait, Claim, Done (the shape proposed to roomcity-5e, who adds the host's side to the room server).
  • internal/gcwork: each tool as gc's command (sling <pool> --stdin --json, session wait --on-beads, hook --claim --drain-ack --json then bd show --json, bd update --notes=, bd close, runtime drain-ack), tested against a gc stub script. The claimed task is a session mark, so done(result) takes nothing else; a failed close leaves the task claimed and does not drain.
  • gchandler.Handler.Exec: gc run as a session with the identity the server kept of its start; Run shares the runner.
  • [agents.<name>] tools, checked at the server per call (PermissionDenied otherwise), and passed to the pod as ROOMCITY_ROOM_TOOLS for the host to register.

Shapes read from gc's source, not run: that gc session wait takes the session from GC_SESSION_ID (it does, cmd_wait.go) and that bd show --json prints a list of beads. The sandbox run shows them.

Open: after wait the foreman is nudged that the task closed and reads the worker's notes with gc bd show, which asks the owner. A fifth tool that returns the result, or the nudge carrying it, would remove that; not decided here.

The server's side of the four tools of spec-bb1.40, stacked on #86 (`serve-files`); retarget to main once it merges. - Proto: `HostService.Dispatch`, `Wait`, `Claim`, `Done` (the shape proposed to roomcity-5e, who adds the host's side to the `room` server). - `internal/gcwork`: each tool as gc's command (`sling <pool> --stdin --json`, `session wait --on-beads`, `hook --claim --drain-ack --json` then `bd show --json`, `bd update --notes=`, `bd close`, `runtime drain-ack`), tested against a gc stub script. The claimed task is a session mark, so `done(result)` takes nothing else; a failed close leaves the task claimed and does not drain. - `gchandler.Handler.Exec`: gc run as a session with the identity the server kept of its start; `Run` shares the runner. - `[agents.<name>] tools`, checked at the server per call (PermissionDenied otherwise), and passed to the pod as `ROOMCITY_ROOM_TOOLS` for the host to register. Shapes read from gc's source, not run: that `gc session wait` takes the session from `GC_SESSION_ID` (it does, cmd_wait.go) and that `bd show --json` prints a list of beads. The sandbox run shows them. Open: after `wait` the foreman is nudged that the task closed and reads the worker's notes with `gc bd show`, which asks the owner. A fifth tool that returns the result, or the nudge carrying it, would remove that; not decided here.
server: dispatch, wait, claim and done, the tools that hand work between sessions
All checks were successful
test / changelog (pull_request) Successful in 5s
image / image (pull_request) Successful in 17s
test / go (pull_request) Successful in 1m14s
c347231d0d
HostService gets the four calls. gcwork is the one place that turns each
into gc's commands, with the identity the server kept of the session's
start (gchandler.Handler.Exec, which Run now shares); a claimed task is
the session's mark, so done needs no argument but the result. Which tools
a session has is the agent's `tools` in roomcity.toml; the server refuses
the others whatever the host registers.

The task goes to sling on standard input and the result is --notes=<text>,
so no word of either is read as a flag.

Assisted-By: Claude <noreply@anthropic.com>
server: result, the foreman's read of what a worker's done stored
All checks were successful
test / changelog (pull_request) Successful in 5s
image / image (pull_request) Successful in 21s
test / go (pull_request) Successful in 1m3s
e2744e76ff
After wait the foreman is nudged that the task closed, and would have had
to read the answer with gc bd show, which asks the owner. Result says
whether the task is closed, its state, and the notes done stored; before
the close it says so, not an empty result. Read-only, for the agents whose
tools list it.

Assisted-By: Claude <noreply@anthropic.com>
mikluko force-pushed room-work from e2744e76ff
All checks were successful
test / changelog (pull_request) Successful in 5s
image / image (pull_request) Successful in 21s
test / go (pull_request) Successful in 1m3s
to bf1869a164
Some checks failed
image / image (pull_request) Successful in 16s
test / go (pull_request) Successful in 2m7s
test / changelog (pull_request) Failing after 6s
2026-11-16 10:30:55 +00:00
Compare
mikluko closed this pull request 2026-11-16 10:31:01 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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
mikluko/roomcity!87
No description provided.