Skip to content

feat(mastracode): add quiet mode#16771

Merged
abhiaiyer91 merged 25 commits into
mainfrom
feat/mc-quiet-mode
May 19, 2026
Merged

feat(mastracode): add quiet mode#16771
abhiaiyer91 merged 25 commits into
mainfrom
feat/mc-quiet-mode

Conversation

@TylerBarnes

@TylerBarnes TylerBarnes commented May 19, 2026

Copy link
Copy Markdown
Member

Adds a new improved quiet mode as the default MastraCode experience for new installs, with a one-time opt-in prompt for existing users who haven’t picked a preference yet.

It tightens up the quiet-mode tool rendering: compact tool summaries, persistent preview lines, grouped continuation rows, stable path deduping while args stream in, compact task progress, and cleaner spacing around chat/task blocks.

Screenshot 2026-05-18 at 2 26 44 PM

Quiet previews are configurable from settings now too, including turning preview lines off entirely.
Screenshot 2026-05-19 at 8 15 00 AM

Verified with focused MastraCode tests and typecheck while building this branch.

ELI5

MastraCode now has a "quiet mode" that shows cleaner, more compact tool output by default for new users. Existing users get a one-time prompt to try it out. The mode lets you see less clutter in the terminal by showing tool results in a condensed format, and you can customize how many lines of previews you want to see (or hide them entirely).


Overview

This PR introduces a new improved quiet mode as the default MastraCode experience for new installs, with a one-time opt-in prompt for existing users. The implementation includes:

  • Settings Management: New persisted preferences for quietModePreferenceSelected (tracks if user has made a choice) and quietModeMaxToolPreviewLines (configurable preview depth, range 0-8)
  • Compact Tool Rendering: Tool results render with compact summaries, optional wrapped/truncated previews, status-based coloring, and connector/branch logic for consecutive tools
  • Chat Boundary Spacing: New chat spacing infrastructure ensures clean spacing between tool results, user messages, assistant messages, and plans using boundary-aware reconciliation
  • Task Progress Compaction: Task progress component switches to a compressed single-line representation in quiet mode
  • Preview Line Configuration: Settings UI offers selectable options [0, 1, 2, 4, 8] for controlling tool preview lines
  • One-Time Rollout: On startup, existing users without a saved preference are prompted once; new installs default to quiet mode with the preference marked as selected

Key Component Changes

Settings & Onboarding (onboarding/settings.ts):

  • Extended GlobalSettings with onboarding.quietModePreferenceSelected and preferences.quietModeMaxToolPreviewLines
  • Added parsePreferences logic to clamp preview-line values to [0, 8]
  • Implemented one-time rollout that sets quietModePreferenceSelected based on preferences.quietMode for existing users
  • New-install defaults now return quiet mode enabled with preference marked selected

Chat Spacing Architecture (components/chat-spacing.ts, components/chat-boundary-spacer.ts, chat-boundary-reconciliation.ts):

  • Introduced ChatSpacingKind type and ChatSpacingParticipant interface for components to declare their spacing requirements
  • Created ChatBoundarySpacer component that dynamically computes vertical spacing based on neighboring component types
  • Implemented reconcileChatBoundarySpacers to normalize spacing across chat container, handling compact tool grouping and label coloring
  • New insertChatComponentWithBoundarySpacing helper inserts components with proper spacing context

Tool Execution Rendering (components/tool-execution-enhanced.ts):

  • Added quiet mode display mode and configurable preview line limit via ToolExecutionOptions
  • Implemented compact rendering path producing summary line + optional wrapped previews per tool type with syntax highlighting
  • Added compact grouping metadata: getCompactToolGroupKey(), getCompactToolGroupSummary(), setCompactToolContinuation(), setCompactToolHasFollowingContinuation()
  • Added label coloring support: getCompactToolLabelColor(), setCompactToolGroupLabelColor() to color consecutive tool runs
  • New public methods: setQuietModeDisplay(), setQuietPreviewLineLimit(), getChatSpacingKind(), hasQuietStreamingPreview(), isComplete()
  • Refactored tool renderers to centralize padding/line-limit logic; updated updateArgs() to accept optional rebuild flag

Settings UI (components/settings.ts):

  • Added quietModeMaxToolPreviewLines to SettingsConfig and corresponding callback
  • Extended settings to show preview-line selector when quiet mode is enabled, offering values [0, 1, 2, 4, 8]
  • Updated description text to reflect new compact rendering behavior

Task Progress (components/task-progress.ts):

  • Added setQuietMode(enabled) method for switching between expanded/compact rendering
  • New formatQuietTaskLines and formatQuietTaskItem helpers produce compressed single-line-or-wrapping task summaries
  • Quiet mode uses ANSI-safe width calculations and respects line-wrapping boundaries

Message Component Updates (components/user-message.ts, components/assistant-message.ts, components/plan-approval-inline.ts):

  • All message/result components now implement getChatSpacingKind() to declare their chat context
  • Removed unnecessary initial spacer elements; spacing is now managed by ChatBoundarySpacer reconciliation
  • UserMessageComponent supports optional borderColor parameter

Dialog Enhancements (components/ask-question-dialog.ts, modal-question.ts):

  • Added allowCustomResponse and selectedOptionLabel options to support the quiet-mode preference prompt
  • Allows preselecting/displaying a specific dialog option

UI Handlers (handlers/message.ts, handlers/tool.ts, handlers/om.ts, render-messages.ts):

  • Integrated reconcileChatBoundarySpacers() calls after key message/tool updates to maintain consistent spacing
  • When creating new ToolExecutionComponentEnhanced instances, quiet mode is configured via setQuietModeDisplay() and setQuietPreviewLineLimit()
  • OM handlers (buffering, thread title) now skip UI updates when quiet mode is enabled
  • render-messages.ts applies quiet-mode configuration to replayed tool history and skips OM title markers in quiet mode

TUI Setup & State (mastra-tui.ts, setup.ts, state.ts):

  • TUIState now includes quietModeMaxToolPreviewLines field
  • MastraTUI calls showQuietModePreferencePromptIfNeeded() after onboarding, which handles the one-time prompt flow
  • Prompt result is persisted to settings.json with quiet mode enabled/disabled and preview-line limit applied to both settings and in-memory state
  • Chat insertion refactored to use insertChatComponentWithBoundarySpacing() for consistent boundary handling
  • TaskProgressComponent is configured with quiet mode during layout construction

Test Coverage

Settings Tests (onboarding/__tests__/settings.test.ts): Validates quiet mode onboarding defaults, preference selection tracking, preview-line clamping, and rollout behavior for new installs vs. existing users

Quiet Mode Preference Prompt (tui/__tests__/mastra-tui-quiet-mode.test.ts): Verifies the one-time modal flow, settings persistence, and TUI/tool state updates based on user choice

Chat Boundary Spacing (tui/components/__tests__/chat-boundary-spacer.test.ts): Comprehensive tests for spacing computation between different component types, compact tool grouping, label coloring, and boundary reconciliation

Tool Execution Rendering (tui/components/__tests__/tool-execution-enhanced.test.ts): 603-line suite validating quiet rendering for all tool types, compact continuation path streaming, preview-line truncation/wrapping, status-based coloring, and error rendering

Task Progress (tui/components/__tests__/task-progress.test.ts): Tests expanded vs. quiet mode rendering, wrapping behavior, and mode toggling

Message & Handler Tests (tui/handlers/__tests__/message.test.ts, tui/handlers/__tests__/tool.test.ts, tui/handlers/__tests__/om.test.ts, render-messages.test.ts): Updated to filter out chat boundary spacer nodes in assertions; added coverage for quiet-mode tool grouping, spacing insertion on message/tool updates, and OM suppression in quiet mode

Workspace Tool Tests (packages/core/src/workspace/tools/__tests__/edit-file.test.ts): Validates edited line-range reporting in tool results


Implementation Details

Quiet Mode Defaults: New installs default to quiet mode enabled; existing users without a saved preference receive a one-time modal offering to enable quiet mode, defaulting to 2 preview lines

Preview Line Range: Values are clamped to [0, 8]; 0 disables previews entirely

Compact Tool Grouping: Consecutive tool results with the same group key are rendered together with shared labels and optional connector/branch rendering to show continuation flow

Label Coloring: Tool run labels use 'toolTitle' (orange) by default, switching to 'error' (red) if any participant reports an error

Spacing Reconciliation: Chat boundary spacers are recomputed after message streaming, tool updates, and history replay to ensure clean spacing without redundant empty lines

Streaming Support: Partial args stream in without rebuilding tool output; updateArgs() with rebuild=false allows layout to settle before reconciliation


Related Changes

Workspace Tool Updates (packages/core/src/workspace/tools/edit-file.ts): Tool output now includes edited line ranges (e.g., (lines 1-3)) for better clarity

Changesets: PR includes updated release notes for quiet-mode rollout, skill command additions, and signal-content handling improvements

