Skip to content

Feat/basic config#216

Closed
y574444354 wants to merge 8 commits intoclaude-code-best:mainfrom
y574444354:feat/basic-config
Closed

Feat/basic config#216
y574444354 wants to merge 8 commits intoclaude-code-best:mainfrom
y574444354:feat/basic-config

Conversation

@y574444354
Copy link
Copy Markdown

@y574444354 y574444354 commented Apr 9, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added CoStrict as a new API provider with OAuth login authentication.
    • Introduced CoStrict-specific agent workflows: PlanApply, QuickExplore, ReviewAndFix, StrictPlan, SubCoding, and TaskCheck.
    • Added model selection UI for CoStrict API.
  • Branding & UI

    • Rebranded from "Claude Code" to "CoStrict" across the application.
    • Updated logo styling with new color scheme and simplified design.
  • Chores

    • Version bumped to 4.0.1.

xixingde and others added 8 commits April 7, 2026 17:50
feat: add costrict login provider
- 品牌名从 Claude Code 改为 CoStrict
- 版本号更新为 v4.0.1
- 首页边框、标题、分割线、小人等元素统一改为蓝色
- 简单模式(CondensedLogo)添加蓝色圆角边框
- 小人(Clawd)替换为 CoStrict ASCII art 大字标志
- Feed 标题(Recent activity/What's new)改为蓝色
@y574444354 y574444354 closed this Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75cdf679-ffbf-48f6-ba4d-d3315bf0d81f

📥 Commits

Reviewing files that changed from the base of the PR and between f17b7c7 and c5c6b50.

⛔ Files ignored due to path filters (1)
  • src/components/LogoV2/costrict-logo.png is excluded by !**/*.png
📒 Files selected for processing (28)
  • scripts/defines.ts
  • src/components/ConsoleOAuthFlow.tsx
  • src/components/LogoV2/Clawd.tsx
  • src/components/LogoV2/CondensedLogo.tsx
  • src/components/LogoV2/Feed.tsx
  • src/components/LogoV2/FeedColumn.tsx
  • src/components/LogoV2/LogoV2.tsx
  • src/components/LogoV2/WelcomeV2.tsx
  • src/costrict/provider/auth.ts
  • src/costrict/provider/credentials.ts
  • src/costrict/provider/fetch.ts
  • src/costrict/provider/index.ts
  • src/costrict/provider/modelMapping.ts
  • src/costrict/provider/models.ts
  • src/costrict/provider/oauth-params.ts
  • src/costrict/provider/token.ts
  • src/services/api/claude.ts
  • src/setup.ts
  • src/tools/AgentTool/built-in/costrict/planApply.ts
  • src/tools/AgentTool/built-in/costrict/quickExplore.ts
  • src/tools/AgentTool/built-in/costrict/reviewAndFix.ts
  • src/tools/AgentTool/built-in/costrict/strictPlan.ts
  • src/tools/AgentTool/built-in/costrict/subCoding.ts
  • src/tools/AgentTool/built-in/costrict/taskCheck.ts
  • src/tools/AgentTool/builtInAgents.ts
  • src/utils/model/modelOptions.ts
  • src/utils/model/providers.ts
  • src/utils/settings/types.ts

📝 Walkthrough

Walkthrough

This PR adds comprehensive CoStrict API provider support to Claude Code, including OAuth authentication, token management, model resolution, streaming chat queries, and six new built-in agents designed for a CoStrict-specific development workflow.

Changes

Cohort / File(s) Summary
Version & Branding
scripts/defines.ts, src/components/LogoV2/Clawd.tsx, src/components/LogoV2/CondensedLogo.tsx, src/components/LogoV2/Feed.tsx, src/components/LogoV2/FeedColumn.tsx, src/components/LogoV2/LogoV2.tsx, src/components/LogoV2/WelcomeV2.tsx
Version bumped from 2.1.888 to 4.0.1; UI rebranding from "Claude Code" to "CoStrict" across logo components with updated styling tokens and simplified ASCII rendering.
OAuth & Login Flow
src/components/ConsoleOAuthFlow.tsx
Added CoStrict as selectable login method with new OAuth states (costrict_waiting, costrict_model_select), implemented login flow including state/machineId generation, browser login, token polling, credentials saving, environment variable setup, and model selection UI.
CoStrict Provider Implementation
src/costrict/provider/auth.ts, src/costrict/provider/credentials.ts, src/costrict/provider/fetch.ts, src/costrict/provider/token.ts, src/costrict/provider/oauth-params.ts, src/costrict/provider/models.ts, src/costrict/provider/modelMapping.ts, src/costrict/provider/index.ts
Core CoStrict provider modules implementing OAuth login, credential/token management, custom fetch wrapper with auto-refresh, JWT parsing, model caching, and streaming chat query adapter for OpenAI-compatible API.
Provider Integration
src/utils/model/providers.ts, src/utils/model/modelOptions.ts, src/utils/settings/types.ts, src/services/api/claude.ts, src/setup.ts
Extended APIProvider type to include 'costrict', added provider dispatch logic, model options building, settings schema validation, token validation/refresh during setup, and CoStrict detection from environment/settings.
Built-in Agents
src/tools/AgentTool/built-in/costrict/strictPlan.ts, src/tools/AgentTool/built-in/costrict/planApply.ts, src/tools/AgentTool/built-in/costrict/quickExplore.ts, src/tools/AgentTool/built-in/costrict/subCoding.ts, src/tools/AgentTool/built-in/costrict/reviewAndFix.ts, src/tools/AgentTool/built-in/costrict/taskCheck.ts, src/tools/AgentTool/builtInAgents.ts
Six new CoStrict-specific agents (StrictPlan, PlanApply, QuickExplore, SubCoding, ReviewAndFix, TaskCheck) with detailed Chinese system prompts defining workflow responsibilities, tool restrictions, and execution phases; integrated into agent registry.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConsoleOAuthFlow
    participant AuthModule as auth.ts
    participant Browser
    participant CoStrictServer as CoStrict Server
    participant CredentialsModule as credentials.ts

    User->>ConsoleOAuthFlow: Select CoStrict login
    ConsoleOAuthFlow->>AuthModule: loginCoStrict()
    AuthModule->>AuthModule: generateState()<br/>generateMachineId()
    AuthModule->>Browser: openBrowser(loginURL)
    Browser->>CoStrictServer: User authenticates
    CoStrictServer-->>Browser: Redirect with token
    AuthModule->>CoStrictServer: pollLoginToken()
    CoStrictServer-->>AuthModule: {access_token, refresh_token}
    AuthModule->>CredentialsModule: saveCoStrictCredentials()
    CredentialsModule-->>AuthModule: Saved
    AuthModule-->>ConsoleOAuthFlow: CoStrictCredentials
    ConsoleOAuthFlow->>ConsoleOAuthFlow: Update app state<br/>Set env vars
Loading
sequenceDiagram
    participant App
    participant SetupModule as setup.ts
    participant CredentialsModule as credentials.ts
    participant TokenModule as token.ts
    participant FetchModule as fetch.ts
    participant CoStrictAPI as CoStrict API

    App->>SetupModule: setup()
    SetupModule->>CredentialsModule: loadCoStrictCredentials()
    CredentialsModule-->>SetupModule: credentials
    SetupModule->>TokenModule: isCoStrictTokenValid(credentials)
    alt Token Invalid
        SetupModule->>TokenModule: refreshCoStrictToken()
        TokenModule->>CoStrictAPI: GET /oidc-auth/api/v1/plugin/login/token
        CoStrictAPI-->>TokenModule: {access_token, refresh_token}
        TokenModule->>CredentialsModule: saveCoStrictCredentials(updated)
        CredentialsModule-->>TokenModule: Saved
    end
    SetupModule->>FetchModule: createCoStrictFetch()
    FetchModule-->>App: Wrapped fetch ready
Loading
sequenceDiagram
    participant API as claude.ts
    participant Provider as queryModelCoStrict()
    participant FetchWrapper as createCoStrictFetch()
    participant OpenAIClient as OpenAI Client
    participant CoStrictAPI as CoStrict API
    participant Caller

    API->>Provider: queryModelCoStrict(messages, tools, signal...)
    Provider->>FetchWrapper: Create wrapped fetch
    Provider->>OpenAIClient: new OpenAI({fetch: wrapped})
    Provider->>OpenAIClient: client.chat.completions.create({stream: true})
    OpenAIClient->>FetchWrapper: fetch(request)
    FetchWrapper->>FetchWrapper: Validate/refresh token
    FetchWrapper->>CoStrictAPI: POST /chat/completions
    CoStrictAPI-->>FetchWrapper: Streaming SSE
    FetchWrapper-->>OpenAIClient: Response stream
    OpenAIClient-->>Provider: OpenAI stream events
    loop Each event
        Provider->>Provider: Adapt to Anthropic format
        Provider-->>Caller: yield StreamEvent
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

v6


🐰 Through CoStrict's gates we hop with glee,
OAuth flows and tokens dance so free,
Six new agents chart the proper way,
From strictest plans to reviews that slay!
With models cached and streaming bright,
Claude Code bounds into v6's light!

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

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

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