Skip to content

feat(agent): ship bounded Pi harness v2 and stabilize embedded Pi - #117

Merged
devnull03 merged 9 commits into
mainfrom
feat/pi-harness-v2
Aug 24, 2026
Merged

devnull03 merged 9 commits into
mainfrom
feat/pi-harness-v2

Conversation

@devnull03

@devnull03 devnull03 commented Aug 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • replace bridge protocol v1 with bounded, schema-once protocol v2 queries, revision-bound cursors, optional capabilities, and draft-only findings
  • add a private one-shot Luau runner with SHA-256 identities, bounded live snapshots, resource limits, file/PDF access controls, and run audit records
  • add compact Pi tools, session memory, scratch-program persistence, context pruning, generated thumbnails, and progressive-disclosure guidance
  • keep expensive query, program, file, PDF, and thumbnail work off the GPUI thread
  • bundle Pi 0.84.2 in dev builds and stabilize its terminal: exact OpenRouter free-router selection, resize redraws, child-process cleanup, and early startup logging
  • fix the Windows Rust 1.98 preview lint while preserving the passing macOS and Ubuntu builds
  • draw the terminal grid in a real monospace face, resolved from the fonts actually installed, with Settings ▸ Agent ▸ Terminal exposing the font and its size in either scope
  • paint each cell background in the same text run as its glyph, so the cursor block and the character it marks stop drifting apart as a line grows
  • resolve the global OpenRouter credential on a background thread and clear a session with Pi’s own /new instead of respawning the process — both were multi-second freezes on the UI thread
  • drop GPUI’s per-frame accessibility tree notice from the session log, which was four fifths of its lines

Related tasks

Closes #102 (Notion ID: 3bd21d32-b13b-8129-b950-cf928a99b8fd)
Closes #103 (Notion ID: 3bd21d32-b13b-8118-aa24-cff96ac72c41)
Closes #109 (Notion ID: 3bd21d32-b13b-81c0-a447-c47d655551ee)

Advances #112 (Notion ID: 3c321d32-b13b-81fb-a62b-dd4cc66aa202). The measured 5k-row before/after audit remains follow-up work, so this PR must not close it.

MCP transport remains intentionally out of scope for #110.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings -A dead_code
  • cargo test --workspace
  • cargo build -p app
  • companion extension: npm run check and npm test
  • direct Pi 0.84.2 resolver check: openrouter/openrouter/free resolves to the literal openrouter/free router

Follow-ups

@devnull03 devnull03 linked an issue Aug 24, 2026 that may be closed by this pull request
Replace the New/Stop/Restart row with a + button beside the Log/Terminal
switcher: click starts a new session, right-click offers Stop and Restart.
The toolbar row keeps only the session status.
@devnull03 devnull03 changed the title feat(agent): add bounded Pi harness protocol v2 feat(agent): ship bounded Pi harness v2 and stabilize embedded Pi Aug 24, 2026
The terminal painted each cell background as an absolutely positioned quad at
8px * column while gpui laid the glyphs out at the resolved font advance. The
two coordinate systems drifted apart linearly, so the cursor block and its
glyph separated further with every column, and every repaint re-tore them.

Fold the background into the cell HighlightStyle so gpui places glyph and
background together, and measure the cell from the resolved text style instead
of assuming 8x16 when sizing the PTY grid.
GPUI narrates every a11y tree update at debug level, one line per frame. In a
recent session that was 633 of 787 lines, burying the entries a pasted bug
report exists to show. Folded into the filter that already drops its sibling
focus notice.
…r it

`monospace` is a CSS generic, not a family any OS ships, so the panel had been
asking for a font that does not exist and silently getting the proportional UI
face. No two columns were the same width. Resolve a face that is actually
installed instead, and let the archivist name their own under Settings ▸ Agent
along with a size.

Everything that has to agree about the grid now reads one function: the styled
text, the cell advance, and the line height all come from `terminal_type`, so a
preference cannot move the glyphs without moving the columns they were counted
into.

Two costs the panel was paying on the main thread go with it. The global
OpenRouter credential is resolved once on a background thread rather than by
spawning Pi twice inside `start` — that was a three-second freeze on every
session start, visible in qrate.log. And a new session now writes Pi's own
`/new` into the running PTY, which clears the conversation in place, rather
than killing the process and cold-starting a replacement.

A resumed session no longer announces itself; the status row is hidden when
there is nothing to say.
@devnull03
devnull03 requested a lite review from Copilot August 24, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@devnull03
devnull03 marked this pull request as ready for review August 24, 2026 15:46
Opens a new line for the bounded Pi harness: agents now talk to a running
qrate over protocol v2, and the embedded Pi terminal reads and performs like
a terminal rather than a text box that happened to hold one.
The notice pointed straight at the GitHub asset, so clicking it started a save
without the reader ever seeing what an unsigned build does on first launch.
Point both it and the About window at the site's download page instead — they
read one field, so neither can drift back to a direct link on its own.

Move the widget from the status bar to the title bar's right group, inboard of
the dock toggles, on the same convention the plugin bar already follows there.
@devnull03
devnull03 merged commit 596655a into main Aug 24, 2026
3 checks passed
@devnull03
devnull03 deleted the feat/pi-harness-v2 branch August 24, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants