Repository navigation
feat(pi): send reviews to any running Pi, and take notes from Pi - #149
Merged
Merged
Conversation
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
plannotator-tui and Pi sessions can now reach each other: Send goes to any running Pi you pick, and a Pi session can leave notes on the file you have open. The protocol is in
docs/spec-pi-link.md.What the person does
plannotator-tui pi installcopies a one-file extension into~/.pi/agent/extensions/(honoursPI_CODING_AGENT_DIR). Restart Pi or/reload.P(pick-target) opens "send to which Pi?": each live session with its name, folder and busy/idle. Sessions in the review's folder are listed first. Enter makes it the Send target until changed; the last row goes back to the target the review started with.Esends as usual. An idle Pi starts a turn; a busy one queues it, and the footer says "Pi is busy; it reads this next". A Pi that has closed reportspi · <name> has closed; pick another Piand copies the text, like any unavailable target.plannotator_tui_notetool (file,quote?,line?,note). The note lands on the quoted text (nearestlinewhen given) in a plannotator-tui that has that file open. It shows in the rail as💬 <id> · pi · <session>, the footer saysnote from pi · <session>, and the exported feedback addsFrom: pi · <session>under the note's heading.plannotator-tui pi list [--json]andpi send --session <id or name> < filedo the same from a shell.How
<data dir>/clients/plannotator-tui/sessions/{pi,tui}/(Plannotator's own<data dir>/sessionsis taken), folders 0700 and entries 0600, written by rename. Each answers one JSON line on 127.0.0.1 with a 32-byte random token. A refused connection means the entry is stale and it is deleted.src/pi.rs: registry, wire client,send.src/pi/link.rs: this process's entry and a listener thread that hands notes to the event loop over a channel (App::poll_pi, every tick); the loop answersnot_open,quote_not_foundorbusy(while the person is typing a note).src/pi/target.rs:PiSessionas aDelivery.src/app/pi_target.rs: the picker and note placement.Store::credit_lastrecordsauthor/author_nameon the note.src/pi/plannotator-tui.ts, embedded withinclude_str!sopi installalways matches the binary) registers on everysession_start, removes itself onsession_shutdown, tracks busy fromagent_start/agent_settled(falls back toagent_end), and delivers withpi.sendUserMessage(followUpwhen busy).getrandom0.3, already in the lockfile, for the token.Tests
cargo test: 375 pass, including registry parsing and modes, send started/queued, token rewrite retry, stale entries, the listener round trip, note placement by quote/line, refusals, and target switching.node integrations/pi/test.mjs: 53 checks against the real installedpi0.85.1 in--mode rpcwith a fake model and a fake plannotator-tui, fully isolated under/var/tmp.python3 -I integrations/pi/e2e.py: 20 checks with the realpiand the real plannotator-tui binary in a pty: registry entry, a Pi note in the rail and on disk,P→ Enter →Edelivering the review (including the Pi note) to Pi, the busy notice, and the closed-session error. I also ran it with onlyPLANNOTATOR_DATA_DIRset, so both sides find the default registry: 20/20.Not tested: Pi's interactive mode,
/resumeand/fork(same shutdown-then-start path as/new, which is tested), Windows, and Pi older than 0.80.4.Known and left alone: when a long status meets the key help on a narrow footer, the two touch with no space. That predates this change; widening the gap moves existing footer layouts.