feat(cli): add /btw slash command for ephemeral side questions#2371
feat(cli): add /btw slash command for ephemeral side questions#2371
Conversation
Allow users to ask quick "by the way" questions that use the current conversation context but don't pollute the main conversation history. Closes #2370 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add pendingItem conflict guard to prevent overwriting other operations - Use finally block to ensure setPendingItem(null) is always called - Wrap "Thinking..." with t() for i18n support - Remove unnecessary type assertion, use typed variable instead Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📋 Review SummaryThis PR introduces a 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
- Add ACP mode support with stream_messages async generator - Add non-interactive mode support with simple message return - Add wrap="wrap" to Text components for long text handling - Extract askBtw helper to reduce duplication across execution modes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove redundant null check by passing the already-validated client and model to the helper function instead of re-extracting them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
…ommand
Extract repeated error formatting into formatBtwError helper, remove
no-op marginTop={0}, and add comprehensive test coverage for all three
execution modes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explicitly pass tools:[] to generateContent to prevent tool invocation in side questions. Add model undefined guard for defensive safety. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eSyntax incompatibility The @anthropic-ai/sdk package's type exports are not compatible with TypeScript's verbatimModuleSyntax option when using NodeNext module resolution. Define the stream event types locally to avoid the import error. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Revert tools:[] to empty config {} to avoid provider compatibility
issues. Empty tools array is truthy and gets passed through to API
requests, which can cause errors on some providers. Omitting the
tools field entirely achieves the same effect (no tool access).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7611683 to
b1b5f72
Compare
Run the /btw API call as fire-and-forget in interactive mode so the main conversation is not blocked while waiting for the answer. The action now returns immediately after setting the pending item, and the background promise updates the UI when the answer arrives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ef4b083 to
1b651d5
Compare
Replace broad \s+} and \s+] regexes with a narrower pattern that only
strips whitespace before closing braces/brackets when preceded by a
JSON value terminator (", digit, ] or }). Prevents mangling string
values like "hello }" which contain whitespace before braces.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
/btwslash command that lets users ask quick side questions using the current conversation context, without affecting the main conversation historyBtwMessageUI componentCloses #2370
Test plan
/btw <question>and verify the answer appears withbtw>prefix styling/btwwithout arguments and verify error message is shown/btwrequest and verify it cancels cleanly/btwappears in/helpcommand listnpx tsc --noEmit --project packages/cli/tsconfig.jsonTLDR
Dive Deeper
Reviewer Test Plan
Testing Matrix
Linked issues / bugs