pi-percentagebar0.1.0
Agent-reported whole-task progress and estimated wall-clock time remaining for Pi.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-percentagebar
A small Pi extension that shows agent-reported progress for the whole requested task, plus estimated wall-clock time remaining, in the footer:
[======----] ~65% · ~4m left
No Jev, extra model requests, dedicated reporting tool, or runtime dependencies. The working agent supplies estimates through structured text. There is no accuracy or confidence field.
Use
From this directory, try it for one Pi invocation:
pi -e ./index.ts
Or install the local package, then reload Pi with /reload:
pi install /absolute/path/to/pi-percentagebar
Tested against Pi 1.3.0. Requires its structured prompt sections, lifecycle events, and footer status API. Display and prompt instructions are enabled only in the interactive terminal (TUI), not print, JSON, or RPC mode. No personal settings are changed until you explicitly install it.
How reports work
The extension adds instructions to the agent's system prompt. The agent is asked to append a terminal fenced block to each assistant message, including messages before tool calls:
{"percent":65,"remainingSeconds":240}
percent: integer from 0 to 100, for all requested work including tests and fixes.remainingSeconds: positive integer for estimated remaining wall-clock seconds, ornullwhen unknown or waiting for input.- Completion must explicitly report
{"percent":100,"remainingSeconds":0}in a successfully completed assistant response. A response ending is not proof of task completion. - These must be the only two JSON fields. Malformed, incomplete, inconsistent, and out-of-range reports are ignored. Only assistant text is parsed, never user messages, thinking, or tool results.
Reports are read when each assistant message finishes. The last valid report drives the footer; a one-second timer updates the countdown, not the percentage. If the estimate expires, the footer shows ETA overdue rather than inventing progress or declaring completion.
Progress blocks are hidden from assistant replies in the interactive transcript, including while streaming. A display-only Markdown transformer leaves raw session history and model context intact, so parsing and task continuity still work. User messages, thinking, and examples followed by explanatory prose are not changed. Missing reports show Progress: estimating… until a valid report arrives, or retain the last valid report if one exists.
Task boundaries and interruptions
The agent is instructed to keep tracking the same task across related follow-ups and reset its estimate for an unrelated new request. The extension cannot independently infer task boundaries or verify the agent's estimate.
- Progress survives multiple responses within the current live session.
- When the agent settles without explicitly completing the task, the footer says
pausedand clears the ETA. Abort/error messages showinterrupted, not completion. - A blocking extension dialog shows
waitingand invalidates the ETA. A new report is required after work resumes. - A completed report clears when another run begins.
- Reloading, restarting, changing sessions, or navigating the session tree clears the display and timers. No historical tracking or persisted progress state is added; fresh reports rebuild the display.
- The extension does not force additional turns or retry missing reports. If the model ignores instructions, estimates will be missing or stale.
Percentages and time can move backward when the agent discovers more work. Waiting for user input has no predictable wall-clock duration. The displayed values are estimates, not measured accuracy or guarantees.
Development
npm install
npm run check
The checks include strict TypeScript checking, parser validation, fake-clock lifecycle/countdown tests, streaming display-filter regression tests, non-interactive mode tests, and a smoke test using Pi's actual extension loader. They do not test a live model's reporting compliance or estimation accuracy.