mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:01:08 +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
|
||||
* Also always includes 'none' at the end if the task has runRules. */
|
||||
private candidateTiers<TIn, TOut>(task: LlmTask<TIn, TOut>): LlmTier[] {
|
||||
// Start from the user's allowed tiers, in their preference order
|
||||
let tiers = this.settings.allowedTiers.filter((t) => TIER_RANK[t] >= TIER_RANK[task.minTier]);
|
||||
// Sort by privacy gradient (most private first) so the browser tier
|
||||
// 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
|
||||
if (task.contentClass === 'sensitive') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue