CLI agent: align pi-tui with other pi-* deps and restore annotation tools - #3336
Merged
Conversation
…ools - Bump @mariozechner/pi-tui from 0.54.0 to 0.70.2 to match the rest of the @mariozechner/pi-* family. The 0.70.x CombinedAutocompleteProvider constructor takes a basePath, which we pass as process.cwd() — this also enables @-mention file autocomplete in the prompt for free. - Wire up prompt history: pi-tui's Editor exposes addToHistory(), so call it on every successful submit. ↑/↓ on an empty editor now recall recent prompts. The site-picker shortcut on ↓ still wins because pi-tui only navigates history forward when already in browse mode. - Drop patches/@mariozechner+pi-tui+0.54.0.patch. Its sole purpose was removing chalk from pi-tui's declared deps, but pi-ai and pi-coding-agent at 0.70.2 also depend on (and use) chalk, so patching pi-tui can no longer keep chalk out of node_modules. - Restore the annotation tools that PR #3328 dropped when it split apps/cli/ai/tools.ts into one-tool-per-file. The /annotate skill calls open_annotation_browser and wait_for_annotations; without them the agent grasps at unrelated MCP tools. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youknowriad
commented
May 4, 2026
| importSiteTool, | ||
| exportSiteTool, | ||
| openAnnotationBrowserTool, | ||
| waitForAnnotationsTool, |
Contributor
Author
There was a problem hiding this comment.
These has been forgotten in the previous PR (GPT 5.5) breaking the /annotate
Collaborator
📊 Performance Test ResultsComparing 3d539eb 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) |
2 tasks
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.
Related issues
How AI was used in this PR
Authored end-to-end with Claude in an interactive session. I drove the high-level decisions (pi-tui bump, deciding the patch was obsolete, opting in to prompt history, restoring the annotation tools) and Claude handled discovery, edits, and verification. Reviewer focus areas:
CombinedAutocompleteProvidernow receivesprocess.cwd()as a basePath — confirm that's the right scope for@-mention file completion.apps/cli/ai/tools/open-annotation-browser.tsandapps/cli/ai/tools/wait-for-annotations.tsmatch the originals (they're byte-identical copies of the pre-Add GPT 5.5 support without modifying the system prompt #3328 versions fromtools.ts, just split per-file).Proposed Changes
@mariozechner/pi-tuifrom0.54.0→0.70.2so it matches the other@mariozechner/pi-*packages (which were already on0.70.2). The newCombinedAutocompleteProviderconstructor takes abasePathargument, so we passprocess.cwd(). This also enables@-mention file autocomplete in the chat prompt for free.EditorexposesaddToHistory(); we now call it on every successful submit (covers both the immediate-resolve and queued-mid-turn paths).↑on an empty editor recalls the most recent prompt. The site-picker shortcut on↓still wins — pi-tui only navigates history forward once you're already in browse mode.patches/@mariozechner+pi-tui+0.54.0.patch. Its only purpose was droppingchalkfrom pi-tui's declared deps. Withpi-aiandpi-coding-agent0.70.2 also depending on (and actually using) chalk, patching just pi-tui can no longer keep chalk out ofnode_modules— the patch became a no-op blocker onnpm install.apps/cli/ai/tools.tsinto one-file-per-tool underapps/cli/ai/tools/, butopen_annotation_browserandwait_for_annotationswere never migrated. The/annotateskill calls those tools by name; without them the agent ends up grabbing at unrelated MCP tools. Re-added asapps/cli/ai/tools/open-annotation-browser.tsandapps/cli/ai/tools/wait-for-annotations.ts, registered intools/index.ts.Testing Instructions
npm install— should complete with no patch errors and chalk pulled in transitively (expected).npm run typecheck— passes.npm test -- apps/cli/ai— 132 tests pass.@and confirm a fuzzy file picker appears.↑in an empty editor — the previous prompt should reappear.↓on an empty editor — site picker still opens./annotateand confirm the agent callsopen_annotation_browserandwait_for_annotations(no "Studio MCP server isn't running" misdiagnosis).Pre-merge Checklist
🤖 Generated with Claude Code