Repository navigation
fix(pi): keep extension status in one row per key - #760
Conversation
Pi extensions set footer status with setStatus(key, text), and Pi replaces that slot on every call. MonoCode appended each call as a new transcript row, so pi-caveman's animated status added a row per frame, 37 in one 15-second turn. A status event can now carry a key. A keyed status updates its row in the current turn, an empty text removes it, and the next turn starts a new row. The Pi adapter keys setStatus by its statusKey; notify and unkeyed status rows behave as before.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughPi extension status requests can include a key. The harness forwards that key and updates the matching status row after the latest user block. Unkeyed status events continue to append status rows. ChangesKeyed status updates
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant PiExtensionUiRequest
participant parseExtensionUiRequest
participant handleExtensionUi
participant applyHarnessEvent
PiExtensionUiRequest->>parseExtensionUiRequest: setStatus request with statusKey
parseExtensionUiRequest->>handleExtensionUi: parsed request with statusKey
handleExtensionUi->>applyHarnessEvent: keyed status event
applyHarnessEvent->>applyHarnessEvent: update matching row after latest user block
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The status-row change appears ready to merge after normal checks; no actionable risk remains identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected change affects displayed extension statuses, not permissions or tool access. No introduced security issue was established, but status identity after recovery and across late updates is not fully preserved or established. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@Erickzao thank you. Looks good to me! |
Pi extensions set footer status with setStatus(key, text), and Pi replaces that slot on every call. MonoCode appended each call as a new transcript row, so pi-caveman's animated status added a row per frame, 37 in one 15-second turn. A status event can now carry a key. A keyed status updates its row in the current turn, an empty text removes it, and the next turn starts a new row. The Pi adapter keys setStatus by its statusKey; notify and unkeyed status rows behave as before. (cherry picked from commit b74e803)
What changed
Before: a Pi extension that calls
setStatusadded a new transcript row on every call. Pi treatssetStatus(key, text)as a footer slot it replaces each time, so an animated status like pi-caveman's spinner turned into a wall ofcaveman level: …rows. One 15-second turn with real Pi and pi-caveman left 37 of them.After: each status key gets one row per turn. Later frames update that row in place, an empty status removes it, and the next turn starts a new row.
notifyand statuses without a key still append, as before.How:
statusharness event takes an optionalkey.applyHarnessEventupdates the row with that key in the current turn, or appends one, and stores the key on the block asstatusKey. Unkeyed statuses still go throughappendStatus.statusKeyfromsetStatusrequests and sends keyed status events, including empty ones so a cleared slot disappears. The ANSI stripping is unchanged.Why
Fixes #743.
The flood came from mapping a replace-in-place UI call onto an append-only transcript. Keying the row keeps the latest status visible, the way Pi's footer shows it, without dropping extension status altogether.
UI
Before, one turn with pi-caveman's animated status, the status rows expanded:
After, the same turn keeps one row with the last frame:
The screenshots use real Pi 0.73.1 with pi-caveman 1.0.8 in a demo project, with a local mock model answering slowly so the status animates. The prompt is the one from the issue.
Checklist
npm run check. It passes in CI on macOS, Ubuntu, and Windows: 4231 web tests, 5 of them new, tsc, cargo fmt, clippy, and 473 to 539 Rust tests depending on the platform. Locally, the harness tests and tsc pass.Tested on Windows 11 in the app, before and after the change, with the setup above. macOS and Linux were only checked by CI.
Summary by CodeRabbit