Skip to content

fix(core): make autoUpdateConversationModel work without rule - #1020

Closed
dingyi222666 wants to merge 1 commit into
v1-devfrom
fix/auto-update-model-rule
Closed

dingyi222666 wants to merge 1 commit into
v1-devfrom
fix/auto-update-model-rule

Conversation

@dingyi222666

Copy link
Copy Markdown
Member

Fixes #1012

Root cause: the auto-update trigger in resolve_conversation required
resolved.constraint.autoUpdateModel === true, but resolveConstraint
defaulted autoUpdateModel to undefined when no rule was configured for the
route. So undefined === true was always false and the global
autoUpdateConversationModel switch never took effect.

Fix: default autoUpdateModel to true in resolveConstraint when no rule
sets it. The global switch now works as documented; per-route opt-out is still
possible via rule autoUpdateModel: false or fixedModel.

The trigger condition required resolved.constraint.autoUpdateModel === true,
but autoUpdateModel defaulted to undefined when no rule was configured,
so the global autoUpdateConversationModel switch never took effect.
Default it to true so the global switch works; rule autoUpdateModel/fixedModel
can still opt out per-route.

Closes #1012
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb25b337-ce66-450a-b587-ee3d3055f26e

📥 Commits

Reviewing files that changed from the base of the PR and between f6efb03 and 4eda170.

📒 Files selected for processing (1)
  • packages/core/src/services/conversation.ts

Walkthrough

resolveConstraint 在未显式配置 autoUpdateModel 时将其设为 true。显式配置的值保持不变。

Changes

会话模型约束

Layer / File(s) Summary
解析 autoUpdateModel 默认值
packages/core/src/services/conversation.ts
resolveConstraint 在 autoUpdateModel 未定义时返回 true,否则返回已配置的值。

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • ChatLunaLab/chatluna#990:同样修改 packages/core/src/services/conversation.ts 中的 resolveConstraint,并引入了 autoUpdateModel 字段。

Poem

兔子看见默认值,
未配置时跳向 true。
显式设置仍保留,
会话模型随约束。
代码改动轻又稳,
胡萝卜庆祝此修复。

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/auto-update-model-rule

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dingyi222666

Copy link
Copy Markdown
Member Author

关闭此 PR,修复直接合入 #1015

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: ChatLuna主插件的"autoUpdateConversationModel"配置项未发挥作用

1 participant