202604122033 qwen3.6-plus 1M的上下文窗口 7 个 TypeScript 类型错误已修复#250
202604122033 qwen3.6-plus 1M的上下文窗口 7 个 TypeScript 类型错误已修复#250chenwangnec wants to merge 7 commits intoclaude-code-best:mainfrom
Conversation
No recent activity" 问题的原因分析和修复记录
配置阿里云百炼 Anthropic 兼容端点。已自动映射 Claude 三大模型家族到百炼模型
qwen3.6-plus 1M的上下文窗口 7 个 TypeScript 类型错误已修复
📝 WalkthroughWalkthroughAdded 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
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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 | 🔴 CriticalUnused import:
fifrom 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 avoidingas anytype assertions.The coding guidelines specify using
as unknown as SpecificTypeor supplementing the interface instead of directas anycasts. 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
SettingsJsontype to includemodelTypeandenvproperties if they're valid fields.As per coding guidelines: "Use
as unknown as SpecificTypedouble assertion or supplement interface instead of directas anytype 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:
- Removing this cursor indicator to match other flows
- 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!.organizationNameuses a non-null assertion, but the guard on line 208 already checks bothoauthAccountandorganizationNamefor 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 = falseandif (false)creates ~60 lines of unreachable code (lines 178-241). While the documentation indicates this is intentional for "permanently disabled" condensed mode, consider either:
- Removing the dead code entirely if condensed mode won't return
- Adding a
// TODO: Remove dead condensed mode codecomment if keeping for referenceThis 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.ComponentTypedoesn't behave as intended. SinceChannelsNoticeModulehas typetypeof import('./ChannelsNotice.js') | null, the condition always evaluates toReact.ComponentType(a union never extends one of its members). The optional chainingChannelsNoticeModule?.ChannelsNoticeinfers typeComponentType | 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?.ChannelsNoticeOption 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
📒 Files selected for processing (6)
docs/ui-rendering.mdsrc/components/ConsoleOAuthFlow.tsxsrc/components/LogoV2/CondensedLogo.tsxsrc/components/LogoV2/LogoV2.tsxsrc/setup.tssrc/utils/context.ts
| ``` | ||
| LogoV2.tsx (src/components/LogoV2/) | ||
| ├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见) | ||
| ├── LogoV2.tsx — 完整模式(有边框)/ 紧凑模式(有边框) | ||
| ├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见) | ||
| ├── Clawd.tsx — ASCII 猫吉祥物 | ||
| ├── AnimatedClawd.tsx — 动画版 Clawd | ||
| ├── FeedColumn.tsx — 右侧信息流(活动记录/更新日志) | ||
| └── WelcomeV2.tsx — 首次 Onboarding 欢迎文本 | ||
| ``` |
There was a problem hiding this comment.
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.
| ``` | |
| 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.
| LogoV2.tsx (src/components/LogoV2/) | ||
| ├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见) | ||
| ├── LogoV2.tsx — 完整模式(有边框)/ 紧凑模式(有边框) | ||
| ├── CondensedLogo.tsx — 缩略模式(无边框,日常最常见) | ||
| ├── Clawd.tsx — ASCII 猫吉祥物 | ||
| ├── AnimatedClawd.tsx — 动画版 Clawd | ||
| ├── FeedColumn.tsx — 右侧信息流(活动记录/更新日志) | ||
| └── WelcomeV2.tsx — 首次 Onboarding 欢迎文本 | ||
| ``` |
There was a problem hiding this comment.
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.
| 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.
| // 阿里云百炼模型映射(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'], | ||
| } |
There was a problem hiding this comment.
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.
| // 阿里云百炼模型映射(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.
| const switchAlibabaField = useCallback( | ||
| (target: AlibabaField) => { | ||
| setOAuthStatus(buildAlibabaState(activeField, alibabaInputValue, target)) | ||
| setAlibabaInputValue(alibabaDisplayValues[target] ?? '') | ||
| setAlibabaInputCursorOffset((alibabaDisplayValues[target] ?? '').length) | ||
| }, | ||
| [activeField, alibabaInputValue, alibabaDisplayValues, buildAlibabaState, setOAuthStatus], | ||
| ) |
There was a problem hiding this comment.
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.
| 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.
| // 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 | ||
| } |
There was a problem hiding this comment.
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).
202604122033
qwen3.6-plus 1M的上下文窗口
7 个 TypeScript 类型错误已修复
Summary by CodeRabbit
New Features
Bug Fixes
Documentation