mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:21:09 +02:00
fix(shared-llm): sort candidate tiers privacy-first (browser before server)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
64b8ab30ad
commit
716466e757
1 changed files with 6 additions and 2 deletions
|
|
@ -227,8 +227,12 @@ export class LlmOrchestrator {
|
||||||
* - Rule 2: sensitive content excludes mana-server + cloud
|
* - Rule 2: sensitive content excludes mana-server + cloud
|
||||||
* Also always includes 'none' at the end if the task has runRules. */
|
* Also always includes 'none' at the end if the task has runRules. */
|
||||||
private candidateTiers<TIn, TOut>(task: LlmTask<TIn, TOut>): LlmTier[] {
|
private candidateTiers<TIn, TOut>(task: LlmTask<TIn, TOut>): LlmTier[] {
|
||||||
// Start from the user's allowed tiers, in their preference order
|
// Sort by privacy gradient (most private first) so the browser tier
|
||||||
let tiers = this.settings.allowedTiers.filter((t) => TIER_RANK[t] >= TIER_RANK[task.minTier]);
|
// always wins over mana-server when both are enabled, regardless of
|
||||||
|
// the order the user toggled them in settings.
|
||||||
|
let tiers = this.settings.allowedTiers
|
||||||
|
.filter((t) => TIER_RANK[t] >= TIER_RANK[task.minTier])
|
||||||
|
.sort((a, b) => TIER_RANK[a] - TIER_RANK[b]);
|
||||||
|
|
||||||
// Rule 2: sensitive content backstop
|
// Rule 2: sensitive content backstop
|
||||||
if (task.contentClass === 'sensitive') {
|
if (task.contentClass === 'sensitive') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue