Skip to content

feat(pi): show background job progress above editor - #52

Merged
Epsirom merged 1 commit into
mainfrom
feat/pi-editor-status-widget
Oct 9, 2026
Merged

Epsirom merged 1 commit into
mainfrom
feat/pi-editor-status-widget

Conversation

@powerfooI

Copy link
Copy Markdown
Collaborator

Summary

  • Show an automatic, event-driven Braid status widget above Pi's input editor, without requiring repeated /braid commands.
  • Display current node progress, running node IDs, paused gates, and failure/cancellation status. Prioritize up to three active jobs with an overflow count; retain the newest job's final status when idle.
  • Keep /braid as the detailed flow panel and leave RPC/JSON/print modes unchanged.
  • Update the user guides and Unreleased changelog.

Review and fixes

Review caught a live-edit edge case: removing a running node definition does not cancel its admitted execution, but definition-only progress hid that worker and could falsely label the job as paused. Track active executions separately using lifecycle events, keep that tracking internal, and preserve definition-based progress totals.

Add regression coverage for this case, progress during graph edits and loop reruns, width/Unicode/control-sequence safety, non-TUI behavior, concurrent-job overflow, retained results, cancellation, and observer cleanup. Bind concurrent test responses to their node/job identities instead of assuming provider invocation order.

Verification

  • npm run verify passed: 227 core + 97 Pi + 35 DSH tests (359 total), all typechecks, offline examples, and package-consumer smoke verification.
  • Focused widget and execution-control tests passed five consecutive runs (10 tests per run).
  • git diff --check.
  • Interactive Pi/macOS smoke: a completed widget was visibly confirmed above the editor; a live read-only graph returned READY and DONE with pause/resume working.

Scope

No new dependencies, configuration knobs, auto-hide behavior, core API changes, package-version bump, or npm publication. Local .pi/settings.json is excluded from this PR. Cross-platform GitHub Actions checks remain the merge gate.

@powerfooI
powerfooI requested a review from Epsirom as a code owner October 8, 2026 15:38
@Epsirom
Epsirom merged commit e6e5dd3 into main Oct 9, 2026
17 of 18 checks passed
@Epsirom
Epsirom deleted the feat/pi-editor-status-widget branch October 9, 2026 08:53
Epsirom added a commit that referenced this pull request Oct 9, 2026
## What changes

`/braid` accepts an optional node or execution after the job ID, opening
the live panel focused on that one node:

```
/braid job-1 review          → latest invocation of node "review"
/braid job-1 <executionId>   → one exact invocation (e.g. an earlier loop iteration)
```

The focused view refreshes live and shows status, model, loop iteration,
elapsed time, token usage, context size, tool calls, workspace, and the
full output or error. Backspace returns to the whole graph; switching
jobs also returns to it. Tab completes job handles, then that job's node
IDs.

## Why

Until now, the only way to see one node's details in Pi was to ask the
model to call `braid_status`. The panel showed only the whole graph.
This gives people a direct, live view of a single node.

## Details

- The command treats everything after the job ID as the target, because
core accepts any non-empty node ID, including IDs with spaces. It tries
node IDs before execution IDs. IDs with surrounding whitespace, terminal
controls, or a leading double quote use JSON string syntax; Tab inserts
this safely and completion labels display controls as escapes. An
unknown target fails immediately with a hint to open `/braid <jobId>`.
- If a live graph update removes the focused node, the panel says so
instead of throwing.
- `renderNodeResult` is shared with focused `braid_status` results,
which now show the same detail lines. A running node's elapsed time is
computed at the read's observation time, so a saved tool result doesn't
keep counting.
- Live tool-call figures are shown only when they belong to the
execution being displayed. After a worktree is cleaned up, its
checkpoint ref is shown instead of the deleted path, matching the graph
view.

## Verification

- `npm run check`, `npm test` (227 pass)
- `npm run check:pi`, `npm run test:pi` (96 pass), including new tests
for:
- node and execution focus, a running node's progress, and a removed
node
  - Backspace and job switching
  - command parsing and error messages
  - Tab completion, including node IDs with spaces
  - renderer elapsed time, iteration, and workspace refs

This is independent of #52 and applies cleanly on either side of it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Maintainer review fixes

- Escape terminal controls in completion labels and inserted values.
- Preserve exact node IDs with surrounding whitespace or quotes using
JSON string targets, and report malformed quoted targets clearly.
- Add regression coverage using the real Pi SelectList and opening the
completed target.
- Validation after fixes: `npm run verify` passed (227 core, 98 Pi, 35
DSH tests), including type checks, offline examples, and
package-consumer smoke checks. Focused panel/render checks passed (23
tests); `git diff --check` passed.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Chrok <[email protected]>
@Epsirom Epsirom mentioned this pull request Oct 9, 2026
4 tasks done
Epsirom added a commit that referenced this pull request Oct 9, 2026
## Change

Prepare the coordinated Braid 0.3.2 release with Pi editor progress
(#52), the bounded parallel review command (#53), and focused node
panels plus safe exact-ID completion (#54).

Update all three package versions, the integrations' exact core
dependencies, and the workspace lockfile. Publish dated changelog
entries with implementing PR links and author credits, retain the
current host compatibility baselines, and update the roadmap. powerfooI
is an existing contributor via #24; this release has no first-time human
contributors.

## Validation

- `npm ci` and `npm run verify`: 227 core, 113 Pi, and 35 DSH tests (375
total), all type checks, offline examples, and package-consumer smoke
checks.
- `RELEASE_TAG=v0.3.2 node scripts/check-release.mjs`.
- `npm pack --dry-run` inspected for all three packages.
- `git diff --check`.

- [x] Relevant tests and type checks pass.
- [x] User-facing docs and changelog are updated where needed.
- [x] No breaking changes or migration required from 0.3.1.
- [x] Release notes link feature/fix PRs, credit authors, and verify
contributor history.

Publish the matching GitHub release only after required CI passes; the
existing trusted-publishing workflow releases core, Pi, and DSH to npm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants