Skip to content

Conversation

@sxjeru
Copy link
Contributor

@sxjeru sxjeru commented Oct 16, 2025

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔀 Description of Change

https://docs.claude.com/en/docs/about-claude/models/overview

📝 Additional Information

Summary by Sourcery

Register the new Claude Haiku 4.5 chat model in the model bank and update relevant constant sets to support its context caching, tool usage, and parameter conflict resolution.

New Features:

  • Add Claude Haiku 4.5 model definition to the aihubmix chat models
  • Add Claude Haiku 4.5 model definition to the anthropic chat models

Enhancements:

  • Include 'claude-haiku-4-5-20251001' in contextCachingModels set
  • Include 'claude-haiku-4-5-20251001' in thinkingWithToolClaudeModels set
  • Add 'claude-haiku-4-5-20251001' to MODEL_PARAMETER_CONFLICTS

@vercel
Copy link

vercel bot commented Oct 16, 2025

@sxjeru is attempting to deploy a commit to the LobeHub OSS Team on Vercel.

A member of the Team first needs to authorize it.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 16, 2025

Reviewer's Guide

Introduces the Claude Haiku 4.5 chat model by adding its detailed card to both model banks, updating related constant sets for caching and reasoning, and registering it in parameter conflict definitions.

Entity relationship diagram for updated model sets with Claude Haiku 4.5

erDiagram
    CONTEXT_CACHING_MODELS {
        string id
    }
    THINKING_WITH_TOOL_CLAUDE_MODELS {
        string id
    }
    AIChatModelCard {
        string id
        string displayName
    }
    CONTEXT_CACHING_MODELS ||--o| AIChatModelCard : contains
    THINKING_WITH_TOOL_CLAUDE_MODELS ||--o| AIChatModelCard : contains
Loading

Class diagram for the new Claude Haiku 4.5 model card

classDiagram
    class AIChatModelCard {
        abilities_functionCall: bool
        abilities_reasoning: bool
        abilities_search: bool
        abilities_structuredOutput: bool
        abilities_vision: bool
        contextWindowTokens: int
        description: string
        displayName: string
        enabled: bool
        id: string
        maxOutput: int
        pricing: Pricing
        releasedAt: string
        settings_extendParams: string[]
        settings_searchImpl: string
        type: string
    }
    class Pricing {
        units: PricingUnit[]
    }
    class PricingUnit {
        name: string
        rate: float
        strategy: string
        unit: string
        lookup: Lookup (optional)
    }
    class Lookup {
        prices_1h: float
        prices_5m: float
        pricingParams: string[]
    }
    AIChatModelCard --> Pricing
    Pricing --> PricingUnit
    PricingUnit --> Lookup
Loading

Class diagram for updated MODEL_PARAMETER_CONFLICTS registration

classDiagram
    class MODEL_PARAMETER_CONFLICTS {
        claudeModels: Set<string>
    }
    MODEL_PARAMETER_CONFLICTS : +claude-haiku-4-5-20251001
Loading

File-Level Changes

Change Details Files
Add Claude Haiku 4.5 model card entries in model banks
  • Append full model definition with abilities, tokens, description, displayName, id, and maxOutput
  • Configure pricing units including fixed and lookup strategies
  • Specify release date and custom settings for extended parameters
packages/model-bank/src/aiModels/aihubmix.ts
packages/model-bank/src/aiModels/anthropic.ts
Include Claude Haiku 4.5 in context caching and reasoning sets
  • Insert model ID into contextCachingModels set
  • Insert model ID into thinkingWithToolClaudeModels set
packages/const/src/models.ts
Register Claude Haiku 4.5 in parameter conflict list
  • Add model ID to MODEL_PARAMETER_CONFLICTS set
packages/model-runtime/src/core/parameterResolver.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 16, 2025
@lobehubbot
Copy link
Member

👍 @sxjeru

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.

@gru-agent
Copy link
Contributor

gru-agent bot commented Oct 16, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 526bfd9 ✅ Finished

History Assignment

Files

File Pull Request
packages/model-runtime/src/core/parameterResolver.ts ❌ Failed (I failed to setup the environment.)

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@dosubot dosubot bot added the Model Provider Model provider related label Oct 16, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The new model object is duplicated in both aihubmix.ts and anthropic.ts—consider extracting it into a shared definition to keep maintenance DRY.
  • The identifier’s date (20251001) and the releasedAt field (2025-10-16) don’t match up—please confirm the correct release date and align those values.
  • You added the model to contextCachingModels and thinkingWithToolClaudeModels, but if it supports streaming or other capabilities you may need to include it in the appropriate sets (e.g. streamingModels).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new model object is duplicated in both aihubmix.ts and anthropic.ts—consider extracting it into a shared definition to keep maintenance DRY.
- The identifier’s date (20251001) and the releasedAt field (2025-10-16) don’t match up—please confirm the correct release date and align those values.
- You added the model to contextCachingModels and thinkingWithToolClaudeModels, but if it supports streaming or other capabilities you may need to include it in the appropriate sets (e.g. streamingModels).

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.33%. Comparing base (6508e2f) to head (f3c3bf5).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9735      +/-   ##
==========================================
- Coverage   86.33%   86.33%   -0.01%     
==========================================
  Files         870      870              
  Lines       55447    55449       +2     
  Branches     8615     6861    -1754     
==========================================
+ Hits        47869    47870       +1     
- Misses       7578     7579       +1     
Flag Coverage Δ
app 81.39% <ø> (-0.01%) ⬇️
database 98.31% <ø> (ø)
packages/agent-runtime 99.63% <ø> (ø)
packages/context-engine 93.53% <ø> (ø)
packages/electron-server-ipc 93.76% <ø> (ø)
packages/file-loaders 92.21% <ø> (ø)
packages/model-bank 100.00% <ø> (ø)
packages/model-runtime 94.51% <100.00%> (+<0.01%) ⬆️
packages/prompts 92.27% <ø> (ø)
packages/python-interpreter 96.50% <ø> (ø)
packages/utils 94.80% <ø> (ø)
packages/web-crawler 97.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 81.90% <ø> (ø)
Services 61.71% <ø> (ø)
Server 65.51% <ø> (ø)
Libs 51.38% <ø> (-0.05%) ⬇️
Utils 75.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vercel
Copy link

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lobe-chat-preview Ready Ready Preview Comment Oct 16, 2025 1:48pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 16, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 16, 2025
@arvinxx arvinxx merged commit 1cfbc87 into lobehub:main Oct 16, 2025
51 of 55 checks passed
@lobehubbot
Copy link
Member

lobehubbot commented Oct 16, 2025

❤️ Great PR @sxjeru ❤️

The growth of the project is inseparable from user feedback and contributions, thanks for your contribution! If you are interested in the LobeHub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about lobe-chat development and sharing AI newsletters from around the world.


This comment was translated by Claude.

Original Content

❤️ Great PR @sxjeru ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

@sxjeru sxjeru deleted the 10.16 branch October 16, 2025 13:52
lobehubbot pushed a commit that referenced this pull request Oct 16, 2025
### [Version&nbsp;1.137.10](v1.137.9...v1.137.10)
<sup>Released on **2025-10-16**</sup>

#### 💄 Styles

- **misc**: Add Claude Haiku 4.5 model.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Add Claude Haiku 4.5 model, closes [#9735](#9735) ([1cfbc87](1cfbc87))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.137.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

rdmclin2 added a commit that referenced this pull request Oct 17, 2025
* 🔨 chore: output JSON support tools calling mode (#9696)

* support tools calling in generateObject method

* fix tests

* 🔨 chore: add Clerk authentication related variables and some other variables in Dockerfile (#9640)

* chore(docker): add Clerk authentication related variables in Dockerfile

* chore(docker): add ENABLED_FAL, S3_ENABLE_PATH_STYLE, and S3_SET_ACL environment variables to Dockerfile

* chore(docker): add CLERK_WEBHOOK_SECRET environment variable

* revert(docker): fix indentation that was mistakenly modified due to. vscode settings

* chore(docker): add ENABLE_AUTH_PROTECTION environment variable to Dockerfiles

---------

Co-authored-by: bbbugg <[email protected]>

* 💄 style: change the user chatItem maxWidth should use flex 1 (#9689)

* feat: change the user chatitem max flex 1

* feat: add when editing not show actions

* 🔖 chore(release): v1.137.1 [skip ci]

### [Version&nbsp;1.137.1](v1.137.0...v1.137.1)
<sup>Released on **2025-10-14**</sup>

#### 💄 Styles

- **misc**: Change the user chatItem maxWidth should use flex 1.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Change the user chatItem maxWidth should use flex 1, closes [#9689](#9689) ([cfd5221](cfd5221))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 🐛 fix: fix the Worker URL cross-origin issue (#9624)

When the origin of the Worker script is different from the current page, reconstruct the URL relative to the current origin to avoid cross-origin errors.

* 🔖 chore(release): v1.137.2 [skip ci]

### [Version&nbsp;1.137.2](v1.137.1...v1.137.2)
<sup>Released on **2025-10-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix the Worker URL cross-origin issue.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix the Worker URL cross-origin issue, closes [#9624](#9624) ([d379112](d379112))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 🐛 fix: fix tools calling long name length >64 issue (#9697)

* add ToolNameResolver

* fix ToolName generate tests

* fix tests

* 🐛 fix: fix mcp server connect issue and refactor web search implement (#9694)

* add

* clean

* refactor

* refactor

* add test

* fix style

* refactor to improve search performance

* refactor types

* refactor types

* refactor types

* fix mcp retry issue

* add more tests

* fix test and types

* fix test

* fix desktop remote streamable http

* add local

* fix tests

* update

* 🔖 chore(release): v1.137.3 [skip ci]

### [Version&nbsp;1.137.3](v1.137.2...v1.137.3)
<sup>Released on **2025-10-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix mcp server connect issue and refactor web search implement, fix tools calling long name length >64 issue.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix mcp server connect issue and refactor web search implement, closes [#9694](#9694) ([15ebcb4](15ebcb4))
* **misc**: Fix tools calling long name length >64 issue, closes [#9697](#9697) ([cb98604](cb98604))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 🔨 chore: add e2e workflow (#9677)

* add e2e test

* Potential fix for code scanning alert no. 137: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* remove

* update

* fix tests

* add e2e

* update

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* 🐛fix(mobile): enable conditional fetching of AI provider list based on mobile view (#9621)

🐛fix: enable conditional fetching of AI provider list based on mobile view

* 🐛 fix: prevent Vertex AI JSON credentials from being split by comma (#9703)

- Add special case for VertexAI in getProviderAuthPayload to skip random API key selection
- Vertex AI uses JSON format credentials that contain commas, which should not be split
- Add test case to verify JSON credentials remain intact

Fixes the issue introduced in #9477 where random API key splitting broke Vertex AI authentication

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* 🔖 chore(release): v1.137.4 [skip ci]

### [Version&nbsp;1.137.4](v1.137.3...v1.137.4)
<sup>Released on **2025-10-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Prevent Vertex AI JSON credentials from being split by comma.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Prevent Vertex AI JSON credentials from being split by comma, closes [#9703](#9703) [#9477](#9477) ([189081d](189081d))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 💄 style: add imagen model to vertex ai (#9699)

* ♻️ refactor: rename isLocalUrl to isDesktopLocalStaticServerUrl

Rename the function to better reflect its specific purpose of checking
desktop local static server URLs (127.0.0.1 only). Update all usages
across the codebase including imports, function calls, and test cases.

* ✨ feat(model-bank): add Vertex AI image generation models

- Add Nano Banana (Gemini 2.5 Flash Image) models
- Add Imagen 4 series (Standard, Ultra, Fast, Preview variants)
- Export shared parameters for reuse across providers

* ✅ test(context-engine): fix mock after function rename

Update test mock from isLocalUrl to isDesktopLocalStaticServerUrl

* ♻️ refactor: use submodule imports for @lobechat/utils

- Change from barrel imports to direct submodule imports
- Update test to mock only necessary functions (imageUrlToBase64)
- Fix test URL from localhost to 127.0.0.1 for isDesktopLocalStaticServerUrl
- Update package.json exports for utils submodules

* ✅ test: update mocks after function rename

Update test mocks from isLocalUrl to isDesktopLocalStaticServerUrl

* ✅ test(chat): fix mocks to use submodule imports

* 🔖 chore(release): v1.137.5 [skip ci]

### [Version&nbsp;1.137.5](v1.137.4...v1.137.5)
<sup>Released on **2025-10-14**</sup>

#### 💄 Styles

- **misc**: Add imagen model to vertex ai.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Add imagen model to vertex ai, closes [#9699](#9699) ([3b2a2c1](3b2a2c1))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* ✅ test: refactor aiChat tests (#9708)

* refactor tests

* ♻️ refactor(test): improve test layering and fix type errors

Improved test architecture by fixing test layer violations:

1. **internal_coreProcessMessage tests**: Changed to spy on direct dependency `internal_fetchAIChatMessage` instead of lower-level `chatService.createAssistantMessageStream`

2. **internal_fetchAIChatMessage tests**: Fixed to mock correct service (`chatService` instead of global `fetch`)

3. **beforeEach cleanup**: Removed global `spyOnChatService()` to reduce implicit coupling - tests now spy `chatService` only when needed

4. **Type fixes**:
   - Fixed mockResolvedValue() to include required undefined arguments
   - Fixed ChatMessageError type to include required `type` property
   - Fixed MessageDispatch type guard for safer property access

Benefits:
✅ Clear test layers - each test only spies on direct dependencies
✅ Correct mocks matching actual implementation
✅ Coverage improved from 81.48% to 82.03%
✅ All 52 tests passing with no type errors

* 🔨 chore: add claude code powered workflows (#9709)

* add claude dedupe issue workflow

* add triage

* add auto close duplicate

* improve triage

* improve

* 🐛 fix: vertext ai create image (#9710)

* 🔧 fix: update Claude workflows to use oauth token (#9711)

* 🔖 chore(release): v1.137.6 [skip ci]

### [Version&nbsp;1.137.6](v1.137.5...v1.137.6)
<sup>Released on **2025-10-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Update Claude workflows to use oauth token, vertext ai create image.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Update Claude workflows to use oauth token, closes [#9711](#9711) ([8dcb00e](8dcb00e))
* **misc**: Vertext ai create image, closes [#9710](#9710) ([790d8fd](790d8fd))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 🔨 chore: unify Claude Code workflows to use claude-code-action@main (#9712)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* 🔨 chore: improve  Claude Code triage workflow (#9713)

* 🔨 chore: unify Claude Code workflows to use claude-code-action@main

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* 🔧 chore: extract issue triage prompt to separate file

- Add .claude/prompts/issue-triage.md with comprehensive triage guide
- Update workflow to read from issue-triage.md instead of inline prompt
- Simplify workflow configuration for better maintainability
- Add provider detection rules including aihubmix

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* ✅ test(store): refactor generateAIChatV2 tests following V1 patterns (#9714)

- Introduce shared test helpers and fixtures
- Use TEST_IDS and TEST_CONTENT constants instead of hardcoded strings
- Organize tests by functionality (validation, message creation, RAG integration, error handling)
- Remove commented-out test code
- Maintain V2-specific features (isServerMode, aiChatService mock)
- All 28 tests passing

* 🔨 style: Use different favicon.ico in dev mode (#9723)

* 🔖 chore(release): v1.137.7 [skip ci]

### [Version&nbsp;1.137.7](v1.137.6...v1.137.7)
<sup>Released on **2025-10-15**</sup>

#### 💄 Styles

- **misc**: Use different favicon.ico in dev mode.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Use different favicon.ico in dev mode, closes [#9723](#9723) ([2f7317b](2f7317b))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 🐛 fix: fix duplicate tools id issue and fix link dialog issue (#9731)

* add

* baseline

* ✅ test(store): add tests for discover store plugin and mcp slices

- Add comprehensive tests for discover/slices/plugin/action.ts (15 tests)
- Add comprehensive tests for discover/slices/mcp/action.ts (11 tests)
- Update test-coverage.md with new metrics and completed work
- Coverage: 74.24% overall (+26 tests, 2 new test files)
- Action files coverage: 29/40 tested (72.5%, +2 files)

Features tested:
- Plugin/MCP categories, detail, identifiers, and list fetching
- SWR key generation with locale and parameters
- SWR configuration verification
- Service integration with discoverService

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* 📝 docs(testing): add SWR hooks testing guide and subagent workflow

Testing Guide Updates:
- Add comprehensive SWR hooks testing section with examples
- Document key differences from regular action tests
- Add examples for testing SWR key generation and configuration
- Add examples for testing conditional fetching
- Update references to include SWR hook test examples

Test Coverage Guide Updates:
- Add detailed subagent workflow for parallel testing
- Document when and how to use subagents for testing
- Add complete workflow example using subagents
- Add benefits and best practices for subagent usage
- Clarify that subagents should NOT commit or update docs
- Add step-by-step guide for launching parallel subagents

Key improvements:
- Better documentation for testing SWR-based store actions
- Clear workflow for efficient parallel testing using subagents
- Single atomic commit strategy after all subagents complete
- Improved testing efficiency and organization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* ♻️ refactor(test): fix SWR mock strategy to properly test fetcher

Previously, tests were hardcoding return values instead of calling
the fetcher function. This bypassed the actual service call logic.

Changes:
- Fix useSWR mock to call fetcher and return its Promise
- Update assertions to await Promise results
- Update testing guide with correct mock pattern
- Add explanation of why this approach is correct

Before (incorrect):
```typescript
useSWRMock.mockImplementation(((key, fetcher) => {
  fetcher?.(); // Call but ignore result
  return { data: mockData }; // Hardcoded
}) as any);
expect(result.current.data).toEqual(mockData);
```

After (correct):
```typescript
useSWRMock.mockImplementation(((key, fetcher) => {
  const data = fetcher?.(); // Get Promise from fetcher
  return { data }; // Return Promise
}) as any);
const resolvedData = await result.current.data;
expect(resolvedData).toEqual(mockData);
```

Benefits:
- ✅ Actually tests the fetcher function
- ✅ Mirrors real SWR behavior (data is Promise)
- ✅ Service calls are properly verified
- ✅ Tests are more accurate and maintainable

Updated files:
- .cursor/rules/testing-guide/zustand-store-action-test.mdc
- src/store/discover/slices/plugin/action.test.ts
- src/store/discover/slices/mcp/action.test.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* 🐛 fix(test): correct SWR mock strategy to match project standards

- Remove useSWR mocking, use real SWR implementation instead
- Only mock service methods (fetchers) with vi.spyOn
- Use waitFor for async assertions
- Update testing guide with correct SWR pattern
- Add reference to src/store/chat/slices/message/action.test.ts

This fixes the incorrect mocking approach from previous commits.
All 13 tests pass with the corrected strategy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* ✅ test(store): add comprehensive tests for high priority action files

- Add mcpStore action tests (41 tests, 624 LOC covered)
  - MCP plugin installation flow (normal, resume, dependencies, config)
  - Connection testing (HTTP and STDIO)
  - Plugin lifecycle management
  - Error handling and cancellation flows

- Add fileManager action tests (35 tests, 205 LOC covered)
  - File upload and processing workflows
  - Chunk embedding and parsing
  - File list management and refresh
  - SWR data fetching

Testing approach:
- Used parallel subagents for efficient development
- Followed zustand testing patterns from guide
- Proper test layering and per-test mocking
- All tests pass type-check and lint

Coverage improvement: 74.24% → ~76% (+76 tests, 2 files)
Action files: 29/40 → 31/40 tested (77.5%)

🏆 Milestone: All high priority files (>200 LOC) now have tests!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* ✅ test(store): complete 100% action file coverage with 160 new tests

Added comprehensive tests for all remaining 9 medium-priority action files:

Discovery Store (33 tests):
- assistant/action.ts: 10 tests (SWR hooks, categories, detail, identifiers, list)
- provider/action.ts: 11 tests (SWR hooks, detail with readme, identifiers, list with filters)
- model/action.ts: 12 tests (SWR hooks, categories, detail, identifiers, list with params)

Knowledge Base Store (29 tests):
- crud/action.ts: 19 tests (create, update, remove, refresh, loading states, SWR hooks)
- content/action.ts: 10 tests (add files, remove files, error handling)

File Store (36 tests):
- upload/action.ts: 18 tests (base64 upload, file upload with progress, type detection, KB integration)
- chunk/action.ts: 18 tests (drawer management, highlight, semantic search)

AI Infrastructure Store (23 tests):
- aiModel/action.ts: 23 tests (CRUD, batch operations, remote sync, toggle enabled, SWR hooks)

Chat Store (39 tests):
- thread/action.ts: 39 tests (CRUD, messaging, AI title generation, validation, loading states)

Testing approach:
- Used 9 parallel subagents for efficient development
- Followed zustand testing patterns from guide
- SWR hook testing for discovery slices
- Complex async flows with proper error handling
- File operations with progress callbacks
- Semantic search and RAG integration

Coverage improvement: ~76% → ~80% (+160 tests, 9 files)
Action files: 31/40 → 40/40 tested (100%)

🎉 MILESTONE: All 40 action files now have comprehensive test coverage!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* fix test

* fix test

* fix context-engine

* add tests

* remove

* remove tools bar

* pin bun version

* fix

---------

Co-authored-by: Claude <[email protected]>

* 💄 style: add region support for Vertex AI provider (#9720)

✨ feat: add region support for Vertex AI provider

- Add VertexAIKeyVault interface with region support
- Update UI to include region selector with 35+ regions
- Add vertexAIRegion field to ClientSecretPayload
- Update backend to use user-selected region with fallback
- Add i18n support for English and Chinese
- Fix issue with Gemini 2.5 models requiring global region

* 🔖 chore(release): v1.137.8 [skip ci]

### [Version&nbsp;1.137.8](v1.137.7...v1.137.8)
<sup>Released on **2025-10-15**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix duplicate tools id issue and fix link dialog issue.

#### 💄 Styles

- **misc**: Add region support for Vertex AI provider.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix duplicate tools id issue and fix link dialog issue, closes [#9731](#9731) ([0a8c80d](0a8c80d))

#### Styles

* **misc**: Add region support for Vertex AI provider, closes [#9720](#9720) ([d17b50c](d17b50c))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 💄 style: improve update notification (#9717)

* refactor tool source

* Revert "refactor tool source"

This reverts commit a867118.

* improve update notification

* improve locale

* 🔖 chore(release): v1.137.9 [skip ci]

### [Version&nbsp;1.137.9](v1.137.8...v1.137.9)
<sup>Released on **2025-10-15**</sup>

#### 💄 Styles

- **misc**: Improve update notification.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Improve update notification, closes [#9717](#9717) ([16de38a](16de38a))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 🔨 chore: mobile related server implementation pick from mobile app (#9691)

* server: sync from feat/mobile-app (exclude apps/mobile)

* Update package.json

* chore(mobile): update mobile router imports to use lambda

* chore(mobile): refactor mobile router

* chore: format tsconfig.json

* chore(mobile): simplify mobile router

---------

Co-authored-by: Arvin Xu <[email protected]>
Co-authored-by: Tsuki <[email protected]>

* 💄 style: Add Claude Haiku 4.5 model (#9735)

* feat: 添加 Claude Haiku 4.5 模型及其相关配置

* fix: 修复模型 ID 格式并移除 Llama 4 Maverick 模型

* 添加 doubao-seed-1.6-lite;更新模型价格区间格式,调整价格单位为百万 tokens

* fix: Invalid combination of reasoning_effort and thinking type: low + disabled

* feat: 添加 Qwen3 VL Flash 和 Qwen3 Coder 30B A3B 模型,更新定价和发布信息

* 🔖 chore(release): v1.137.10 [skip ci]

### [Version&nbsp;1.137.10](v1.137.9...v1.137.10)
<sup>Released on **2025-10-16**</sup>

#### 💄 Styles

- **misc**: Add Claude Haiku 4.5 model.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Add Claude Haiku 4.5 model, closes [#9735](#9735) ([1cfbc87](1cfbc87))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* ✨ feat: support Group Chat, Mention, and Multi-Agent Orchestration with feature flag (#8976)

* feat: implement group chat functionality

* fix

* update

* revert pglite mock

* fix: Add missing test

* fix mention

* fix mention

* lint: Clear unused varibles

* fix: type check

* fix: Coverage

* build: Add missing test

* fix: add mention back

* fix: Add missing test

* fix: Add test for topic

* feat: Group chat fallback style

* fix: Revert unncessary files

* fix: circular deps

* feat: tool usage

* fix: Replace debug info

* feat: Update i18n

* opti: Better prompr

* fix claude

* feat: Filter model without function calling

* fix: DM reduction

* lint: Address build error

* fix: Test error

* feat: Store model info

* style: Clean up welcome messaeg

* feat: Use new welcome message

* fix: inbox not working

* fix: inbox not working

* fix: type error

* feat: Optimize prompt

* fix: Revert unintentional changes

* lint: Remove unused code

* fix: better test

* fix: Use debug

* refact: Move normalization postion

* opti: Better prompt

* opti: Better prompt

* opti: Better prompt

* lint: Clear console.log

* fix: Update test snap

* fix: test error

* fix: Unexpectly test fail

---------

Co-authored-by: arvinxx <[email protected]>

* 🔖 chore(release): v1.138.0 [skip ci]

## [Version&nbsp;1.138.0](v1.137.10...v1.138.0)
<sup>Released on **2025-10-16**</sup>

#### ✨ Features

- **misc**: Support Group Chat, Mention, and Multi-Agent Orchestration with feature flag.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Support Group Chat, Mention, and Multi-Agent Orchestration with feature flag, closes [#8976](#8976) ([03c2838](03c2838))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* 🔨 chore: support Feishu OAuth Provider (#9745)

* feat: 添加 Feishu 作为新的 OAuth 认证提供者,并更新相关配置

* docs: 添加 Feishu 应用的环境变量配置说明

* refactor: 移除 Feishu 相关的环境变量配置,对齐 auth.js 环境变量规范

* improve docs

* add feishu

---------

Co-authored-by: 赵远景 <[email protected]>

* 🐛 fix: Automatic topic creation switch does not work (#9693)

* ✨ feat: 添加自动创建主题功能,支持根据消息数量和配置阈值决定是否创建新主题

* typo

* fix test

* 删除 GLM-4.6 模型的定义

* ✨ feat: 添加 Ring-1T 和 Ling-1T 模型定义,扩展聊天模型库

* ✨ feat: 添加 Qwen3 VL 模型,扩展聊天模型库并更新 Vercel AI Gateway 模型定价

* fix test

* feat: support ios 26 icon

* 🔖 chore(release): v1.138.1 [skip ci]

### [Version&nbsp;1.138.1](v1.138.0...v1.138.1)
<sup>Released on **2025-10-16**</sup>

#### 🐛 Bug Fixes

- **misc**: Automatic topic creation switch does not work.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Automatic topic creation switch does not work, closes [#9693](#9693) ([a02b301](a02b301))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

* 📝 docs(bot): Auto sync agents & plugin to readme

* chore: fix lint error

* add prompts package to workspace

---------

Co-authored-by: Arvin Xu <[email protected]>
Co-authored-by: iBenzene <[email protected]>
Co-authored-by: bbbugg <[email protected]>
Co-authored-by: Shinji-Li <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: lobehubbot <[email protected]>
Co-authored-by: peerless-hero <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: bbbugg <[email protected]>
Co-authored-by: YuTengjing <[email protected]>
Co-authored-by: René Wang <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Tsuki <[email protected]>
Co-authored-by: sxjeru <[email protected]>
Co-authored-by: 赵远景 <[email protected]>
JamieStivala pushed a commit to jaworldwideorg/OneJA-Bot that referenced this pull request Oct 17, 2025
## [Version&nbsp;1.132.0](v1.131.2...v1.132.0)
<sup>Released on **2025-10-17**</sup>

#### ✨ Features

- **misc**: Support Group Chat, Mention, and Multi-Agent Orchestration with feature flag.

#### 🐛 Bug Fixes

- **misc**: Automatic topic creation switch does not work.

#### 💄 Styles

- **misc**: Add Claude Haiku 4.5 model, improve welcome message.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Support Group Chat, Mention, and Multi-Agent Orchestration with feature flag, closes [lobehub#8976](https://github.com/jaworldwideorg/OneJA-Bot/issues/8976) ([03c2838](03c2838))

#### What's fixed

* **misc**: Automatic topic creation switch does not work, closes [lobehub#9693](https://github.com/jaworldwideorg/OneJA-Bot/issues/9693) ([a02b301](a02b301))

#### Styles

* **misc**: Add Claude Haiku 4.5 model, closes [lobehub#9735](https://github.com/jaworldwideorg/OneJA-Bot/issues/9735) ([1cfbc87](1cfbc87))
* **misc**: Improve welcome message, closes [lobehub#9747](https://github.com/jaworldwideorg/OneJA-Bot/issues/9747) ([c83fe13](c83fe13))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Model Provider Model provider related released size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants