Skip to content

Conversation

@cnkang
Copy link

@cnkang cnkang commented Aug 5, 2025

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

🔀 变更说明 | Description of Change

  • 切换认证方式:简化 Bedrock 认证流程,payload 仅需提供 Bearer token 与 region,移除弃用或次要字段。
  • 移除旧凭证AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY 不再生效,所有 AK/SK 和 STS 方式的认证方法已被删除。
  • 新增错误类型:添加 NoAvailableModelsInvalidBedrockRegion 错误类型,以便更精确地反馈连接检查失败的原因。
  • 组件重构:在 Checker 组件中重构 i18n 调用以保持一致性,移除未使用的 state,并进行若干小规模代码清理(如统一使用 slice 进行字符串操作)。

📝 补充信息 | Additional Information

  • Bearer token 认证详情请参考AWS官方文档:https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html
  • 由于认证方式发生变化,请确保依赖此 SDK 的客户端或服务已更新为使用 Bearer token 与 region,并移除对环境变量 AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY 的依赖。
  • 新增错误类型可能需要在上游错误处理逻辑中添加相应分支,建议同时更新相关单元测试和集成测试。
  • 重构后的 i18n 调用可能影响现有的翻译 key,请同步更新本地化文件以匹配新接口签名。
  • 除认证 payload 结构与错误枚举外,本次变更不应引入其他破坏性变更。

Summary by Sourcery

Switch Bedrock provider to Bearer Token authentication, remove legacy AWS credentials and STS, and refactor runtime, config, UI, docs, and tests to support the new auth workflow

New Features:

  • Switch Bedrock provider to Bearer Token authentication and remove AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN support
  • Introduce dynamic Bedrock model listing via AWS_BEDROCK_MODEL_LIST with inclusion/exclusion rules
  • Enforce per-provider enable flags in ModelRuntime initialization and throw ProviderNotEnabled errors when disabled

Enhancements:

  • Add NoAvailableModels and InvalidBedrockRegion error types for precise connection feedback
  • Refactor LobeBedrockAI to use direct HTTP requests with streaming JSON parsing, replacing AWS SDK commands
  • Improve connection checker to auto-select available models and handle missing models gracefully
  • Update Bedrock provider UI to use bearer token input and remove legacy credential fields
  • Include a StreamingJsonParser utility for robust parsing of chunked JSON streams

Build:

  • Add browserify fallbacks (crypto, path, stream) in Next.js webpack configuration

Documentation:

  • Update Bedrock usage guides and environment variable docs to reflect bearer token authentication and new config keys

Tests:

  • Revise Bedrock AI tests for bearer token flows, add tests for missing token and model listing
  • Add unit tests for the StreamingJsonParser utility

Chores:

  • Update dependencies to include @aws-sdk/token-providers and browserify shims

cnkang and others added 14 commits July 25, 2025 15:54
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
Simplifies Bedrock authentication by streamlining the payload to primarily use bearer token and region, removing deprecated and less relevant fields.

Introduces AWS_BEDROCK_MODEL_LIST configuration to allow explicit control over available Bedrock models.

Adds NoAvailableModels and InvalidBedrockRegion error types for more precise error reporting, improving the clarity of connection checks.

Refactors i18n calls in the Checker component for better consistency and removes unused state. Performs minor code cleanups, including consistent use of slice for string manipulation.
@vercel
Copy link

vercel bot commented Aug 5, 2025

@cnkang is attempting to deploy a commit to the LobeHub Community Team on Vercel.

A member of the Team first needs to authorize it.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 5, 2025

Reviewer's Guide

This PR overhauls the Bedrock integration to use Bearer Token authentication exclusively, removing legacy AK/SK/STS support, and refactors both runtime and UI layers—including direct HTTP streaming with a new JSON parser, dynamic model listing, precise error types, updated configuration schemas, documentation, and corresponding tests.

Sequence diagram for Bedrock authentication flow (Bearer Token only)

sequenceDiagram
  actor User
  participant UI as UI/Settings
  participant Server as Server/ModelRuntime
  participant Bedrock as AWS Bedrock API

  User->>UI: Enter Bearer Token and Region
  UI->>Server: Send Bearer Token and Region
  Server->>Bedrock: HTTP request with Authorization: Bearer <token>
  Bedrock-->>Server: Model response
  Server-->>UI: Return result
  UI-->>User: Display result
Loading

ER diagram for Bedrock provider config schema changes

erDiagram
  AWSBedrockKeyVault {
    string bearerToken
    string region
  }
  LLMConfig {
    string AWS_BEARER_TOKEN_BEDROCK
    string AWS_REGION
    string AWS_BEDROCK_MODEL_LIST
  }
  AWSBedrockKeyVault ||--o{ LLMConfig: "uses"
Loading

Class diagram for AWSBedrockKeyVault type change

classDiagram
  class AWSBedrockKeyVault {
    + bearerToken?: string
    + region?: string
  }
Loading

Class diagram for new StreamingJsonParser utility

classDiagram
  class StreamingJsonParser {
    - buffer: string
    + processChunk(chunk: string): any[]
    + reset(): void
  }
Loading

File-Level Changes

Change Details Files
Switch Bedrock runtime to Bearer Token authentication
  • Require token in LobeBedrockAI constructor and remove AWS SDK client instantiation
  • Replace all credential usage with Authorization: Bearer HTTP headers
  • Update getParamsFromPayload to return token and drop AK/SK/STS fields
  • Adjust auth payload mapping in services/_auth.ts
  • Modify config schema and env vars (AWS_BEARER_TOKEN_BEDROCK)
src/libs/model-runtime/bedrock/index.ts
src/server/modules/ModelRuntime/index.ts
src/services/_auth.ts
src/config/llm.ts
Implement dynamic Bedrock model listing
  • Add models() method that parses AWS_BEDROCK_MODEL_LIST and filters available models
  • Enhance webapi route to return Bedrock model list based on runtime.models()
src/libs/model-runtime/bedrock/index.ts
src/app/(backend)/webapi/models/[provider]/route.ts
Introduce robust streaming JSON parsing for chat
  • Add StreamingJsonParser utility to handle chunked JSON streams
  • Integrate parser into invokeBearerTokenModel to enqueue OpenAI-compatible chunks
src/libs/model-runtime/utils/streamingJsonParser.ts
src/libs/model-runtime/bedrock/index.ts
Add precise error types and refactor connection checker
  • Define NoAvailableModels and InvalidBedrockRegion in runtime errors
  • Refactor Checker component to fetch first available model dynamically
  • Remove unused state and unify i18n error messages
src/libs/model-runtime/error.ts
src/app/[variants]/(main)/settings/llm/components/Checker.tsx
Refactor UI forms and documentation for Bearer Token
  • Replace AK/SK/STS inputs with bearerToken field in all Bedrock forms
  • Update translation keys and placeholders for bearerToken
  • Revise usage guides and env var docs (MDX) to reflect Bearer Token flow
src/components/InvalidAPIKey/APIKeyForm/Bedrock.tsx
src/app/[variants]/(main)/settings/llm/ProviderList/Bedrock/index.tsx
docs/usage/providers/bedrock.mdx
docs/usage/providers/bedrock.zh-CN.mdx
docs/self-hosting/environment-variables/model-provider.mdx
docs/self-hosting/environment-variables/model-provider.zh-CN.mdx
src/locales/default/modelProvider.ts
Add polyfills and update dependencies for streaming support
  • Add @aws-sdk/token-providers and browser polyfills (crypto, path, stream)
  • Configure Next.js resolve.fallback for node modules
package.json
next.config.ts
Update tests to align with Bearer Token changes
  • Remove AWS SDK command mocks and test initialization with token
  • Mock fetch in LobeBedrockAI tests for streaming responses
  • Adjust ModelRuntime and chat service tests to use bearerToken field
src/libs/model-runtime/bedrock/index.test.ts
src/server/modules/ModelRuntime/index.test.ts
src/services/__tests__/chat.test.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

@lobehubbot
Copy link
Member

👍 @cnkang

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 Aug 5, 2025

There is too much information in the pull request to test.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 5, 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 @cnkang - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • The OpenAI-compatible stream implementation may enqueue objects instead of Uint8Array chunks. (link)
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/libs/model-runtime/bedrock/index.ts:139` </location>
<code_context>
-      contentType: 'application/json',
-      modelId: model,
-    });
+    // Use the Converse API format for bearer token requests
+    const converseMessages = user_messages
+      .filter(msg => msg.content && (msg.content as string).trim())
+      .map(msg => ({
</code_context>

<issue_to_address>
The code assumes all user messages are non-empty strings, but does not handle the case where all messages are filtered out.

If `converseMessages` is empty, the Bedrock API may fail. Add a check to ensure at least one valid user message exists before the API call, and throw a clear error if not.
</issue_to_address>

### Comment 2
<location> `src/libs/model-runtime/bedrock/index.ts:193` </location>
<code_context>
+      const openaiStream = new ReadableStream({
</code_context>

<issue_to_address>
The OpenAI-compatible stream implementation may enqueue objects instead of Uint8Array chunks.

controller.enqueue should receive a Uint8Array or string, not a JavaScript object. Serialize the chunk (e.g., with JSON.stringify) and encode it before enqueuing to avoid runtime issues.
</issue_to_address>

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.

Kang and others added 5 commits August 5, 2025 10:46
Consolidates Bedrock provider tests by unifying how bearer tokens are handled.

The test now utilizes the  field within  for Bedrock bearer tokens, removing the need for separate AWS access key and secret fields. This change also eliminates a redundant test case for Bedrock's bearer tokens, simplifying the test suite and standardizing the payload structure.
Updates Bedrock provider tests to use a bearer token instead of access key ID and secret access key for authentication. This aligns the test with the updated Bedrock integration.

Adds `defaultSettings: {}` to initial state mocks across all provider tests to ensure consistent test setup.
Ensures that API requests to Bedrock include at least one valid message, preventing calls with empty message lists.

Formats streaming responses into the correct Server-Sent Events (SSE) format, including the `data:` prefix and double newlines, for proper client consumption.
Refactors how stream chunks are enqueued, removing redundant stringification and encoding for direct object handling. This simplifies stream processing and optimizes data flow.

Adds comprehensive error handling to the streaming pipeline, ensuring that any issues during chunk processing are caught and propagated correctly. This enhances the stability and reliability of the model runtime.
@cnkang
Copy link
Author

cnkang commented Aug 5, 2025

@sourcery-ai review

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 @cnkang - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/libs/model-runtime/bedrock/index.ts:171` </location>
<code_context>

-      const [prod, debug] = claudeStream.tee();
+    // Add temperature and top_p if specified
+    if (temperature !== undefined) {
+      requestBody.inferenceConfig.temperature = temperature / 2;
+    }
</code_context>

<issue_to_address>
Dividing temperature by 2 may not be appropriate for all models.

If dividing by 2 is required for a specific model, please document the reason or apply this adjustment only for that model.
</issue_to_address>

### Comment 2
<location> `src/libs/model-runtime/bedrock/index.ts:153` </location>
<code_context>
-    try {
-      // Ask Claude for a streaming chat completion given the prompt
-      const res = await this.client.send(command, { abortSignal: options?.signal });
+    // Ensure at least one valid message exists
+    if (converseMessages.length === 0) {
+      throw new Error('No valid user messages found. At least one non-empty message is required.');
</code_context>

<issue_to_address>
The check for at least one valid user message is strict.

If system-only prompts are valid for some models, consider making this check model-specific.
</issue_to_address>

### Comment 3
<location> `src/libs/model-runtime/bedrock/index.ts:309` </location>
<code_context>
-    try {
-      // Ask Claude for a streaming chat completion given the prompt
-      const res = await this.client.send(command);
+  private async invokeEmbeddingModelWithBearerToken(
+    payload: EmbeddingsPayload,
+    options?: EmbeddingsOptions,
</code_context>

<issue_to_address>
No normalization or validation of embedding response shape.

Validate the response structure to handle potential API changes or error formats and prevent runtime errors.
</issue_to_address>

### Comment 4
<location> `src/libs/model-runtime/bedrock/index.ts:107` </location>
<code_context>
+  async models() {
+    // Get models from environment config
+    const { getLLMConfig } = await import('@/config/llm');
+    const config = getLLMConfig();
+    const modelList = config.AWS_BEDROCK_MODEL_LIST;
+
</code_context>

<issue_to_address>
Model list parsing does not handle exclusions or '-all' logic.

The current logic only includes models with '+' or no prefix, and does not process '-' or 'all'. Please update the logic to handle exclusions and the 'all' keyword as documented.

Suggested implementation:

```typescript
  async models() {
    // Get models from environment config
    const { getLLMConfig } = await import('@/config/llm');
    const config = getLLMConfig();
    const modelList = config.AWS_BEDROCK_MODEL_LIST;

    // Assume this is the full list of available models (should be imported or defined elsewhere)
    const ALL_AVAILABLE_MODELS = [
      // e.g. 'model-a', 'model-b', 'model-c'
      // TODO: Replace with actual available models
    ];

    // Parse modelList for inclusions, exclusions, and 'all'
    const inclusions: string[] = [];
    const exclusions: string[] = [];
    let includeAll = false;

    for (const entry of modelList) {
      const trimmed = entry.trim();
      if (trimmed === 'all') {
        includeAll = true;
      } else if (trimmed.startsWith('-')) {
        exclusions.push(trimmed.slice(1));
      } else if (trimmed.startsWith('+')) {
        inclusions.push(trimmed.slice(1));
      } else {
        inclusions.push(trimmed);
      }
    }

    let finalModels: string[];
    if (includeAll) {
      finalModels = ALL_AVAILABLE_MODELS.filter(m => !exclusions.includes(m));
    } else {
      finalModels = inclusions.filter(m => !exclusions.includes(m));
    }

    // Return the final list of models (replace with actual return logic as needed)
    return finalModels;

```

- You must define or import the actual list of available models as `ALL_AVAILABLE_MODELS` for the 'all' keyword to work.
- Adjust the return value to match the expected format for your application (e.g., objects instead of strings).
- If `AWS_BEDROCK_MODEL_LIST` is not always an array, ensure it is parsed as such.
</issue_to_address>

### Comment 5
<location> `src/services/__tests__/chat.test.ts:2146` </location>
<code_context>
         expect(runtime['_runtime']).toBeInstanceOf(LobeMoonshotAI);
       });

-      it('Bedrock provider: with accessKeyId, region, secretAccessKey', async () => {
+      it('Bedrock provider: with bearer token and region', async () => {
         merge(initialSettingsState, {
+          defaultSettings: {},
</code_context>

<issue_to_address>
Test for Bedrock provider with bearer token and region is present.

Please add a test for when the bearer token is missing to verify error handling.

Suggested implementation:

```typescript
      it('Bedrock provider: with bearer token and region', async () => {
        merge(initialSettingsState, {
          defaultSettings: {},
      });

      it('Bedrock provider: missing bearer token should throw error', async () => {
        merge(initialSettingsState, {
          defaultSettings: {},
          settings: {
            keyVaults: {
              bedrock: {
                // bearerToken is intentionally omitted
                region: 'us-west-2',
              },
            },
          },
        });

        let error;
        try {
          // Replace with the actual function or initialization that uses the Bedrock provider
          await initializeBedrockProvider(); // This should be the function under test
        } catch (e) {
          error = e;
        }
        expect(error).toBeDefined();
        // Optionally, check for a specific error message:
        // expect(error.message).toMatch(/bearer token/i);

```

- Replace `initializeBedrockProvider()` with the actual function or method that initializes or uses the Bedrock provider in your codebase.
- Adjust the error message check as needed to match your implementation's error handling.
</issue_to_address>

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.

Refactors Bedrock model list parsing to correctly apply `all`, inclusion (`+`), and exclusion (`-`) rules, ensuring accurate model availability.
Adjusts chat message validation to permit system-only prompts, supporting models that do not require an initial user message.
Implements specific temperature scaling for Bedrock Claude models, aligning the 0-2 range with their expected 0-1 range.
Adds validation for embedding API responses to ensure data integrity and prevent errors from malformed replies.
Includes a test to verify that the Bedrock provider correctly throws an error when a bearer token is missing.
Database and Performance Optimizations:
- Optimize database initialization with unique DB names per test process
- Move initializeDB() from beforeEach to beforeAll to prevent concurrent initialization
- Add proper transaction-based data cleanup in beforeEach for all test files
- Force MemoryFS usage in test environment for better isolation and performance
- Skip localStorage cache checks in test environment for faster execution

Upstream Compatibility Fixes:
- Restore IdbFs usage in db.ts with proper test environment handling
- Fix userId values to match upstream patterns (file-user, session-user, etc.)
- Add trx.delete(users) before insert to prevent constraint violations
- Use transaction-based data setup in beforeEach as per upstream
- Remove unnecessary afterEach cleanup to match upstream patterns

Test Environment Configuration:
- Revert to upstream vitest configuration (remove custom poolOptions, maxConcurrency)
- Restore original canvas mock conditions matching upstream/main
- Remove location.search mock from setup.ts (upstream uses per-test beforeEach)
- Maintain compatibility with upstream while preserving performance improvements

Results:
- Fixes all test failures and compatibility issues with upstream/main
- Maintains performance optimizations while ensuring stability
- 100% test pass rate with proper upstream alignment
Kang added 3 commits August 22, 2025 09:26
…ow conflicts

- Merge latest upstream changes including package refactoring
- Resolve test workflow conflicts by adopting upstream structure  
- Maintain existing test optimizations and bedrock bearer token support
- Keep database performance improvements and test isolation
- Integrate chain refactoring into @lobechat/prompts package
- Fix file ordering test failure by adding timestamp delay for proper createdAt ordering
- Restore upstream fs selection logic for database initialization consistency  
- Improve client database test reliability with optimized initialization
- Resolve database initialization timeouts in CI environment
- Optimize test performance with MemoryFS usage and proper isolation
- Maintain upstream compatibility while preserving performance improvements
- Ensure 100% test pass rate with proper database transaction handling

This consolidates all test infrastructure improvements into a single coherent fix.
@cnkang cnkang force-pushed the dev branch 2 times, most recently from 8057f5d to b37d0ee Compare August 22, 2025 05:33
- Fix eval types export path in packages/types/src/index.ts
- Add missing EvalEvaluationStatus import in ragEval.ts  
- Implement proper test database strategy using getTestDB utility
- Use TEST_SERVER_DB environment variable to switch between client/server DB
- Restore test files to upstream structure (beforeEach instead of beforeAll)
- Update table count expectation from 59 to 63 for new ragEvals tables
- Resolve all TypeScript, lint, and test failures

✅ All tests passing after upstream merge
- Add comprehensive mocks for @electric-sql/pglite, fetch, and WebAssembly
- Fix vi.mock compatibility issues with vitest
- Ensure all 11 client DB tests pass consistently
- Mock external dependencies to avoid network requests and PGlite initialization
- Use proper timing assertions (>= instead of >) for edge cases
- Maintain upstream test structure while ensuring local compatibility

✅ Resolves all client database test failures and unhandled rejections
arvinxx and others added 7 commits August 22, 2025 14:34
* move utils

* move utils

* move utils

* update

* update

* update

* update

* update

* refactor to clean the tests

* fix release workflow

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* try to fix client db migration issue

* fix tests
### [Version&nbsp;1.114.4](lobehub/lobe-chat@v1.114.3...v1.114.4)
<sup>Released on **2025-08-22**</sup>

#### ♻ Code Refactoring

- **misc**: Move database to packages.

<br/>

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

#### Code refactoring

* **misc**: Move database to packages, closes [lobehub#8874](lobehub#8874) ([af1f715](lobehub@af1f715))

</details>

<div align="right">

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

</div>
- Updated Mistral model vision abilities
- Preserved AWS Bedrock bearertoken support
- Version bump to 1.114.5
- Updated changelog and package.json
<sup>Released on **2025-08-22**</sup>

- **misc**: Move database to packages.

<br/>

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

* **misc**: Move database to packages, closes [lobehub#8874](lobehub#8874) ([af1f715](lobehub@af1f715))

</details>

<div align="right">

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

</div>
- Filter out PostGIS system tables (geography_columns, geometry_columns, spatial_ref_sys)
- Filter out other common system table prefixes (pg_%, sql_%, information_schema%)
- Update test expectation to maintain 60 application tables
- Makes tests more robust against database extensions adding system tables
@cnkang cnkang marked this pull request as ready for review August 22, 2025 10:56
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.

Sorry @cnkang, your pull request is too large to review

@dosubot dosubot bot added the Model Provider Model provider related label Aug 22, 2025
@cnkang
Copy link
Author

cnkang commented Aug 22, 2025

已经更新到最新的代码, please review

@arvinxx arvinxx changed the base branch from main-archived to main August 31, 2025 11:43
@codecov
Copy link

codecov bot commented Aug 31, 2025

Codecov Report

❌ Patch coverage is 89.87342% with 168 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.96%. Comparing base (0efe28d) to head (2983e95).
⚠️ Report is 599 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8671      +/-   ##
==========================================
+ Coverage   83.90%   83.96%   +0.05%     
==========================================
  Files         863      867       +4     
  Lines       70108    71426    +1318     
  Branches     6439     6523      +84     
==========================================
+ Hits        58827    59974    +1147     
- Misses      11239    11410     +171     
  Partials       42       42              
Flag Coverage Δ
app 86.15% <95.39%> (+0.15%) ⬆️
database ?
packages/electron-server-ipc 74.61% <ø> (ø)
packages/file-loaders 83.59% <ø> (ø)
packages/model-runtime 73.78% <73.63%> (-0.45%) ⬇️
packages/prompts 76.45% <ø> (ø)
packages/utils 60.66% <ø> (ø)
packages/web-crawler 59.57% <ø> (ø)
server 96.26% <ø> (?)

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

Components Coverage Δ
Store 68.86% <100.00%> (ø)
Services 61.86% <100.00%> (-0.13%) ⬇️
Server 65.84% <24.65%> (-0.52%) ⬇️
Libs 46.10% <ø> (ø)
Utils 96.72% <33.33%> (-3.28%) ⬇️
🚀 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.

@arvinxx
Copy link
Member

arvinxx commented Aug 31, 2025

@cnkang 感谢贡献! 需要 rebase 下 main, 目前冲突有点多

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@cnkang Thanks for the contribution! Need to rebase main, there are a lot of conflicts at present

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

Labels

Model Provider Model provider related size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants