Skip to content

Raindev#194

Closed
rainhotel wants to merge 3 commits intoclaude-code-best:mainfrom
rainhotel:raindev
Closed

Raindev#194
rainhotel wants to merge 3 commits intoclaude-code-best:mainfrom
rainhotel:raindev

Conversation

@rainhotel
Copy link
Copy Markdown

@rainhotel rainhotel commented Apr 8, 2026

Summary by CodeRabbit

  • New Features

    • Added support for additional API providers including OpenAI, Gemini, and Grok.
    • Introduced an animated mascot component with continuous ambient animations.
  • UI/Visual Updates

    • Rebranded product identity from Claude Code to Raincode throughout the interface.
    • Updated logo styling and welcome screen design with new visual theming.
    • Enhanced model picker to display provider-specific information and model labels.
  • Tests

    • Added comprehensive test coverage for analytics, model options, and provider functionality.
  • Chores

    • Updated package metadata and CLI command mappings.
    • Code formatting improvements and internal refactoring.

Copilot AI review requested due to automatic review settings April 8, 2026 06:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f160211c-6edc-479f-aec2-05aceb51da7e

📥 Commits

Reviewing files that changed from the base of the PR and between bdea5a2 and 197bdda.

📒 Files selected for processing (19)
  • package.json
  • src/components/LogoV2/AnimatedClawd.tsx
  • src/components/LogoV2/Clawd.tsx
  • src/components/LogoV2/CondensedLogo.tsx
  • src/components/LogoV2/LogoV2.tsx
  • src/components/LogoV2/WelcomeV2.tsx
  • src/components/ModelPicker.tsx
  • src/interactiveHelpers.tsx
  • src/services/analytics/__tests__/config.test.ts
  • src/services/analytics/config.ts
  • src/services/tokenEstimation.ts
  • src/utils/__tests__/sideQuery.test.ts
  • src/utils/fastMode.ts
  • src/utils/logoV2Utils.ts
  • src/utils/model/__tests__/modelOptions.test.ts
  • src/utils/model/__tests__/providers.test.ts
  • src/utils/model/modelOptions.ts
  • src/utils/model/providers.ts
  • src/utils/sideQuery.ts

📝 Walkthrough

Walkthrough

The PR rebrands from Claude Code to Raincode, updating package metadata and CLI commands. UI components are refactored to remove click-driven animations and terminal-specific logic in favor of continuous ambient rendering. API provider support expands to include OpenAI and Grok with corresponding model mapping and service routing changes.

Changes

Cohort / File(s) Summary
Package & Branding
package.json
Package name changed from claude-code-best to @rainhole/rain-code; CLI binaries updated to include rain-code entrypoint; publish config set to public access.
Logo & Animation Components
src/components/LogoV2/AnimatedClawd.tsx, src/components/LogoV2/Clawd.tsx
AnimatedClawd converted from click-driven frame sequences to continuous looping animations with simplified pose cycling. Clawd refactored from fixed composition-based poses to scene-based rendering with color-per-segment support; removed terminal-specific (Apple Terminal) logic; exported RAINCODE_SCENE_WIDTH and RAINCODE_SCENE_HEIGHT constants.
Logo Display & Layout
src/components/LogoV2/CondensedLogo.tsx, src/components/LogoV2/LogoV2.tsx, src/components/LogoV2/WelcomeV2.tsx
Consolidated fullscreen logic; updated branding text from "Claude Code" to "Raincode"; switched animated logo from Clawd to AnimatedClawd; updated color theming from claude to rainbow_blue. WelcomeV2 completely redesigned with new RainbowWord() component and AnimatedClawd showcase; removed large ASCII art blocks and theme/terminal branching.
Analytics Configuration
src/services/analytics/config.ts, src/services/analytics/__tests__/config.test.ts
isAnalyticsDisabled() now checks getAPIProvider() !== 'firstParty' instead of specific env flags; added comprehensive test coverage verifying OpenAI-compatible, Anthropic, and telemetry-disabled scenarios.
Provider & Display Utilities
src/utils/model/providers.ts, src/utils/model/__tests__/providers.test.ts
Added new exported function getAPIProviderDisplayName() that maps provider identifiers to human-readable strings; extended test suite with explicit display-name expectations for all providers.
Model Resolution & Options
src/utils/model/modelOptions.ts, src/utils/model/__tests__/modelOptions.test.ts
Added provider-specific model resolvers (resolveProviderDisplayModel, formatThirdPartyModelLabel) to generate display labels for third-party providers (OpenAI, Gemini, Grok); updated all model-option generators to use provider-specific labels; added test coverage for OpenAI and Gemini model options with environment variable resolution.
API Query & Provider Routing
src/utils/sideQuery.ts, src/utils/sideQuery/__tests__/sideQuery.test.ts
sideQuery now routes requests to OpenAI-compatible handler for openai/grok providers; implements message/tool conversion, response mapping, and structured JSON schema output; added comprehensive test verifying OpenAI routing and response transformation.
Token Estimation & Fast Mode
src/services/tokenEstimation.ts, src/utils/fastMode.ts
Updated token-counting fallback logic to treat OpenAI and Grok as rough-estimation cases alongside Gemini; updated unavailability messaging to reflect expanded provider list.
Interactive Helpers & Utilities
src/interactiveHelpers.tsx, src/utils/logoV2Utils.ts, src/components/ModelPicker.tsx
Added stopCapturingEarlyInput() call before setup dialogs; updated formatWelcomeMessage() to use "Raincode" branding; extended ModelPicker to display provider-specific titles and hints via getAPIProvider and getAPIProviderDisplayName.

Sequence Diagram

sequenceDiagram
    participant Client as Client Request
    participant Provider as Provider Router
    participant OpenAI as OpenAI/Grok Client
    participant Anthropic as Anthropic Client
    participant ModelRes as Model Resolver
    participant Response as Response Mapper

    Client->>Provider: sideQuery(messages, tools, ...)
    Provider->>Provider: getAPIProvider()
    
    alt OpenAI/Grok Provider
        Provider->>ModelRes: resolveOpenAIModel/resolveGrokModel
        ModelRes-->>Provider: provider-specific model
        Provider->>OpenAI: Create client (OpenAI/Grok)
        Provider->>OpenAI: Convert anthropicMessages to OpenAI format
        Provider->>OpenAI: Convert tools & toolChoice to OpenAI
        Provider->>OpenAI: Create completion (with response_format)
        OpenAI-->>Response: OpenAI response
        Response->>Response: Map tool_use from function calls
        Response->>Response: Transform content & stop_reason
        Response-->>Client: BetaMessage (Anthropic format)
    else Anthropic Provider
        Provider->>Anthropic: Create client
        Provider->>Anthropic: Create beta.messages.create
        Anthropic-->>Response: Beta response
        Response-->>Client: BetaMessage
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

v6


🐰 Behold, the rebranding quest is done,
From Claude Code, now Raincode runs,
With OpenAI and Grok in tow,
And Clawd's soft dance, a steady glow!
🌈 Hop along to version 6.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch raindev

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

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 rebrands the CLI UI to “Raincode” and expands “side query” routing to support OpenAI-compatible providers (OpenAI + Grok), alongside provider-aware model labeling and stricter analytics disabling for non-first-party providers.

Changes:

  • Add OpenAI/Grok support to sideQuery() by converting Anthropic-style messages/tools to OpenAI chat-completions requests.
  • Improve provider UX: provider display names + provider-mapped model labels in model options/picker.
  • Rebrand startup/welcome/logo UI strings and visuals from “Claude Code” to “Raincode”, including a new animated scene.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/utils/sideQuery.ts Routes side queries via Anthropic or OpenAI-compatible providers; adds OpenAI response/tool-call normalization.
src/utils/model/providers.ts Adds getAPIProviderDisplayName() for UI-friendly provider names.
src/utils/model/modelOptions.ts Displays resolved provider model names in labels for third-party providers.
src/utils/model/tests/providers.test.ts Reformats tests and adds coverage for provider display names.
src/utils/model/tests/modelOptions.test.ts Adds tests for provider-resolved model labels in options.
src/utils/logoV2Utils.ts Updates welcome message text to Raincode branding.
src/utils/fastMode.ts Updates fast mode messaging to reflect additional providers.
src/utils/tests/sideQuery.test.ts Adds test coverage for OpenAI sideQuery routing and response shaping.
src/services/tokenEstimation.ts Uses rough token estimation for OpenAI/Grok similar to Gemini.
src/services/analytics/config.ts Disables analytics for any non-first-party provider via getAPIProvider().
src/services/analytics/tests/config.test.ts Adds tests for new analytics disablement logic.
src/interactiveHelpers.tsx Stops early-input capture before rendering setup dialogs; formatting updates.
src/components/ModelPicker.tsx Updates model picker title/help text to be provider-aware.
src/components/LogoV2/WelcomeV2.tsx Replaces prior welcome art with centered Raincode welcome + animated header scene.
src/components/LogoV2/LogoV2.tsx Rebrands border/title colors and replaces static Clawd with AnimatedClawd.
src/components/LogoV2/CondensedLogo.tsx Rebrands condensed logo text and adjusts layout math for new scene width.
src/components/LogoV2/Clawd.tsx Replaces old Clawd poses with a new “Raincode” scene renderer + exported dimensions.
src/components/LogoV2/AnimatedClawd.tsx Switches to an ambient animation loop cycling poses (reduced-motion aware).
package.json Renames package/scope and adds rain-code bin + public publish config.

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

