Skip to content

Conversation

@urmauur
Copy link
Member

@urmauur urmauur commented Aug 13, 2025

Describe Your Changes

This pull request refactors the migration logic in the useModelProvider hook, simplifying how provider and model settings are updated. The main changes involve streamlining the migration steps and reducing the migration version number, which may impact how state is upgraded in future releases.

Migration logic simplification:

  • Changed the migration for updating the cont_batching description on llamacpp providers to use forEach and direct mutation, instead of mapping and returning new objects. This reduces unnecessary object creation and improves clarity.
  • Consolidated migration steps for model settings, ensuring that missing settings such as chat_template are initialized with default values, and that key renames (e.g., chatTemplate to chat_template) are handled in a single loop.

Migration version changes:

  • Removed migration steps for version 2 and 3, including the migration for the override_tensor_buffer_type setting, and set the migration version back to 1. This affects how persisted state is upgraded and may require additional attention if older migrations are needed in the future. [1] [2]

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Important

Simplifies migration logic in useModelProvider.ts and resets migration version to 1, removing older migrations.

  • Migration Logic:
    • Simplified migration in useModelProvider.ts by using forEach for cont_batching description update, reducing object creation.
    • Consolidated model settings migration, initializing missing settings like chat_template with defaults and renaming keys in a single loop.
  • Migration Version:
    • Removed migration steps for versions 2 and 3, including override_tensor_buffer_type setting.
    • Reset migration version to 1, affecting state upgrade process.

This description was created by Ellipsis for 0fec439. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Member

@Minh141120 Minh141120 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 0fec439 in 1 minute and 30 seconds. Click for details.
  • Reviewed 91 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. web-app/src/hooks/useModelProvider.ts:230
  • Draft comment:
    Improved: Direct in-place update with forEach is clearer & avoids extra object creation. Ensure provider.settings is always an array.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. web-app/src/hooks/useModelProvider.ts:248
  • Draft comment:
    The migration correctly renames 'chatTemplate' to 'chat_template'. Verify it won’t override any custom settings when both keys exist.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. web-app/src/hooks/useModelProvider.ts:255
  • Draft comment:
    Default initialization for missing chat_template is solid; ensure modelSettings.chatTemplate is reliably defined.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
4. web-app/src/hooks/useModelProvider.ts:264
  • Draft comment:
    Adds missing override_tensor_buffer_t default. Confirm that key naming and modelSettings.override_tensor_buffer_t are consistent throughout the app.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. web-app/src/hooks/useModelProvider.ts:280
  • Draft comment:
    Migration version reset to 1; ensure consolidating all migrations under version 0 is intentional and state from higher versions is handled appropriately.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to ensure that consolidating migrations is intentional and that state from higher versions is handled. This is a request for confirmation and ensuring behavior, which violates the rules.

Workflow ID: wflow_3CExrjrYzrzDsSRL

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@louis-jan louis-jan left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

Barecheck - Code coverage report

Total: 28.69%

Your code coverage diff: 0.03% ▴

Uncovered files and lines
FileLines
web-app/src/hooks/useModelProvider.ts33-38, 40-41, 44-54, 56, 58-65, 67-69, 71-104, 106-136, 138-149, 159-161, 163, 165-167, 170-173, 175-176, 178, 180-182, 184-197, 199-202, 204-209, 215, 230-231, 233-241, 244-246, 249-252, 255-262, 264-276, 278-279

@urmauur urmauur merged commit 985a8f3 into release/v0.6.8 Aug 13, 2025
17 checks passed
@urmauur urmauur deleted the fix/migration-model-setting branch August 13, 2025 11:21
@github-project-automation github-project-automation bot moved this to QA in Jan Aug 13, 2025
@github-actions github-actions bot added this to the v0.6.8 milestone Aug 13, 2025
ramonpzg pushed a commit that referenced this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants