Let take_screenshot skip chat display for internal verification captures - #4097
Conversation
📊 Performance Test ResultsComparing 087c1d5 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
| }, | ||
| "bin": { | ||
| "pi-ai": "./dist/cli.js" | ||
| "pi-ai": "dist/cli.js" |
There was a problem hiding this comment.
I am not sure what are these changes so just leaving the comment to flag this 😅
There was a problem hiding this comment.
Nice catch! 🙌 Removed!
Actually, now that I am thinking to when I was testing it, I had a mix of both: sometimes it showed One solution might be to ensure that it always takes and displays screenshots at the beginning of the session and at the end of the session |
Reconciles the July 6–10 trunk sync: adopts trunk's productionized screenshot/theme tooling (#3982/#4097), grafts the copy-button (#4113), edit-message (#4094), and inline chat artifacts into the redesigned conversation views, keeps the merged Connector surface over trunk's menu-action wiring (#4085), and keeps the blueprint-selector deletion.



Related issues
How AI was used in this PR
Implemented and tested with Claude Code, based on a confirmed finding from a multi-agent review of #3982; human-reviewed before opening.
Proposed Changes
Since #3982, every
take_screenshotcapture is automatically shown to the user as an inline chat artifact. That is right for deliberate captures, but the agent also screenshots constantly for its own eyes — the visual-polish loop alone takes up to 5 verification passes per page, and a light/dark × desktop/mobile check produces 4 images per call. Iterative design sessions flood the conversation with near-identical screenshots the user never asked for, and each one is persisted in the session transcript. (The previous presentation rule's "Do not present every internal verification screenshot" guidance was lost in the #3982 rewrite, and the model had no mechanism to comply with it anyway.)This PR gives the agent that mechanism: an optional
displayinput ontake_screenshot(defaulttrue, so current behavior is unchanged). Passingdisplay: falsekeeps the capture out of the chat while the model still receives the image for its own visual verification, and the presentation rule now tells the agent to use it while iterating so users only see deliberate milestone captures.Testing Instructions
npm test -- apps/cli/ai/tests/tools.test.ts apps/cli/ai/tests/system-prompt.test.ts packages/commonnpm run typecheckPre-merge Checklist
🤖 Generated with Claude Code