'CLAUDE_CODE_USE_BEDROCK',
'CLAUDE_CODE_USE_VERTEX',
'CLAUDE_CODE_USE_FOUNDRY',
'CLAUDE_CODE_USE_OPENAI',
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The env var cleanup list in this suite doesn’t include CLAUDE_CODE_USE_GROK, but getAPIProvider() checks it. If that env var is set in the test runner environment, the “returns firstParty by default” and precedence tests can become flaky. Add it to envKeys so it’s saved/cleared/restored like the others.

Suggested change
'CLAUDE_CODE_USE_OPENAI',
'CLAUDE_CODE_USE_OPENAI',
'CLAUDE_CODE_USE_GROK',

Copilot uses AI. Check for mistakes.
Comment on lines 145 to +150
if (
"production" === 'test' ||
'production' === 'test' ||
isEnvTruthy(false) ||
process.env.IS_DEMO // Skip onboarding in demo mode
) {
return false
return false;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This guard is effectively dead code: 'production' === 'test' is always false and isEnvTruthy(false) is always false. If the intent is to skip onboarding/setup screens in test or via an env flag, this should check process.env.NODE_ENV === 'test' and pass an actual env var string into isEnvTruthy (or remove the guard entirely if it’s not needed).

Copilot uses AI. Check for mistakes.
Comment on lines +164 to +165
const parsed = safeParseJSON(input)
return parsed === null && input.length > 0 ? input : (parsed ?? {})
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

normalizeOpenAIToolInput() treats any safeParseJSON() result of null as a parse failure, but safeParseJSON also returns null for valid JSON like the literal null. That causes valid tool arguments to be returned as the raw string instead of the parsed value. Consider using a parse routine that can distinguish “invalid JSON” vs “valid null” (e.g. a try/catch JSON.parse wrapper), or special-case input.trim() === 'null'.

Suggested change
const parsed = safeParseJSON(input)
return parsed === null && input.length > 0 ? input : (parsed ?? {})
try {
return JSON.parse(input)
} catch {
return input.length > 0 ? input : {}
}

Copilot uses AI. Check for mistakes.
Comment on lines +188 to +216
async function sideQueryViaOpenAICompatibleProvider(
opts: SideQueryOptions,
provider: 'grok' | 'openai',
): Promise<BetaMessage> {
const internalMessages = toInternalMessages(opts.messages)
const systemPrompt = toSystemPrompt(opts.system)
const openaiMessages = anthropicMessagesToOpenAI(
internalMessages,
systemPrompt,
)
const openaiTools = opts.tools
? anthropicToolsToOpenAI(opts.tools as BetaToolUnion[])
: undefined
const openaiToolChoice = anthropicToolChoiceToOpenAI(opts.tool_choice)
const resolvedModel =
provider === 'grok'
? resolveGrokModel(opts.model)
: resolveOpenAIModel(opts.model)

const client =
provider === 'grok'
? getGrokClient({
maxRetries: opts.maxRetries ?? 2,
source: opts.querySource,
})
: getOpenAIClient({
maxRetries: opts.maxRetries ?? 2,
source: opts.querySource,
})
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

sideQueryViaOpenAICompatibleProvider() adds a Grok branch (model resolution + client selection), but the added tests only cover the OpenAI path. Adding at least one Grok-focused test (mocking getGrokClient/resolveGrokModel) would help prevent regressions in the provider-specific wiring.

Copilot uses AI. Check for mistakes.
export function formatWelcomeMessage(username: string | null): string {
if (!username || username.length > MAX_USERNAME_LENGTH) {
return 'Welcome back!'
return 'Welcome to Raincode'
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

formatWelcomeMessage() now uses longer fallback strings (e.g. “Welcome to Raincode”), but LogoV2’s compact-mode logic relies on falling back to a shorter message when the username variant doesn’t fit. Consider keeping the fallback as short as possible (or adding a second, shorter fallback) to avoid wrapping in very narrow terminals.

Suggested change
return 'Welcome to Raincode'
return 'Welcome'

Copilot uses AI. Check for mistakes.
Comment on lines +4 to 8
export type ClawdPose = 'default' | 'arms-up' | 'look-left' | 'look-right';

export const RAINCODE_SCENE_WIDTH = 26;
export const RAINCODE_SCENE_HEIGHT = 5;

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

RAINCODE_SCENE_WIDTH/HEIGHT are used for layout calculations (e.g. condensed logo textWidth), but the scene content is hardcoded below and may not actually match these constants (especially given different poses). If the constants drift from the real rendered width/height, model/billing lines may be truncated unnecessarily or layout may misalign; consider deriving these from the scene data or adding a small helper to compute max stringWidth per pose.

Copilot uses AI. Check for mistakes.
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