Skip to content

202604122033 qwen3.6-plus 1M的上下文窗口 7 个 TypeScript 类型错误已修复#250

Open
chenwangnec wants to merge 8 commits intoclaude-code-best:mainfrom
chenwangnec:main
Open

202604122033 qwen3.6-plus 1M的上下文窗口 7 个 TypeScript 类型错误已修复#250
chenwangnec wants to merge 8 commits intoclaude-code-best:mainfrom
chenwangnec:main

Conversation

@chenwangnec
Copy link
Copy Markdown

@chenwangnec chenwangnec commented Apr 12, 2026

202604122033
qwen3.6-plus 1M的上下文窗口
7 个 TypeScript 类型错误已修复

Summary by CodeRabbit

  • New Features

    • Added Alibaba Bailian Coding Plan as a new authentication option with custom API configuration form
    • Extended support for additional third-party LLM models with expanded context windows
  • Bug Fixes

    • Fixed issue where recent activity failed to load
  • Documentation

    • Added terminal UI rendering documentation covering layout modes and display behavior

20260410启动时边框时有时无"问题的原因和修复方案
No recent activity" 问题的原因分析和修复记录
配置阿里云百炼 Anthropic 兼容端点。已自动映射 Claude 三大模型家族到百炼模型
qwen3.6-plus 1M的上下文窗口
7 个 TypeScript 类型错误已修复
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

📝 Walkthrough

Walkthrough

Added documentation on terminal UI rendering behavior, introduced Alibaba Coding Plan OAuth flow with form-based configuration, enhanced LogoV2 component with theme-aware borders and disabled condensed mode, refactored activity loading to run unconditionally with error handling, and expanded model support to include Qwen models with 1M context window capability.

Changes

Cohort / File(s) Summary
Documentation
docs/ui-rendering.md
New guide documenting Ink-based terminal UI rendering modes, LogoV2 component tree structure, border rendering with rounded style and purple claude color, and troubleshooting notes including permanent disabling of condensed mode and unconditional activity loading.
OAuth Flow Integration
src/components/ConsoleOAuthFlow.tsx
Added new alibaba_coding_plan OAuth path with dedicated form for Anthropic-compatible Aliyun Bailian settings, including base URL and API key validation, tab-based field switching, environment variable configuration, and persistent settings storage.
UI Component Enhancements
src/components/LogoV2/CondensedLogo.tsx, src/components/LogoV2/LogoV2.tsx
Updated CondensedLogo with theme-aware styling, border rendering configuration with title text, and adjusted CWD display logic; hardcoded condensed mode to disabled in LogoV2 and refactored Channels notice rendering to use extracted component with stricter null checks.
Activity Loading Logic
src/setup.ts
Decoupled recent activity loading from release notes check by invoking checkForReleaseNotes() as non-awaited side effect and unconditionally awaiting getRecentActivity() with added error handling and logging.
Model Support Expansion
src/utils/context.ts
Extended modelSupports1M to recognize Qwen models and updated getContextWindowForModel to independently check 1M capability, returning fixed 1M context window for newly supported models.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConsoleOAuthFlow
    participant SettingsService
    participant Environment

    User->>ConsoleOAuthFlow: Select Alibaba Coding Plan
    ConsoleOAuthFlow->>ConsoleOAuthFlow: Render form (baseUrl, API key, models)
    User->>ConsoleOAuthFlow: Enter settings & submit
    ConsoleOAuthFlow->>ConsoleOAuthFlow: Validate baseUrl with URL()
    ConsoleOAuthFlow->>SettingsService: Set ANTHROPIC_* env variables
    SettingsService->>SettingsService: updateSettingsForSource('userSettings')
    SettingsService-->>Environment: Persist configuration
    ConsoleOAuthFlow-->>User: Transition to success or error state
Loading
sequenceDiagram
    participant Setup
    participant ReleaseNotes
    participant Activity
    participant Logger

    Setup->>ReleaseNotes: checkForReleaseNotes() [non-awaited]
    ReleaseNotes-->>ReleaseNotes: Cache fills asynchronously
    Setup->>Activity: getRecentActivity() [awaited]
    Activity-->>Activity: Load recent activity
    Activity-->>Setup: Return activity data
    alt Activity Load Fails
        Setup->>Logger: logError(Failed to load recent activity)
    end
    Setup-->>Setup: Continue regardless
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • KonghaYao

Poem

🐰 Hops with glee through Ali's new gate,
Rounded borders in purple state,
Qwen models bloom, context stretched wide,
Activities flow with no release-notes' tide,
A rabbit's code, by borders made bright!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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 title references qwen3.6-plus 1M context window and TypeScript fixes, which match the actual changes in src/utils/context.ts and other files, but it's written in Chinese and uses a timestamp prefix that obscures the main change. Rewrite the title in English with a clear, concise summary of the primary change, such as 'Add qwen3.6-plus 1M context window support and fix TypeScript type errors' without the timestamp prefix.
✅ 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

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

⚠️ Outside diff range comments (1)
src/components/ConsoleOAuthFlow.tsx (1)

19-19: ⚠️ Potential issue | 🔴 Critical

Unused import: fi from zod locales.

This import is not used anywhere in the file and appears to be accidentally added. It imports the Finnish locale from Zod, which is unrelated to the OAuth flow functionality.

🐛 Proposed fix: Remove unused import
-import { fi } from 'zod/v4/locales'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/ConsoleOAuthFlow.tsx` at line 19, Remove the unused Finnish
locale import from Zod: delete the import statement that brings in the symbol
"fi" from "zod/v4/locales" in the ConsoleOAuthFlow module since it is not
referenced; ensure no other code depends on "fi" and run a quick lint/TypeScript
check to confirm the unused-import warning is resolved.
🧹 Nitpick comments (6)
src/components/ConsoleOAuthFlow.tsx (2)

1416-1419: Consider avoiding as any type assertions.

The coding guidelines specify using as unknown as SpecificType or supplementing the interface instead of direct as any casts. However, this pattern is consistent with other platform flows in this file (custom_platform, openai_chat_api, gemini_api), so this is a systemic issue rather than specific to this change.

♻️ Suggested approach for type-safe settings update

Define a proper type for the settings object:

interface PlatformSettings {
  modelType: 'anthropic' | 'openai' | 'gemini'
  env: Record<string, string>
}

const { error } = updateSettingsForSource('userSettings', {
  modelType: 'anthropic',
  env,
} as unknown as SettingsJson)

Or extend the SettingsJson type to include modelType and env properties if they're valid fields.

As per coding guidelines: "Use as unknown as SpecificType double assertion or supplement interface instead of direct as any type conversions"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/ConsoleOAuthFlow.tsx` around lines 1416 - 1419, The code uses
unsafe `as any` casts when calling updateSettingsForSource('userSettings', {
modelType: 'anthropic', env }), so replace the `as any` with a proper typed
assertion or extend the settings type: define or reuse a
SettingsJson/PlatformSettings type that includes modelType and env (e.g.,
interface PlatformSettings { modelType: 'anthropic'|'openai'|'gemini'; env:
Record<string,string> }) and call updateSettingsForSource('userSettings', {...}
as unknown as SettingsJson) or update the SettingsJson definition to include
those fields; update the invocation in ConsoleOAuthFlow (the block around
updateSettingsForSource) to use the new type-safe assertion instead of `as any`.

1504-1517: Inconsistent UI pattern: cursor indicator differs from other flows.

The Alibaba flow adds a <Text color="claude">▌</Text> cursor indicator (line 1516) that doesn't appear in the custom_platform, openai_chat_api, or gemini_api flows. This creates visual inconsistency across platform configuration UIs.

Consider either:

  1. Removing this cursor indicator to match other flows
  2. Adding it to all platform flows for consistency
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/ConsoleOAuthFlow.tsx` around lines 1504 - 1517, The Alibaba
flow renders an explicit cursor indicator with <Text color="claude">▌</Text>
while other flows (custom_platform, openai_chat_api, gemini_api) do not, causing
a UI inconsistency; either remove that cursor node from the Alibaba block
(around the TextInput using alibabaInputValue, alibabaInputCursorOffset,
handleAlibabaEnter) or add the same cursor indicator to the other platform flow
components so all platform forms use the same visual cursor pattern—pick one
approach and apply it consistently across the components that render their
TextInput fields.
src/components/LogoV2/LogoV2.tsx (4)

303-303: Minor formatting inconsistency.

Line 303 appears to have no leading indentation compared to surrounding JSX. This may cause linting issues.

-{ChannelsNotice && <ChannelsNotice />}
+        {ChannelsNotice && <ChannelsNotice />}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/LogoV2/LogoV2.tsx` at line 303, The JSX line rendering the
ChannelsNotice component is mis-indented; adjust the indentation of the
expression rendering ChannelsNotice (the line containing "{ChannelsNotice &&
<ChannelsNotice />}") to match the surrounding JSX block in the LogoV2 component
so it conforms to the file's existing indentation style and fixes linting
complaints.

208-210: Redundant non-null assertion.

On line 210, config.oauthAccount!.organizationName uses a non-null assertion, but the guard on line 208 already checks both oauthAccount and organizationName for null. TypeScript should narrow the type, making ! unnecessary. Line 457 handles this correctly without the assertion.

♻️ Suggested fix
-            {!process.env.IS_DEMO && config.oauthAccount?.organizationName != null && (
-              <Text dimColor>
-                Message from {config.oauthAccount!.organizationName}:
-              </Text>
+            {!process.env.IS_DEMO && config.oauthAccount?.organizationName != null && (
+              <Text dimColor>
+                Message from {config.oauthAccount.organizationName}:
+              </Text>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/LogoV2/LogoV2.tsx` around lines 208 - 210, The JSX uses a
redundant non-null assertion on config.oauthAccount!.organizationName even
though the surrounding conditional already checks
config.oauthAccount?.organizationName; remove the bang and reference
config.oauthAccount.organizationName (or keep the safe optional access) inside
the Text so TypeScript's control flow narrowing handles it (update the usage in
LogoV2's render where config.oauthAccount?.organizationName is guarded).

135-136: Dead code from permanently disabled condensed mode.

Setting isCondensedMode = false and if (false) creates ~60 lines of unreachable code (lines 178-241). While the documentation indicates this is intentional for "permanently disabled" condensed mode, consider either:

  1. Removing the dead code entirely if condensed mode won't return
  2. Adding a // TODO: Remove dead condensed mode code comment if keeping for reference

This is a minor cleanup suggestion—the code functions correctly as-is.

Also applies to: 177-241

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/LogoV2/LogoV2.tsx` around lines 135 - 136, The file defines a
local constant isCondensedMode = false and surrounding conditional blocks that
permanently disable ~60 lines of code (the condensed-mode branch in LogoV2
component), producing dead/unreachable code; either remove the entire dead
condensed-mode branch (the conditional and the related JSX/logic tied to
isCondensedMode in LogoV2) or, if you want to keep it for reference, add a clear
TODO comment above the constant (e.g., "// TODO: remove dead condensed mode
code") and delete any unreachable helpers/props that are no longer used so the
component has no dead branches; update any related identifiers referenced in
that branch (isCondensedMode and the condensed-mode JSX/function names inside
LogoV2) accordingly.

65-67: Conditional type assertion obscures actual type; simplify for clarity.

The conditional type (typeof ChannelsNoticeModule) extends null ? null : React.ComponentType doesn't behave as intended. Since ChannelsNoticeModule has type typeof import('./ChannelsNotice.js') | null, the condition always evaluates to React.ComponentType (a union never extends one of its members). The optional chaining ChannelsNoticeModule?.ChannelsNotice infers type ComponentType | undefined, which the assertion masks.

Simplify by either removing the assertion or using explicit typing:

Option 1: Remove assertion
-const ChannelsNotice = ChannelsNoticeModule?.ChannelsNotice as (typeof ChannelsNoticeModule) extends null ? null : React.ComponentType
+const ChannelsNotice = ChannelsNoticeModule?.ChannelsNotice
Option 2: Explicit type
-const ChannelsNotice = ChannelsNoticeModule?.ChannelsNotice as (typeof ChannelsNoticeModule) extends null ? null : React.ComponentType
+const ChannelsNotice: React.ComponentType | undefined = ChannelsNoticeModule?.ChannelsNotice
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/LogoV2/LogoV2.tsx` around lines 65 - 67, The conditional type
assertion on ChannelsNotice is confusing and incorrect; replace it with a
clearer type or remove it: locate the declaration "const ChannelsNotice =
ChannelsNoticeModule?.ChannelsNotice as (typeof ChannelsNoticeModule) extends
null ? null : React.ComponentType" and either remove the assertion so TypeScript
infers the type from ChannelsNoticeModule?.ChannelsNotice, or explicitly cast to
a correct union such as "as React.ComponentType | undefined | null" (or
React.ComponentType | undefined) so ChannelsNotice has the actual
ComponentType/undefined/null shape.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ui-rendering.md`:
- Around line 10-18: The component tree in docs/ui-rendering.md contains a
duplicate entry for CondensedLogo.tsx (appears twice in the LogoV2.tsx list);
remove the redundant second occurrence so CondensedLogo.tsx appears only once
and ensure the list items (CondensedLogo.tsx, LogoV2.tsx, Clawd.tsx,
AnimatedClawd.tsx, FeedColumn.tsx, WelcomeV2.tsx) remain correctly ordered and
formatted.
- Around line 9-18: The fenced code block containing the LogoV2 component tree
in docs/ui-rendering.md lacks a language specifier; update the opening fence for
that diagram to include a plaintext specifier (e.g., replace ``` with ```text or
```plaintext) so the tree (LogoV2.tsx, CondensedLogo.tsx, Clawd.tsx,
AnimatedClawd.tsx, FeedColumn.tsx, WelcomeV2.tsx) renders correctly as plain
text.

In `@src/components/ConsoleOAuthFlow.tsx`:
- Around line 1319-1324: BAILIAN_MODEL_MAP is declared but never used; either
remove the constant from ConsoleOAuthFlow (symbol BAILIAN_MODEL_MAP) or make its
intent explicit by converting it into a documented constant/comment or wiring it
into the model suggestion flow (e.g., use the map where model suggestions are
rendered or referenced in the component methods that build model lists). If you
keep it, add a brief comment explaining its purpose or reference it from the UI
code that generates model options (the render/helper that produces model
suggestions) so the variable is actually consumed; otherwise delete the unused
BAILIAN_MODEL_MAP declaration.
- Around line 1376-1383: Remove the dead helper function switchAlibabaField: it
is declared but never invoked, so delete the entire useCallback block that
defines switchAlibabaField (which references buildAlibabaState, setOAuthStatus,
setAlibabaInputValue, setAlibabaInputCursorOffset and
alibabaDisplayValues/activeField/alibabaInputValue) to eliminate unused code and
related dependencies in ConsoleOAuthFlow.tsx.

In `@src/utils/context.ts`:
- Around line 93-101: The unconditional early return that grants 1_000_000 when
modelSupports1M(model) is true bypasses the beta gating and makes the later
betas check dead; update the logic in the function containing these checks so
that the CONTEXT_1M_BETA_HEADER gating is evaluated first (or require betas to
include the header) before granting 1_000_000 for models lacking capability
metadata — i.e., remove or restrict the unconditional modelSupports1M(model)
return and ensure the branch using betas?.includes(CONTEXT_1M_BETA_HEADER) &&
modelSupports1M(model) is the effective path that enables 1_000_000 for models
without getModelCapability info (refer to modelSupports1M and the
CONTEXT_1M_BETA_HEADER/betas variables to locate and change the condition).

---

Outside diff comments:
In `@src/components/ConsoleOAuthFlow.tsx`:
- Line 19: Remove the unused Finnish locale import from Zod: delete the import
statement that brings in the symbol "fi" from "zod/v4/locales" in the
ConsoleOAuthFlow module since it is not referenced; ensure no other code depends
on "fi" and run a quick lint/TypeScript check to confirm the unused-import
warning is resolved.

---

Nitpick comments:
In `@src/components/ConsoleOAuthFlow.tsx`:
- Around line 1416-1419: The code uses unsafe `as any` casts when calling
updateSettingsForSource('userSettings', { modelType: 'anthropic', env }), so
replace the `as any` with a proper typed assertion or extend the settings type:
define or reuse a SettingsJson/PlatformSettings type that includes modelType and
env (e.g., interface PlatformSettings { modelType:
'anthropic'|'openai'|'gemini'; env: Record<string,string> }) and call
updateSettingsForSource('userSettings', {...} as unknown as SettingsJson) or
update the SettingsJson definition to include those fields; update the
invocation in ConsoleOAuthFlow (the block around updateSettingsForSource) to use
the new type-safe assertion instead of `as any`.
- Around line 1504-1517: The Alibaba flow renders an explicit cursor indicator
with <Text color="claude">▌</Text> while other flows (custom_platform,
openai_chat_api, gemini_api) do not, causing a UI inconsistency; either remove
that cursor node from the Alibaba block (around the TextInput using
alibabaInputValue, alibabaInputCursorOffset, handleAlibabaEnter) or add the same
cursor indicator to the other platform flow components so all platform forms use
the same visual cursor pattern—pick one approach and apply it consistently
across the components that render their TextInput fields.

In `@src/components/LogoV2/LogoV2.tsx`:
- Line 303: The JSX line rendering the ChannelsNotice component is mis-indented;
adjust the indentation of the expression rendering ChannelsNotice (the line
containing "{ChannelsNotice && <ChannelsNotice />}") to match the surrounding
JSX block in the LogoV2 component so it conforms to the file's existing
indentation style and fixes linting complaints.
- Around line 208-210: The JSX uses a redundant non-null assertion on
config.oauthAccount!.organizationName even though the surrounding conditional
already checks config.oauthAccount?.organizationName; remove the bang and
reference config.oauthAccount.organizationName (or keep the safe optional
access) inside the Text so TypeScript's control flow narrowing handles it
(update the usage in LogoV2's render where config.oauthAccount?.organizationName
is guarded).
- Around line 135-136: The file defines a local constant isCondensedMode = false
and surrounding conditional blocks that permanently disable ~60 lines of code
(the condensed-mode branch in LogoV2 component), producing dead/unreachable
code; either remove the entire dead condensed-mode branch (the conditional and
the related JSX/logic tied to isCondensedMode in LogoV2) or, if you want to keep
it for reference, add a clear TODO comment above the constant (e.g., "// TODO:
remove dead condensed mode code") and delete any unreachable helpers/props that
are no longer used so the component has no dead branches; update any related
identifiers referenced in that branch (isCondensedMode and the condensed-mode
JSX/function names inside LogoV2) accordingly.
- Around line 65-67: The conditional type assertion on ChannelsNotice is
confusing and incorrect; replace it with a clearer type or remove it: locate the
declaration "const ChannelsNotice = ChannelsNoticeModule?.ChannelsNotice as
(typeof ChannelsNoticeModule) extends null ? null : React.ComponentType" and
either remove the assertion so TypeScript infers the type from
ChannelsNoticeModule?.ChannelsNotice, or explicitly cast to a correct union such
as "as React.ComponentType | undefined | null" (or React.ComponentType |
undefined) so ChannelsNotice has the actual ComponentType/undefined/null shape.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c8cf51a-341b-4870-907b-68bfbca2b307

📥 Commits

Reviewing files that changed from the base of the PR and between 227083d and 879165e.

📒 Files selected for processing (6)
  • docs/ui-rendering.md
  • src/components/ConsoleOAuthFlow.tsx
  • src/components/LogoV2/CondensedLogo.tsx
  • src/components/LogoV2/LogoV2.tsx
  • src/setup.ts
  • src/utils/context.ts

Comment on lines +9 to +18
```
LogoV2.tsx (src/components/LogoV2/)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── LogoV2.tsx — 完整模式(有边框)/ 紧凑模式(有边框)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── Clawd.tsx — ASCII 猫吉祥物
├── AnimatedClawd.tsx — 动画版 Clawd
├── FeedColumn.tsx — 右侧信息流(活动记录/更新日志)
└── WelcomeV2.tsx — 首次 Onboarding 欢迎文本
```
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.

⚠️ Potential issue | 🟡 Minor

Add language specifier to fenced code block.

The component tree diagram should have a language specifier for proper rendering. Since this is a plain text tree structure, use text or plaintext.

📝 Suggested fix
-```
+```text
 LogoV2.tsx (src/components/LogoV2/)
 ├── CondensedLogo.tsx   — 缩略模式(无边框,日常最常见)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
LogoV2.tsx (src/components/LogoV2/)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── LogoV2.tsx — 完整模式(有边框)/ 紧凑模式(有边框)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── Clawd.tsx — ASCII 猫吉祥物
├── AnimatedClawd.tsx — 动画版 Clawd
├── FeedColumn.tsx — 右侧信息流(活动记录/更新日志)
└── WelcomeV2.tsx — 首次 Onboarding 欢迎文本
```
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ui-rendering.md` around lines 9 - 18, The fenced code block containing
the LogoV2 component tree in docs/ui-rendering.md lacks a language specifier;
update the opening fence for that diagram to include a plaintext specifier
(e.g., replace ``` with ```text or ```plaintext) so the tree (LogoV2.tsx,
CondensedLogo.tsx, Clawd.tsx, AnimatedClawd.tsx, FeedColumn.tsx, WelcomeV2.tsx)
renders correctly as plain text.

Comment on lines +10 to +18
LogoV2.tsx (src/components/LogoV2/)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── LogoV2.tsx — 完整模式(有边框)/ 紧凑模式(有边框)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── Clawd.tsx — ASCII 猫吉祥物
├── AnimatedClawd.tsx — 动画版 Clawd
├── FeedColumn.tsx — 右侧信息流(活动记录/更新日志)
└── WelcomeV2.tsx — 首次 Onboarding 欢迎文本
```
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.

⚠️ Potential issue | 🟡 Minor

Duplicate entry in component tree.

CondensedLogo.tsx is listed twice (lines 11 and 13) with identical descriptions. Remove the duplicate.

📝 Suggested fix
 LogoV2.tsx (src/components/LogoV2/)
 ├── CondensedLogo.tsx   — 缩略模式(无边框,日常最常见)
 ├── LogoV2.tsx          — 完整模式(有边框)/ 紧凑模式(有边框)
-├── CondensedLogo.tsx   — 缩略模式(无边框,日常最常见)
 ├── Clawd.tsx           — ASCII 猫吉祥物
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
LogoV2.tsx (src/components/LogoV2/)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── LogoV2.tsx — 完整模式(有边框)/ 紧凑模式(有边框)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── Clawd.tsx — ASCII 猫吉祥物
├── AnimatedClawd.tsx — 动画版 Clawd
├── FeedColumn.tsx — 右侧信息流(活动记录/更新日志)
└── WelcomeV2.tsx — 首次 Onboarding 欢迎文本
```
LogoV2.tsx (src/components/LogoV2/)
├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见)
├── LogoV2.tsx — 完整模式(有边框)/ 紧凑模式(有边框)
├── Clawd.tsx — ASCII 猫吉祥物
├── AnimatedClawd.tsx — 动画版 Clawd
├── FeedColumn.tsx — 右侧信息流(活动记录/更新日志)
└── WelcomeV2.tsx — 首次 Onboarding 欢迎文本
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ui-rendering.md` around lines 10 - 18, The component tree in
docs/ui-rendering.md contains a duplicate entry for CondensedLogo.tsx (appears
twice in the LogoV2.tsx list); remove the redundant second occurrence so
CondensedLogo.tsx appears only once and ensure the list items
(CondensedLogo.tsx, LogoV2.tsx, Clawd.tsx, AnimatedClawd.tsx, FeedColumn.tsx,
WelcomeV2.tsx) remain correctly ordered and formatted.

Comment on lines +1319 to +1324
// 阿里云百炼模型映射(Claude 家族 → 百炼模型)
const BAILIAN_MODEL_MAP = {
opus: ['qwen3-max-2026-01-23', 'qwen3.6-plus'],
sonnet: ['qwen3.6-plus', 'qwen3-coder-next', 'kimi-k2.5'],
haiku: ['glm-5', 'MiniMax-M2.5', 'qwen3-coder-plus'],
}
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.

⚠️ Potential issue | 🟡 Minor

Unused variable: BAILIAN_MODEL_MAP is defined but never used.

This model mapping object is declared but not referenced anywhere in the code. If it's intended for documentation or future use, consider adding a comment explaining its purpose. Otherwise, remove it.

🧹 Proposed fix: Remove unused variable or add usage

If unused, remove:

-        // 阿里云百炼模型映射(Claude 家族 → 百炼模型)
-        const BAILIAN_MODEL_MAP = {
-          opus: ['qwen3-max-2026-01-23', 'qwen3.6-plus'],
-          sonnet: ['qwen3.6-plus', 'qwen3-coder-next', 'kimi-k2.5'],
-          haiku: ['glm-5', 'MiniMax-M2.5', 'qwen3-coder-plus'],
-        }

Alternatively, if this is documentation for available models, move it to a comment in the UI section where model suggestions are displayed (line 1555).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 阿里云百炼模型映射(Claude 家族 → 百炼模型)
const BAILIAN_MODEL_MAP = {
opus: ['qwen3-max-2026-01-23', 'qwen3.6-plus'],
sonnet: ['qwen3.6-plus', 'qwen3-coder-next', 'kimi-k2.5'],
haiku: ['glm-5', 'MiniMax-M2.5', 'qwen3-coder-plus'],
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/ConsoleOAuthFlow.tsx` around lines 1319 - 1324,
BAILIAN_MODEL_MAP is declared but never used; either remove the constant from
ConsoleOAuthFlow (symbol BAILIAN_MODEL_MAP) or make its intent explicit by
converting it into a documented constant/comment or wiring it into the model
suggestion flow (e.g., use the map where model suggestions are rendered or
referenced in the component methods that build model lists). If you keep it, add
a brief comment explaining its purpose or reference it from the UI code that
generates model options (the render/helper that produces model suggestions) so
the variable is actually consumed; otherwise delete the unused BAILIAN_MODEL_MAP
declaration.

Comment on lines +1376 to +1383
const switchAlibabaField = useCallback(
(target: AlibabaField) => {
setOAuthStatus(buildAlibabaState(activeField, alibabaInputValue, target))
setAlibabaInputValue(alibabaDisplayValues[target] ?? '')
setAlibabaInputCursorOffset((alibabaDisplayValues[target] ?? '').length)
},
[activeField, alibabaInputValue, alibabaDisplayValues, buildAlibabaState, setOAuthStatus],
)
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.

⚠️ Potential issue | 🟡 Minor

Unused function: switchAlibabaField is defined but never called.

This function is declared but not used anywhere. The tab navigation is handled directly in the useKeybinding callbacks instead. Remove this dead code.

🧹 Proposed fix: Remove unused function
-        const switchAlibabaField = useCallback(
-          (target: AlibabaField) => {
-            setOAuthStatus(buildAlibabaState(activeField, alibabaInputValue, target))
-            setAlibabaInputValue(alibabaDisplayValues[target] ?? '')
-            setAlibabaInputCursorOffset((alibabaDisplayValues[target] ?? '').length)
-          },
-          [activeField, alibabaInputValue, alibabaDisplayValues, buildAlibabaState, setOAuthStatus],
-        )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const switchAlibabaField = useCallback(
(target: AlibabaField) => {
setOAuthStatus(buildAlibabaState(activeField, alibabaInputValue, target))
setAlibabaInputValue(alibabaDisplayValues[target] ?? '')
setAlibabaInputCursorOffset((alibabaDisplayValues[target] ?? '').length)
},
[activeField, alibabaInputValue, alibabaDisplayValues, buildAlibabaState, setOAuthStatus],
)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/ConsoleOAuthFlow.tsx` around lines 1376 - 1383, Remove the
dead helper function switchAlibabaField: it is declared but never invoked, so
delete the entire useCallback block that defines switchAlibabaField (which
references buildAlibabaState, setOAuthStatus, setAlibabaInputValue,
setAlibabaInputCursorOffset and
alibabaDisplayValues/activeField/alibabaInputValue) to eliminate unused code and
related dependencies in ConsoleOAuthFlow.tsx.

Comment on lines +93 to 101
// Independent 1M check for models like qwen that support 1M context but
// don't have getModelCapability data (e.g. OpenAI-compatible providers)
if (modelSupports1M(model)) {
return 1_000_000
}

if (betas?.includes(CONTEXT_1M_BETA_HEADER) && modelSupports1M(model)) {
return 1_000_000
}
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.

⚠️ Potential issue | 🟠 Major

Unconditional fallback bypasses beta gating and makes the beta branch effectively dead.

At Line 95, modelSupports1M(model) now returns true for Claude patterns too, so models without capability metadata can get 1_000_000 without CONTEXT_1M_BETA_HEADER. That also makes the check at Line 99 unreachable for those cases.

💡 Suggested fix
-  // Independent 1M check for models like qwen that support 1M context but
-  // don't have getModelCapability data (e.g. OpenAI-compatible providers)
-  if (modelSupports1M(model)) {
+  // Independent 1M check only for intrinsically-1M third-party models
+  // that may not have capability metadata (e.g. OpenAI-compatible providers)
+  const canonical = getCanonicalName(model)
+  if (canonical.startsWith('qwen')) {
     return 1_000_000
   }

   if (betas?.includes(CONTEXT_1M_BETA_HEADER) && modelSupports1M(model)) {
     return 1_000_000
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utils/context.ts` around lines 93 - 101, The unconditional early return
that grants 1_000_000 when modelSupports1M(model) is true bypasses the beta
gating and makes the later betas check dead; update the logic in the function
containing these checks so that the CONTEXT_1M_BETA_HEADER gating is evaluated
first (or require betas to include the header) before granting 1_000_000 for
models lacking capability metadata — i.e., remove or restrict the unconditional
modelSupports1M(model) return and ensure the branch using
betas?.includes(CONTEXT_1M_BETA_HEADER) && modelSupports1M(model) is the
effective path that enables 1_000_000 for models without getModelCapability info
(refer to modelSupports1M and the CONTEXT_1M_BETA_HEADER/betas variables to
locate and change the condition).

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