Skip to content

feat(ai): stream reasoning preview in ai ask#14

Merged
dubscode merged 2 commits intomainfrom
feat/ai-thinking-stream
Feb 21, 2026
Merged

feat(ai): stream reasoning preview in ai ask#14
dubscode merged 2 commits intomainfrom
feat/ai-thinking-stream

Conversation

@dubscode
Copy link
Copy Markdown
Contributor

@dubscode dubscode commented Feb 21, 2026


🥞 DubStack

Copilot AI review requested due to automatic review settings February 21, 2026 22:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds real-time streaming of AI reasoning/thinking preview during dub ai ask commands, improving user experience by showing what the AI is considering. It also enhances command history capture to filter out carriage-return based progress indicators (like spinners) to keep history clean.

Changes:

  • Modified AI streaming to use fullStream API instead of textStream, handling reasoning events (reasoning-start/delta/end) alongside text output
  • Added TTY-aware thinking renderer that displays a spinner with reasoning preview when output is interactive
  • Added normalizeHistoryLine function to filter carriage-return output from command history

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/commands/ai.ts Added WritableLike.isTTY property, updated THINKING_PROVIDER_OPTIONS to include thoughts, switched from textStream to fullStream with event-based handling, added createThinkingRenderer for TTY spinner display
src/commands/ai.test.ts Updated test helpers to support fullStream API, added tests for TTY thinking preview and error stream events
src/index.ts Added normalizeHistoryLine function to filter carriage-return output from history capture, integrated normalization into captureLine

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts Outdated
@dubscode dubscode self-assigned this Feb 21, 2026
@dubscode dubscode merged commit 7e1d54a into main Feb 21, 2026
3 checks passed
@dubscode dubscode deleted the feat/ai-thinking-stream branch February 21, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants