Skip to content

Fix/workflow test isolation#191

Closed
Jack-261108 wants to merge 4 commits intoclaude-code-best:mainfrom
Jack-261108:fix/workflow-test-isolation
Closed

Fix/workflow test isolation#191
Jack-261108 wants to merge 4 commits intoclaude-code-best:mainfrom
Jack-261108:fix/workflow-test-isolation

Conversation

@Jack-261108
Copy link
Copy Markdown

@Jack-261108 Jack-261108 commented Apr 8, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Homebrew installation support (brew install claude-code-best)
    • Expanded voice mode to support OpenAI STT API keys in addition to Claude.ai OAuth
    • Automated GitHub release packaging with checksums and Homebrew formula generation
  • Improvements

    • Enhanced terminal output sanitization and truncation detection
    • Improved agent token tracking across message history
    • Refined UI layouts for better text wrapping and display
    • Added validation for tool result outputs
  • Documentation

    • Added Homebrew distribution and installation guidance
    • Documented release and tap synchronization workflows

Jack added 4 commits April 8, 2026 09:32
Improve multiline tool rendering and agent token accounting while removing obsolete WebFetch preflight settings.
Allow voice mode to work with supported API key STT providers in addition to Claude.ai OAuth, and align terminal truncation rendering with actual display behavior.
Add GitHub release and Homebrew tap automation, stabilize the packaged CLI entrypoint, and clean up duplicated build hooks in the publish flow.
Resolve shellcheck issues in the Homebrew sync workflow and isolate provider-related tests from global mocks and locale-dependent state.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR implements end-to-end release automation and distribution infrastructure via GitHub Actions workflows, introduces OpenAI-based STT support for voice mode alongside Anthropic OAuth, refactors tool result validation and terminal output handling, and updates related UI components and agent token tracking.

Changes

Cohort / File(s) Summary
CI/CD and Release Workflows
.github/workflows/ci.yml, .github/workflows/release.yml, .github/workflows/sync-homebrew-tap.yml
Added workflow-lint job to CI; created new release workflow triggering on tag pushes (runs tests, builds, packages artifacts, uploads releases); created Homebrew sync workflow that syncs release formulae to a separate tap repo with PR-based updates and auto-merge support.
Release Packaging and Scripts
scripts/actionlint.ts, scripts/package-release.ts, build.ts
Added actionlint binary cache/download script with checksum verification; added release packaging script generating macOS tarballs, SHA256SUMS, manifest, and Homebrew formula; updated build script to normalize CLI shebang and set executable permissions.
Homebrew Distribution
packaging/homebrew/*, README.md
Added Homebrew formula template and generated formula with macOS ARM64/x86_64 artifacts; added packaging and root README documentation describing release flow, installation, tap setup, and operational notes.
Package.json and Build Configuration
package.json, scripts/postinstall.cjs
Added package:release and lint:workflow scripts; replaced prepublishOnly with prepack; added pre-download check for CLI entrypoint in postinstall.
Voice Mode Provider Selection
src/voice/voiceModeEnabled.ts, src/voice/__tests__/voiceModeEnabled.test.ts, src/commands/voice/index.ts, src/commands/voice/voice.ts, src/hooks/useVoice.ts, src/hooks/useVoiceEnabled.ts, docs/features/voice-mode.md
Replaced auth-only voice gating with provider-availability gating; renamed hasVoiceAuth() to hasAvailableVoiceProvider(); updated error messages and provider labels; removed availability constraint from voice command.
Voice STT Provider Implementation
src/services/voiceStreamSTT.ts, src/services/__tests__/voiceStreamSTT.test.ts
Added OpenAI-based STT support alongside Anthropic OAuth; introduced VoiceSttProvider type, getVoiceSttProvider(), and getVoiceModeAvailability() exports; implemented WAV-based OpenAI transcription path with provider branching in connectVoiceStream(); added comprehensive test suite.
Tool Result Output Handling
src/components/messages/UserToolResultMessage/parseToolResultOutput.ts, src/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx, src/components/messages/AssistantToolUseMessage.tsx, src/components/messages/GroupedToolUseContent.tsx, src/tools/BashTool/UI.tsx
Added validation and parsing utilities for tool results against schemas; refactored Bash multiline command rendering via new renderMultilineCommandLines() helper; updated tool result mapping and validation flows.
Terminal Output Processing
src/utils/terminal.ts, src/utils/__tests__/terminal.test.ts
Added sanitizeCapturedTerminalOutput() for OSC/CSI stripping and carriage-return resolution; introduced getTruncationTerminalWidth() and prepareTruncatedContent() for width-aware truncation; updated isOutputLineTruncated() signature to accept explicit terminalWidth parameter; added comprehensive test coverage.
Terminal-Aware Tool Truncation
src/tools/BashTool/BashTool.tsx, src/tools/PowerShellTool/PowerShellTool.tsx, src/tools/MCPTool/MCPTool.ts, src/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts, src/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts
Updated tool isResultTruncated methods to pass terminal width context via getTruncationTerminalWidth(); changed truncation detection to be width-aware rather than relying on default dimensions.
Permission Request UI
src/components/permissions/BashPermissionRequest/BashPermissionRequest.tsx
Updated Bash command display to use renderMultilineCommandLines() instead of direct tool rendering.
Shell Progress UI
src/components/shell/ShellProgressMessage.tsx, src/components/shell/__tests__/ShellProgressMessage.test.tsx
Added full-width layout properties to progress containers; added test asserting metadata appears on separate line from progress status.
Agent Progress and Tool Display
src/components/AgentProgressLine.tsx, src/tools/AgentTool/UI.tsx
Refactored header rendering with derived labels and flex-based layout; added tool/token statistics display; updated progress grouping based on USER_TYPE environment variable.
Task List Rendering
src/components/TaskListV2.tsx
Refactored recent-completion state tracking into single ref object; replaced stringWidth-based truncation with flex containers using wrap="truncate-end"; updated blocked-task rendering with precomputed text.
Agent Tool Token Counting
src/tools/AgentTool/agentToolUtils.ts, src/tools/AgentTool/AgentTool.tsx, src/tools/AgentTool/__tests__/agentToolUtils.test.ts
Added resolveAgentTotalTokens() to compute totals from message history and tracker; updated finalizeAgentTool() and emitTaskProgress() signatures to accept/use explicit token counts; added test coverage for fallback token resolution.
Built-in Agent Configuration
src/tools/AgentTool/built-in/claudeCodeGuideAgent.ts, src/tools/AgentTool/built-in/exploreAgent.ts
Changed CLAUDE_CODE_GUIDE_AGENT and EXPLORE_AGENT to use model: 'inherit' instead of 'haiku' or conditional selection.
Web Fetch Domain Blocklist Removal
src/tools/WebFetchTool/utils.ts
Removed domain-blocklist preflight logic, checkDomainBlocklist() function, and related error types and caching; simplified getURLMarkdownContent() flow.
Settings Schema
src/utils/settings/types.ts
Removed optional skipWebFetchPreflight field from SettingsSchema.
Test Infrastructure Updates
src/utils/__tests__/formatBriefTimestamp.test.ts, src/utils/model/__tests__/providers.test.ts, src/services/api/grok/__tests__/client.test.ts
Added locale environment setup/teardown for timestamp tests; refactored provider tests to defer dynamic imports and cache mocks; updated Grok client tests to use fetchOverride and await API calls.

Sequence Diagrams

sequenceDiagram
    actor User
    participant GitHub as GitHub Actions
    participant Build as Build Process
    participant Release as Release Asset
    participant Homebrew as Homebrew Tap
    
    User->>GitHub: Push tag v*
    GitHub->>Build: Trigger release workflow
    Build->>Build: Run tests
    Build->>Build: Build artifacts (arm64, x86_64)
    Build->>Build: Generate manifest.json + SHA256SUMS
    Build->>Build: Create Homebrew formula
    Build->>Release: Upload tarballs & metadata
    Note over GitHub,Release: Release published
    GitHub->>Homebrew: Trigger sync workflow
    Homebrew->>Homebrew: Fetch manifest.json
    Homebrew->>Homebrew: Validate checksums
    Homebrew->>Homebrew: Create/update PR with formula
    Homebrew->>Homebrew: Enable auto-merge
    Homebrew->>GitHub: Complete (summary to GITHUB_STEP_SUMMARY)
Loading
sequenceDiagram
    actor User
    participant CLI as Voice Command
    participant Provider as Provider Selector
    participant STT as STT Service
    participant OpenAI as OpenAI API
    participant Anthropic as Anthropic OAuth
    
    User->>CLI: Enable voice mode
    CLI->>Provider: Check available providers
    Provider->>Anthropic: Has OAuth token?
    Provider->>OpenAI: Has API key?
    alt Provider Available
        Provider->>STT: Select provider
        alt Provider is OpenAI
            STT->>STT: Buffer PCM audio
            STT->>STT: Convert to WAV
            STT->>OpenAI: Upload & transcribe
            OpenAI-->>STT: Transcript
            STT-->>User: Final transcript
        else Provider is Anthropic OAuth
            STT->>Anthropic: Connect voice_stream
            Anthropic-->>STT: Real-time transcription
            STT-->>User: Final transcript
        end
    else No Provider
        Provider-->>CLI: unavailable
        CLI-->>User: Configure OAuth or API key
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • KonghaYao

Poem

🐰 Release workflows bound and tight,
OpenAI STT takes its flight,
Token counts now tallied right,
Terminal wrapping crisp and bright,
Homebrew taps sync through the night! 🍻

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'Fix/workflow test isolation' is too vague and does not clearly convey the main changes, which span release workflows, Homebrew packaging, voice mode provider availability, build scripts, and component refactoring. Consider a more descriptive title that reflects the primary focus, such as 'Add release workflow, Homebrew packaging, and voice provider availability support' or identify the most important change if the scope is too broad.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@Jack-261108 Jack-261108 closed this Apr 8, 2026
@Jack-261108 Jack-261108 deleted the fix/workflow-test-isolation branch April 8, 2026 02:35
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.

1 participant