From b0cfd10b80443d3f67d263ff4db177bb53cc90ed Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Fri, 30 Oct 2026 17:27:21 +0200 Subject: reload pi agents on an old extension: versioned extension, control socket, menu item and reload-agents --- README.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c12eebe..56c5a11 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,8 @@ than a poll is still a completion. 1. **Agent hooks** (authoritative): `dingger install pi` installs a pi extension that reports working/blocked/idle over - `~/.local/state/dingger/agent.sock`. Restart running pi agents to load it. + `~/.local/state/dingger/agent.sock`. Running pi agents load it when + reloaded (see "Keeping pi agents on the current extension" below). `dingger install claude` adds a SessionStart hook to `~/.claude/settings.json` (keeping everything else; the original is backed up to `settings.json.bak-dingger`) that reports only Claude's @@ -133,8 +134,33 @@ than a poll is still a completion. manifests, for agents without hooks. All per-pane state lives in tmux pane options (`@agent_state`, -`@dingger_since`, `@dingger_hook`, `@dingger_importance`), so restarting -dingger loses nothing. +`@dingger_since`, `@dingger_hook`, `@dingger_importance`, +`@dingger_extension`, `@dingger_control`), so restarting dingger loses +nothing. + +### Keeping pi agents on the current extension + +When the daemon starts, it updates the installed pi extension if this +dingger's differs (only its own file, which says so on its first line). +Running agents keep the one they loaded, and report its version. While +some run an old one, the menu bar menu offers **Reload N Agents on an Old +Extension**; `dingger reload-agents` does the same. Each agent reloads +(pi's `/reload`) when: + +- it is idle (done included: it stays done), +- it is not on screen, where you may be typing into it, +- and its input box is empty: the extension checks this itself, at the + moment it reloads, so nothing you type is lost or sent. + +The others reload once they are; the request stays until all are, or the +daemon restarts. dingger sends no keystrokes: it asks the extension over a +socket of its own (`~/.local/state/dingger/pi--.sock`), and the +extension runs the reload as a command (`/dingger-reload`, which you can +also type). A reload also resets pi's other extensions: a pending alarm +is lost, MCP servers reconnect. + +An agent on an extension from before this (it reports no version) takes +no requests: the menu says how many need `/reload` by hand, once. The pi extension's reports carry the agent's importance. Other pi extensions can follow it on pi's event bus: `dingger:importance` with @@ -149,6 +175,7 @@ dingger status # agents in priority order dingger focus [--pane ID] # jump to an agent (default: the top waiter) dingger importance [LEVEL] # an agent's importance: high, normal, low dingger unread [--pane ID] # mark an idle agent unread (done again) +dingger reload-agents # reload pi agents on an old extension dingger install pi # install the pi state-reporting extension dingger install claude # report Claude Code sessions, for restore dingger install zsh # record typed command lines, for restore @@ -215,7 +242,8 @@ daemon of its own, with a fake local model (`tests/fake-model.py`) and its own pi agent directory: no network, no credentials, your pi untouched. It covers identification, the extension's state and session reports, a turn, `/reload`, an extension's blocked event, screen detection without the -extension, restore, and exit. To try a release without installing it: +extension, restore, reloading an agent on an old extension (and refusing +while busy or with a draft), and exit. To try a release without installing it: `npm install --prefix /tmp/pi-next @earendil-works/pi-coding-agent@` (through `sfw`), then `tests/pi-live.sh /tmp/pi-next/node_modules/.bin/pi`. -- cgit v1.2.3