Review Change Stack

TylerBarnes and others added 13 commits May 16, 2026 20:29
Render quiet mode tool calls with per-tool compact summaries so repeated non-shell tools stack without gaps while shell tools keep a bounded output block. Reapply quiet rendering to existing tool components when toggled and normalize spacing around assistant, user, plan, and shell transitions.

Add focused coverage for quiet tool rendering, history replay, and live tool handler behavior, plus a changeset for the mastracode patch.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Move chat boundary spacing into a shared spacer layer so quiet-mode tools and messages use consistent gaps without double spacing. This keeps adjacent compact tool calls touching while preserving one-line transitions to shell tools, messages, and plan UI.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Centralize live chat boundary spacing so quiet tool calls render consistent gaps while streaming. Group adjacent compact tools by tool name and render repeated paths with aligned connector continuations.\n\nCo-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Improve quiet mode rendering by tightening compact tool spacing during live streaming, grouping repeated compact tool output with subtle continuation lines, and hiding noisy observation/title markers.

Add edited line ranges to workspace edit-file results so compact edit summaries can show where replacements happened without reading files during render.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Add persistent quiet-mode preview lines for tool calls so streaming write, edit, grep, list, and view operations show useful progress without expanding full tool boxes.

Tighten compact tool spacing and grouping, keep tool labels orange except failures, show list result counts and previews, reserve input spacing when no task list is present, and make pending user-message spacing match confirmed messages.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Quiet mode previews are now persistent detail lines, so remove the old retained-marquee clearing lifecycle and keep spacing driven by boundary reconciliation.

Also clean up two indentation oddities found during self-review.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Render task progress as a single quiet-mode line to reduce vertical noise while keeping the existing expanded list in normal mode.

Keep task order stable, show progress as a compact dim count, and preserve completed task styling inline.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Render completed and cleared task history through the centralized chat boundary spacer path so they get the expected one-line gap as soon as they enter history.

This prevents the gap from appearing only after a later message triggers spacing reconciliation.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Keep quiet mode task summaries from wrapping individual items and make compact tool continuation paths render only stable connector chunks while streaming. This avoids flicker when repeated file tools share path prefixes.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Add a quiet mode setting for selecting how many compact tool preview lines to show, including a None option that hides previews entirely. Apply the setting to live tool calls, message-streamed tools, and history replay so quiet mode rendering stays consistent.

Also keep continuation connectors accurate when previews are hidden and preserve useful path context for repeated compact view/edit calls.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Default new installs to quiet mode with two compact tool preview lines, while preserving existing users' classic rendering unless they already opted in.

Add a one-time lightweight prompt for existing classic users to choose quiet mode and preview line count without rerunning onboarding. Mark manual quiet mode toggles as an explicit preference so users are not prompted again.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Add a shared CLI highlight theme for tool preview code so unmatched syntax uses the warm argument color instead of bright terminal text.

Render grep and list quiet preview detail lines with the same warm color while keeping compact tool arguments in primary text for readability.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Render line ranges in quiet compact tool summaries with dim styling so path targets match the visual hierarchy of the full tool view.

This keeps filenames prominent while making line numbers less visually loud in view, edit, and continuation summaries.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
@vercel

vercel Bot commented May 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mastra-docs-1.x Ready Ready Preview, Comment May 19, 2026 7:26pm
mastra-playground-ui Ready Ready Preview, Comment May 19, 2026 7:26pm

Request Review

@changeset-bot

changeset-bot Bot commented May 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d35b53a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
mastracode Patch
@mastra/core Patch
@mastra/mcp-docs-server Patch
@internal/playground Patch
@mastra/client-js Patch
@mastra/opencode Patch
@mastra/longmemeval Patch
mastra Patch
@mastra/deployer-cloud Patch
@mastra/deployer-vercel Patch
@mastra/playground-ui Patch
@mastra/react Patch
@mastra/server Patch
@mastra/deployer Patch
create-mastra Patch
@mastra/express Patch
@mastra/fastify Patch
@mastra/hono Patch
@mastra/koa Patch
@mastra/nestjs Patch
@mastra/deployer-cloudflare Patch
@mastra/deployer-netlify Patch
@mastra/temporal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR implements quiet mode as the default for new MastraCode installs with a one-time preference prompt for existing users. It adds configurable tool preview line limits (0–8 lines), introduces chat boundary spacing reconciliation to normalize vertical spacing between chat components, and enables the edit-file workspace tool to report edited line ranges.

Changes

Quiet Mode Rollout & Chat Boundary Spacing

Layer / File(s) Summary
Settings & Onboarding Quiet Mode State
mastracode/src/onboarding/settings.ts, mastracode/src/onboarding/__tests__/settings.test.ts
Add quietModePreferenceSelected and quietModeMaxToolPreviewLines to GlobalSettings. Implement one-time rollout logic that defaults quiet mode on for new installs and applies preference tracking for existing users. Parse and clamp preview line limits to [0, 8] range with fallback to default of 2.
Chat Spacing Model & Boundary Components
mastracode/src/tui/components/chat-spacing.ts, mastracode/src/tui/components/chat-boundary-spacer.ts, mastracode/src/tui/chat-boundary-reconciliation.ts, mastracode/src/tui/components/__tests__/chat-boundary-spacer.test.ts
Define ChatSpacingKind type and ChatSpacingParticipant interface. Implement spacing computation with special handling for consecutive quiet compact tools (zero spacing for same group, quiet-stream preview handling, run-boundary detection). Create ChatBoundarySpacer component and reconcileChatBoundarySpacers() to manage vertical spacing and compact tool grouping metadata across chat history.
Message & Plan Components Spacing Kind
mastracode/src/tui/components/user-message.ts, mastracode/src/tui/components/assistant-message.ts, mastracode/src/tui/components/plan-approval-inline.ts
Add getChatSpacingKind() to user, pending-user, assistant, and plan components. Enhance BorderedBox and user message with optional border color customization. Remove manual spacers that are now managed by boundary reconciliation.
Tool Execution Interface & Types
mastracode/src/tui/components/tool-execution-interface.ts
Add QuietToolDisplayMode and CompactToolLabelColor exported types. Extend IToolExecutionComponent interface with optional methods for quiet display, compact grouping metadata, streaming preview detection, and completion status. Update updateArgs() to accept optional rebuild flag.
Tool Execution Enhanced Quiet Display
mastracode/src/tui/components/tool-execution-enhanced.ts, mastracode/src/tui/components/__tests__/tool-execution-enhanced.test.ts
Implement quiet-mode compact rendering for all tool types with tool-specific preview formatting (view path/range + content, edit line ranges, write_file path/content with truncation/rolling, grep pattern/results, skill name, execute_command with line limit). Add preview line limiting with centralized collapsed-line helpers. Implement compact continuation tracking, group label color derivation, and streaming preview detection. Support continued tool sequences with connector rendering and shared-prefix placeholders.
UI Components & Settings Configuration
mastracode/src/tui/components/settings.ts, mastracode/src/tui/components/task-progress.ts, mastracode/src/tui/components/ask-question-dialog.ts, mastracode/src/tui/modal-question.ts, mastracode/src/tui/components/__tests__/task-progress.test.ts
Update settings UI with quiet mode toggle description and conditional preview-line-limit selector (values 0, 1, 2, 4, 8). Implement setQuietMode() on task progress with compact summary rendering using ANSI-safe wrapping and truncation. Enhance modal dialogs with allowCustomResponse and selectedOptionLabel options for customization.
Message & Tool Handlers with Boundary Reconciliation
mastracode/src/tui/handlers/message.ts, mastracode/src/tui/handlers/tool.ts, mastracode/src/tui/handlers/om.ts, mastracode/src/tui/handlers/__tests__/message.test.ts, mastracode/src/tui/handlers/__tests__/tool.test.ts, mastracode/src/tui/handlers/__tests__/om.test.ts
Integrate reconcileChatBoundarySpacers() into handlers to maintain spacing consistency after UI updates. Apply quiet mode display and preview limits to newly created tool components. Suppress OM buffering and title markers in quiet mode. Update assertions in tests to filter out boundary spacer nodes for stable counts/ordering.
Message Rendering & History Replay with Boundary Spacing
mastracode/src/tui/render-messages.ts, mastracode/src/tui/render-messages.test.ts
Use insertChatComponentWithBoundarySpacing() for task history and child-before-anchor insertion. Implement TaskHistoryComponent with task spacing kind. Reconcile chat boundary spacers after pending mutations and streaming user messages. Apply quiet mode configuration during history replay and skip OM markers in quiet mode. Filter boundary spacers in test assertions.
Settings Commands, TUI State & Initialization
mastracode/src/tui/commands/settings.ts, mastracode/src/tui/state.ts, mastracode/src/tui/setup.ts, mastracode/src/tui/mastra-tui.ts, mastracode/src/tui/__tests__/mastra-tui-quiet-mode.test.ts
Implement settings handlers to persist quiet mode and preview-line changes, update TUI state, refresh task progress quiet mode, and apply changes to rendered tools. Extend TUIState with quietModeMaxToolPreviewLines (default 2). Invoke preference prompt after onboarding and parse/save the chosen preview-depth. Refactor child insertion to use boundary-aware helpers.
Workspace Tool: Edit File Line Range Reporting
packages/core/src/workspace/tools/edit-file.ts, packages/core/src/workspace/tools/__tests__/edit-file.test.ts
Add getEditedLineRanges() to compute formatted line ranges for replacements. Include line range information in edit tool output (e.g., "(lines 1-3)") for both single and replace-all modes.
Changesets
.changeset/*.md
Document quiet mode rollout, skill command feature, signal contents narrowing, workspace tool line ranges, and binary recorder support.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • abhiaiyer91
  • NikAiyer
  • CalebBarnes
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mc-quiet-mode

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mastracode/src/onboarding/settings.ts (1)

509-511: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Legacy auth migration path suppresses the one-time quiet-mode prompt.

When settings.json is absent during migrateFromAuth, this branch clones DEFAULTS (where quietModePreferenceSelected is true) and never applies rollout derivation. Existing users on this path can be marked “already selected” without ever seeing the opt-in prompt.

💡 Proposed fix
   } else {
     settings = structuredClone(DEFAULTS);
+    applyQuietModePreferenceRollout(settings, undefined);
   }

Optionally apply the same fallback in the parse-failure catch branch for consistency.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mastracode/src/onboarding/settings.ts` around lines 509 - 511, The branch in
migrateFromAuth that does `settings = structuredClone(DEFAULTS)` silently
preserves DEFAULTS.quietModePreferenceSelected=true and skips the
rollout-derived opt-in prompt; change this to clone DEFAULTS and then apply the
same quiet-mode rollout derivation used elsewhere (i.e., invoke the helper that
computes/sets quietModePreferenceSelected from rollout data or replicate that
logic) so users on the legacy path get the one-time prompt, and make the same
change in the parse-failure catch branch so both fallbacks derive the rollout
rather than leaving quietModePreferenceSelected pre-set.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@mastracode/src/onboarding/settings.ts`:
- Around line 288-289: The current assignment to maxPreviewLines (using
raw.quietModeMaxToolPreviewLines) can preserve NaN/Infinity and allow huge
values; change the normalization to: parse the incoming value to a finite
integer (e.g., via Number(raw.quietModeMaxToolPreviewLines) and Math.trunc),
check Number.isFinite, and then clamp it into a supported range (e.g., between 0
and a MAX_ALLOWED_PREVIEW_LINES constant you add or an appropriate default like
DEFAULTS.preferences.quietModeMaxToolPreviewLines) falling back to the safe
default when invalid; apply the same finite-integer + clamp logic to the
analogous value handled at the other site referenced (lines 294-295) so both
preview line/char limits are guarded.

In `@mastracode/src/tui/handlers/om.ts`:
- Around line 168-172: Before clearing state.activeBufferingMarker in the
quiet-mode branch, explicitly remove/unmount the existing buffering marker
component to avoid leaving a stale row visible: if state.activeBufferingMarker
exists, call its removal method (e.g., unmount/destroy/remove) on the marker
instance, then set state.activeBufferingMarker = undefined and call
state.ui.requestRender(); update the block around state.quietMode to perform
this removal first (use the actual removal method implemented on the marker
type).

---

Outside diff comments:
In `@mastracode/src/onboarding/settings.ts`:
- Around line 509-511: The branch in migrateFromAuth that does `settings =
structuredClone(DEFAULTS)` silently preserves
DEFAULTS.quietModePreferenceSelected=true and skips the rollout-derived opt-in
prompt; change this to clone DEFAULTS and then apply the same quiet-mode rollout
derivation used elsewhere (i.e., invoke the helper that computes/sets
quietModePreferenceSelected from rollout data or replicate that logic) so users
on the legacy path get the one-time prompt, and make the same change in the
parse-failure catch branch so both fallbacks derive the rollout rather than
leaving quietModePreferenceSelected pre-set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9ae03c42-f9d1-44d6-865f-0b4f0c127227

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab779a and 8d78a71.

📒 Files selected for processing (40)
  • .changeset/fluffy-cities-change.md
  • .changeset/funny-pets-obey.md
  • .changeset/goofy-hoops-win.md
  • .changeset/kind-laws-vanish.md
  • .changeset/quiet-previews-shine.md
  • .changeset/salty-phones-dream.md
  • .changeset/smooth-tools-flow.md
  • .changeset/wacky-geckos-drop.md
  • mastracode/src/onboarding/__tests__/settings.test.ts
  • mastracode/src/onboarding/settings.ts
  • mastracode/src/tui/__tests__/mastra-tui-quiet-mode.test.ts
  • mastracode/src/tui/__tests__/render-messages.test.ts
  • mastracode/src/tui/chat-boundary-reconciliation.ts
  • mastracode/src/tui/commands/settings.ts
  • mastracode/src/tui/components/__tests__/chat-boundary-spacer.test.ts
  • mastracode/src/tui/components/__tests__/task-progress.test.ts
  • mastracode/src/tui/components/__tests__/tool-execution-enhanced.test.ts
  • mastracode/src/tui/components/ask-question-dialog.ts
  • mastracode/src/tui/components/assistant-message.ts
  • mastracode/src/tui/components/chat-boundary-spacer.ts
  • mastracode/src/tui/components/chat-spacing.ts
  • mastracode/src/tui/components/plan-approval-inline.ts
  • mastracode/src/tui/components/settings.ts
  • mastracode/src/tui/components/task-progress.ts
  • mastracode/src/tui/components/tool-execution-enhanced.ts
  • mastracode/src/tui/components/tool-execution-interface.ts
  • mastracode/src/tui/components/user-message.ts
  • mastracode/src/tui/handlers/__tests__/message.test.ts
  • mastracode/src/tui/handlers/message.ts
  • mastracode/src/tui/handlers/om.ts
  • mastracode/src/tui/handlers/tool.test.ts
  • mastracode/src/tui/handlers/tool.ts
  • mastracode/src/tui/mastra-tui.ts
  • mastracode/src/tui/modal-question.ts
  • mastracode/src/tui/render-messages.test.ts
  • mastracode/src/tui/render-messages.ts
  • mastracode/src/tui/setup.ts
  • mastracode/src/tui/state.ts
  • packages/core/src/workspace/tools/__tests__/edit-file.test.ts
  • packages/core/src/workspace/tools/edit-file.ts

Comment thread mastracode/src/onboarding/settings.ts Outdated
Comment thread mastracode/src/tui/handlers/om.ts
Group related PR changes into fewer, clearer changesets so the release notes stay focused and easier to review. Remove the accidental prerelease changeset file and stale recorder changeset that do not match this branch's source changes.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Apply repository formatting and lint auto-fixes so the quiet mode branch passes quality checks.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
@vercel
vercel Bot temporarily deployed to Preview – mastra-playground-ui May 19, 2026 15:51 Inactive
@vercel
vercel Bot temporarily deployed to Preview – mastra-docs-1.x May 19, 2026 15:51 Inactive
@TylerBarnes
TylerBarnes requested a review from CalebBarnes May 19, 2026 15:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@mastracode/src/tui/components/tool-execution-enhanced.ts`:
- Around line 378-390: The preview string is being ANSI-formatted via
formatQuietActivePreview() before wrapping, which can split escape sequences;
instead pass the raw/unformatted preview into wrapPreviewLines() (use the
unhighlighted preview returned by getQuietActivePreview() /
getQuietPreviewLines()), slice the wrapped result, then call
formatQuietActivePreview(line) on each wrapped line before calling truncateAnsi.
Apply the same change to the duplicate logic around the 525–535 region so
wrapping always happens on plain text and highlighting is applied only after
wrapping.
- Around line 320-323: The early return in the method hides non-shell tool
errors by always calling renderCompactTool() when this.quietDisplayMode ===
'quiet' and this.toolName !== MC_TOOLS.EXECUTE_COMMAND; change the guard so
compact rendering only happens when quiet mode AND there is nothing requiring
the detailed UI: check this.validationErrors, this.toolErrorOutput, and
this.expanded, and only call this.renderCompactTool() and return if all three
are falsy (no validation errors, no tool error output, and not expanded). Keep
the original path (allow existing detailed renderers to run) when any of these
are present so errors and expanded state are still shown.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8f04281a-46aa-4078-a96f-78926165820f

📥 Commits

Reviewing files that changed from the base of the PR and between 58b17f4 and 7a98b72.

📒 Files selected for processing (20)
  • mastracode/src/onboarding/__tests__/settings.test.ts
  • mastracode/src/onboarding/settings.ts
  • mastracode/src/tui/__tests__/mastra-tui-quiet-mode.test.ts
  • mastracode/src/tui/__tests__/render-messages.test.ts
  • mastracode/src/tui/chat-boundary-reconciliation.ts
  • mastracode/src/tui/components/__tests__/chat-boundary-spacer.test.ts
  • mastracode/src/tui/components/__tests__/task-progress.test.ts
  • mastracode/src/tui/components/__tests__/tool-execution-enhanced.test.ts
  • mastracode/src/tui/components/assistant-message.ts
  • mastracode/src/tui/components/plan-approval-inline.ts
  • mastracode/src/tui/components/settings.ts
  • mastracode/src/tui/components/tool-execution-enhanced.ts
  • mastracode/src/tui/components/user-message.ts
  • mastracode/src/tui/handlers/__tests__/message.test.ts
  • mastracode/src/tui/handlers/message.ts
  • mastracode/src/tui/handlers/tool.test.ts
  • mastracode/src/tui/handlers/tool.ts
  • mastracode/src/tui/mastra-tui.ts
  • mastracode/src/tui/render-messages.test.ts
  • mastracode/src/tui/render-messages.ts
🚧 Files skipped from review as they are similar to previous changes (16)
  • mastracode/src/onboarding/tests/settings.test.ts
  • mastracode/src/tui/components/user-message.ts
  • mastracode/src/tui/tests/render-messages.test.ts
  • mastracode/src/tui/components/tests/chat-boundary-spacer.test.ts
  • mastracode/src/tui/tests/mastra-tui-quiet-mode.test.ts
  • mastracode/src/tui/handlers/message.ts
  • mastracode/src/tui/chat-boundary-reconciliation.ts
  • mastracode/src/tui/handlers/tool.test.ts
  • mastracode/src/tui/handlers/tests/message.test.ts
  • mastracode/src/tui/components/plan-approval-inline.ts
  • mastracode/src/onboarding/settings.ts
  • mastracode/src/tui/render-messages.ts
  • mastracode/src/tui/components/settings.ts
  • mastracode/src/tui/handlers/tool.ts
  • mastracode/src/tui/render-messages.test.ts
  • mastracode/src/tui/components/tests/tool-execution-enhanced.test.ts

Comment thread mastracode/src/tui/components/tool-execution-enhanced.ts Outdated
Comment thread mastracode/src/tui/components/tool-execution-enhanced.ts
# Conflicts:
#	mastracode/src/tui/handlers/__tests__/om.test.ts

@CalebBarnes CalebBarnes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably shouldn't be deleting other changesets

Restore the unrelated llm-recorder changeset that was accidentally dropped during changeset consolidation.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
@TylerBarnes

TylerBarnes commented May 19, 2026

Copy link
Copy Markdown
Member Author

Probably shouldn't be deleting other changesets

thanks, my MC got a little excited 😅 it had added like 10 changesets and I said "combine them into one" lol

TylerBarnes and others added 2 commits May 19, 2026 12:24
Restore unrelated changesets from main and replace the PR-specific changeset churn with one consolidated changeset for the quiet mode work.

Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
@vercel
vercel Bot temporarily deployed to Preview – mastra-playground-ui May 19, 2026 19:25 Inactive
@vercel
vercel Bot temporarily deployed to Preview – mastra-docs-1.x May 19, 2026 19:25 Inactive
@CalebBarnes

Copy link
Copy Markdown
Member

Probably shouldn't be deleting other changesets

thanks, my MC got a little excited 😅 it had added like 10 changesets and I said "combine them into one" lol

Oh yeah I actually just looked at what was removed and it looks like it was just combining multiple changesets together. All good.

@abhiaiyer91
abhiaiyer91 merged commit ac79462 into main May 19, 2026
54 checks passed
@abhiaiyer91
abhiaiyer91 deleted the feat/mc-quiet-mode branch May 19, 2026 21:11
TylerBarnes added a commit that referenced this pull request May 20, 2026
Had local changes and commits when
#16771 was merged! just styling
tweaks and bug fixes

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5

This PR polishes the TUI "quiet mode": compact tool outputs render more
consistently and follow the active UI color, shell footers and
tokenization behave better (ampersands preserved), spacing/layout jumps
are reduced, and tests were updated to match the rebased behavior.

## Summary

Follow-up refinements to quiet-mode rendering and adjacent TUI behavior
after rebasing onto main. Key focuses are propagating the current mode
color to compact tool displays, expanding and standardizing quiet-mode
previews across many tool types (notably shell, code-like,
browser/process outputs), simplifying spacing logic to avoid layout
jumps, improving subagent insertion/expansion behavior, and addressing
tokenizer/footer issues for shell output. Tests and formatting/lint
fixes were applied.

### Key Changes

- Mode-color propagation
- Added optional IToolExecutionComponent.setCompactToolModeColor(color?:
string) and ToolExecutionOptions.compactToolModeColor.
- New helpers (getCurrentModeColor /
applyCurrentModeColorToRenderedTools / applyQuietModePreference) call
setCompactToolModeColor across commands, handlers, mastra-tui, and
render paths so compact tool displays follow the active mode color.

- Quiet-mode rendering & previews
- Expanded quiet preview formatters and compact-summary routing for many
tools (web search, browser_*, skill*, process/file_stat, code-like
tools, condensed validation/error previews).
- Shell: increased quiet preview tail limit to 15 lines, refactored
footer wrapping and tokenization (preserves standalone ampersands so
background commands and stderr redirects render correctly), and improved
wrapping/highlighting across wrapped lines.
- Compact rendering: tighter integration of quiet preview detail lines,
refined continuation/badge/range rendering, shared-prefix grouping, and
improved path/label detection.

- Subagent insertion & expansion
- SubagentExecutionOptions gained expandOnComplete?: boolean; finish()
respects expandOnComplete (auto-expands when enabled).
- Subagents are inserted using insertChatComponentWithBoundarySpacing to
preserve spacing; collapseOnComplete is kept false and expansion is
driven by quietMode where appropriate.

- Spacing and component stability
- chat-spacing.getSpacingBetweenComponents signature adjusted
(prevPrev/nextNext params now unused) and logic simplified:
quiet-compact-tool groups return 0 spacing only when group keys match,
otherwise 1.
- reconcileToolBoundaries called after creating new tool components;
tool insertion now reconciles boundary spacers to avoid layout jumps.
- IdleCounterComponent.render() simplified to always return at least
[''] to avoid empty-array-driven layout instability.

- Handlers/commands updates
- Applied getCurrentModeColor and mode-color application in
commands/mode, commands/settings, handlers (message, tool, subagent),
render-messages, and mastra-tui so existing rendered tool components
receive updated compact mode colors on mode switches and when quiet
preferences change.

- Tests & formatting
- Large test updates across src/tui to match rebased quiet-mode
semantics (render-messages, chat-boundary-spacer, idle-counter,
subagent-execution, tool-execution-enhanced, and handler tests).
- Commit also includes lint/format fixes applied after quiet shell
footer updates.

### Files of note

- Core rendering & behavior:
src/tui/components/tool-execution-enhanced.ts,
src/tui/components/tool-execution-interface.ts,
src/tui/components/chat-spacing.ts,
src/tui/components/subagent-execution.ts,
src/tui/components/idle-counter.ts.
- Integrations & handlers: src/tui/handlers/{message,tool,subagent}.ts,
src/tui/commands/{mode,settings}.ts, src/tui/mastra-tui.ts,
src/tui/render-messages.ts.
- Tests: many updated under src/tui/components/__tests__ and handlers to
reflect new quiet-mode semantics.
- Commits: included a fix to preserve ampersands in quiet shell footers
and a chore commit to fix lint/formatting.

### Risk & Review Notes

- The new interface method is optional (non-breaking) but is now invoked
broadly—verify that tool components that should accept the compact mode
color implement or safely ignore setCompactToolModeColor.
- tool-execution-enhanced contains substantial behavior changes
(ANSI/color handling, shell footer wrapping/tokenization, compact
continuation rules); prioritize reviewing ANSI/color correctness, shell
footer wrapping/highlighting across wrapped lines (including ampersand
handling), spacing invariants around streaming vs completed components,
and boundary insertion/reconciliation logic.
- Tests are extensive; confirm changes reflect intended rendering
semantics rather than accidental formatting-only differences.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/16807?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
devin-ai-integration Bot added a commit that referenced this pull request May 20, 2026
…nder components

TemporalGapComponent and SystemReminderComponent were missing the
getChatSpacingKind() method introduced by the quiet mode boundary
spacing reconciliation system (PR #16771). Without it, these
components did not participate in the spacing system and could
visually blend into surrounding content in quiet mode.

Add getChatSpacingKind() returning 'system' to both components so
they receive proper boundary spacers from the reconciliation system.

Co-Authored-By: tyler <tylerdbarnes@gmail.com>
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.

3 participants