commanders: say two things in the chat, and cause the turn yourself
A loop writes to its job panel and nobody reads a job panel, so a watcher that fires overnight has done the work and told no one — which from the owner's side looks the same as not firing. Two messages, no more: what appeared and that it is being handled, then a short report when the work ends. A progress commentary in chat is a notification per step, which is how somebody turns notifications off. The mechanism needs nothing new and no authentication. The child writes its report to a file on the same machine as the same user; the loop inserts a nudge row for its own transcript id over the local Postgres socket; the nudger wakes the conversation within the minute and the commander reads the file and writes the report itself. Facts in a file, judgement in the chat — which is what buys a summary instead of a pasted log tail. Notes the three things that bite: one nudge row per session so overwrite rather than queue, the nudge message is a prompt to yourself and not what the owner reads, and up to a minute late because the nudger polls on a minute. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -209,6 +209,50 @@ Four details the mechanics do not carry, each of which was learned by getting it
|
||||
- **The claim goes before the spawn, not inside the action.** If the action claims its own work, an action
|
||||
that dies before claiming has claimed nothing and will run again.
|
||||
|
||||
# Telling the owner, without a second channel
|
||||
|
||||
A loop writes to its job panel, and nobody reads a job panel. So a watcher that fires while the owner is
|
||||
asleep has done its work and told no one, which from their side is indistinguishable from not firing.
|
||||
|
||||
Say two things in the CONVERSATION, and only two:
|
||||
|
||||
- **When it fires.** One line: what appeared, and that you are handling it. Nothing else — the detail is
|
||||
in the job panel by definition, and repeating it in chat means both places are half-read.
|
||||
- **When the work ends.** A short report: what was done, what was skipped, what went wrong and what the
|
||||
owner has to do about it. "Five servers, nothing to report" is a complete message. So is "four went,
|
||||
one needs a console and here is why".
|
||||
|
||||
Nothing in between. A progress commentary in chat is a notification per step, which is how somebody turns
|
||||
notifications off.
|
||||
|
||||
## How, with nothing new
|
||||
|
||||
You cannot post into your own conversation from a shell loop — you only speak when a turn runs. But you can
|
||||
cause a turn, and both halves of that already exist:
|
||||
|
||||
1. **The child writes its report to a file**, named for its own session id, somewhere under your state
|
||||
directory. Same machine, same user, no authentication to arrange.
|
||||
2. **The loop inserts a row into `nudges`** for your own transcript id, over the local Postgres socket, with
|
||||
a message telling you what happened and where the file is. The nudger ticks every 60 seconds, wakes this
|
||||
conversation, and you read the file and write the report yourself.
|
||||
|
||||
So the shape is: the loop knows the FACTS and puts them in a file; you provide the JUDGEMENT and put it in
|
||||
the chat. It costs one turn per event, which is exactly what buys a summary rather than a pasted log tail.
|
||||
|
||||
Three things about that mechanism, each of which will bite otherwise:
|
||||
|
||||
- **`nudges` holds one row per (user, session), deliberately.** A second schedule for the same conversation
|
||||
produces doubled prompts, so overwrite your pending nudge rather than queueing behind it. Two events in
|
||||
the same minute become one turn covering both, which is the better message anyway.
|
||||
- **The nudge message is a PROMPT you will be handed**, not a notification the owner sees. Write it to
|
||||
yourself: what fired, where the file is, and that you are to report briefly. What the owner reads is
|
||||
whatever you say on that turn.
|
||||
- **Up to 60 seconds late**, because the nudger polls on a minute. Fine for anything a watcher does; if
|
||||
something genuinely needs to be instant, it is not a watcher.
|
||||
|
||||
Once you have spoken, the ordinary chat notification path takes it to the owner's devices — so the phone
|
||||
tap lands in this conversation, with the job panel one step away. Nothing to build for that either.
|
||||
|
||||
# Things that are true and surprising
|
||||
|
||||
- **Its cost line understates.** The recorded cost counts the commander's OWN turns — one row per `result`
|
||||
|
||||
Reference in New Issue
Block a user