@kaiserlich-dev/pi-queue-picker

Pick between steering and follow-up when queuing messages in pi

Package details

extension

Install @kaiserlich-dev/pi-queue-picker from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@kaiserlich-dev/pi-queue-picker
Package
@kaiserlich-dev/pi-queue-picker
Version
1.0.5
Published
May 3, 2026
Downloads
174/mo · 9/wk
Author
jksr194
License
MIT
Types
extension
Size
25.7 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/queue-picker.ts"
  ],
  "image": "https://raw.githubusercontent.com/kaiserlich-dev/pi-queue-picker/main/assets/preview.png"
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@kaiserlich-dev/pi-queue-picker

A pi extension that lets you choose between Steer and Follow-up when queuing messages while the agent is busy.

What it does

By default, pressing Enter while the agent is working queues your message as a "steer" (interrupts and redirects). This extension adds an interactive picker so you can choose:

  • Steer — interrupt and redirect the agent
  • Follow-up — queue for after the current task finishes

Queued follow-ups are editable in an internal buffer, so you can change mode and order before delivery.

Usage

When the agent is idle, Enter submits normally. When the agent is busy:

  1. Type your message and press Enter
  2. A centered delivery popup appears with Steer and Follow-up options
  3. Tab or ↑↓ to switch between modes
  4. Enter to send with the selected mode
  5. Escape to cancel (restores your text)

The picker remembers your last chosen mode as the default.

Slash commands (for example /model, /settings, /skill:name, or /prompt-template) bypass the picker while busy so interactive command UIs still open normally.

Editing queued messages

Queued messages stay in an editable buffer until the agent finishes. To edit them:

  • Press Ctrl+J or type /edit-queue
  • A floating popup overlay appears showing all buffered queue items (steer + follow-up)
  • ↑↓ to navigate between messages
  • Tab to toggle mode (follow-up ↔ steer)
  • j / k to move a message up/down (reorder)
  • e to edit the selected message in an inline text box
  • d or Delete to remove the selected message
  • Enter to confirm queue changes (or save while editing)
  • Escape to cancel (or exit edit mode)

Messages keep their selected mode and queue order when you confirm. Deleted messages are discarded.

A widget above the editor shows buffered queue items:

  ⚡ Steer: also check the tests
  📋 Follow-up: and update the docs
  ↳ Ctrl+J queue editor · e edit · d delete · j/k move

How delivery works

  • Steer messages are sent immediately (interrupt current task)
  • Follow-up messages are buffered and flushed one at a time when the agent finishes (agent_end event)
  • You can reorder items and toggle mode before they are sent
  • If you change a queued item to Steer in the queue editor while the agent is busy, it is injected immediately after you save
  • If the agent finishes while the picker is shown, the first queued item is flushed immediately after selection

Regression test

Run the steer-injection regression test:

npm run test:regression

This launches pi in tmux with the local extension, reproduces the queue-edit toggle flow, and asserts that changing a queued item to Steer injects it immediately while the agent is still busy.

Install

npm (recommended)

pi install npm:@kaiserlich-dev/pi-queue-picker

git (alternative)

pi install git:github.com/kaiserlich-dev/pi-queue-picker

By default this writes to ~/.pi/agent/settings.json. Use -l to install into .pi/settings.json for a project.

Then restart pi or run /reload.

Development

# Run locally without installing
pi -e ./extensions/queue-picker.ts

Compatibility

Works alongside other extensions that customize the editor (e.g. pi-powerline-footer). Uses the input event API instead of replacing the editor component.

SSH / Mobile Terminals

The picker is automatically disabled over SSH (detected via SSH_TTY/SSH_CONNECTION), since mobile terminal apps like Terminus can't handle the custom TUI component. Messages fall through to the default steer behavior.

To manually disable the picker, set PI_QUEUE_PICKER_DISABLE=1.