The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(moa): label the aggregator as the acting, billed model across CLI and Desktop
Konstantin Khlopkov0a433320095a
diff --git a/apps/desktop/src/app/settings/model-settings.test.tsx b/apps/desktop/src/app/settings/model-settings.test.tsxindex 457c8b0ac4b..210b912f8ea 100644--- a/apps/desktop/src/app/settings/model-settings.test.tsx+++ b/apps/desktop/src/app/settings/model-settings.test.tsx@@ -677,6 +677,18 @@ describe('ModelSettings MoA preset editor', () => {vi.useRealTimers()}})++ it('labels the aggregator as the acting, billed model and references as advising', async () => {+ await openReferenceEditor()++ // The aggregator row must carry the acting/billed pill right next to its+ // title — this is the slot that pays for the whole tool loop.+ expect(screen.getByText('acting model · billed for the run')).toBeTruthy()+ // Reference rows say what they actually do: advise once per user turn.+ expect(screen.getAllByText('advises once per turn')).toHaveLength(2)+ // The section blurb spells out the billing consequence.+ expect(screen.getByText(/billed to its provider/i)).toBeTruthy()+ })})describe('ModelSettings code-skew 503', () => {diff --git a/apps/desktop/src/app/settings/model-settings.tsx b/apps/desktop/src/app/settings/model-settings.tsxindex 5f7ad82ebfc..976e11bbde6 100644--- a/apps/desktop/src/app/settings/model-settings.tsx+++ b/apps/desktop/src/app/settings/model-settings.tsx@@ -1159,7 +1159,8 @@ export function ModelSettings({ onMainModelChanged, scopeProfile }: ModelSetting<SectionHeading icon={Cpu} title={m.moaTitle} /><p className="mb-2 text-xs text-muted-foreground">Configure named presets that appear as models under the Mixture of Agents provider. The aggregator is the- acting model.+ acting model — it runs every step of the tool loop, and almost all of the run's cost is billed to its+ provider. References only advise once per user turn.</p><div className="mb-2 flex flex-wrap items-center gap-2"><Select onValueChange={setSelectedMoaPreset} value={selectedMoaPreset || moa.default_preset}>@@ -1349,7 +1350,12 @@ export function ModelSettings({ onMainModelChanged, scopeProfile }: ModelSetting</span>}key={`${selectedMoaPreset}-${index}`}- title={`Reference ${index + 1}`}+ title={+ <span className="flex items-baseline gap-2">+ {`Reference ${index + 1}`}+ <Pill>{m.moaReferenceHint}</Pill>+ </span>+ }/>))}<Button@@ -1425,7 +1431,12 @@ export function ModelSettings({ onMainModelChanged, scopeProfile }: ModelSetting{currentMoaPreset.aggregator.provider} · {currentMoaPreset.aggregator.model}</span>}- title={m.moaAggregator}+ title={+ <span className="flex items-baseline gap-2">+ {m.moaAggregator}+ <Pill>{m.moaAggregatorBilled}</Pill>+ </span>+ }/></div></section>diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 0936e4a16a8..1fd3e42edbc 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -1386,6 +1386,8 @@ export const en: Translations = {moaTitle: 'Mixture of Agents',moaPreset: 'Preset',moaAggregator: 'Aggregator',+ moaAggregatorBilled: 'acting model · billed for the run',+ moaReferenceHint: 'advises once per turn',tasks: {vision: { label: 'Vision', hint: 'Image analysis' },compression: { label: 'Compression', hint: 'Context compaction' },diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex be00e213166..9783760017f 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -1233,6 +1233,8 @@ export interface Translations {moaTitle: stringmoaPreset: stringmoaAggregator: string+ moaAggregatorBilled: string+ moaReferenceHint: stringtasks: Record<string, AuxTaskCopy>}localModels: {diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.tsindex 663c44ff0bf..71e39a85b54 100644--- a/apps/desktop/src/i18n/zh-hant.ts+++ b/apps/desktop/src/i18n/zh-hant.ts@@ -1220,6 +1220,8 @@ export const zhHant = defineLocale({moaTitle: '混合代理(Mixture of Agents)',moaPreset: '預設',moaAggregator: '聚合模型',+ moaAggregatorBilled: '執行模型 · 整個運行在此計費',+ moaReferenceHint: '每輪僅建議一次',tasks: {vision: { label: '視覺', hint: '圖片分析' },compression: { label: '壓縮', hint: '上下文壓縮' },diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex ce03838a678..7b9c09b5121 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -1581,6 +1581,8 @@ export const zh = defineLocale({moaTitle: '混合智能体(Mixture of Agents)',moaPreset: '预设',moaAggregator: '聚合模型',+ moaAggregatorBilled: '执行模型 · 整个运行在此计费',+ moaReferenceHint: '每轮仅建议一次',tasks: {vision: { label: '视觉', hint: '图片分析' },compression: { label: '压缩', hint: '上下文压缩' },diff --git a/hermes_cli/moa_cmd.py b/hermes_cli/moa_cmd.pyindex eb2939f6224..3a9d3dd9d36 100644--- a/hermes_cli/moa_cmd.py+++ b/hermes_cli/moa_cmd.py@@ -69,6 +69,28 @@ def _format_slot(slot: dict[str, Any]) -> str:return f"{label} [reasoning={effort}]" if effort else label+def _provider_mismatch_notice(+ cfg: dict[str, Any], aggregator: dict[str, Any]+) -> str | None:+ main_provider = ""+ if isinstance(cfg, dict):+ model_section = cfg.get("model")+ if isinstance(model_section, dict):+ main_provider = str(model_section.get("provider") or "").strip()+ agg_provider = str((aggregator or {}).get("provider") or "").strip()+ if (+ not main_provider+ or not agg_provider+ or main_provider == "moa"+ or main_provider == agg_provider+ ):+ return None+ return (+ f"Aggregator is on {agg_provider}; the whole tool loop will be billed there, "+ f"not to {main_provider}."+ )++def _print_config(config: dict[str, Any]) -> None:cfg = _moa_section(config)print("Mixture of Agents presets")@@ -76,10 +98,16 @@ def _print_config(config: dict[str, Any]) -> None:print(f"Active in config: {cfg.get('active_preset') or '(off)'}")for name, preset in cfg["presets"].items():print(f"\n{'*' if name == cfg['default_preset'] else ' '} {name}")- print(" Reference models:")+ print(" Reference models (advise once per user turn):")for idx, slot in enumerate(preset["reference_models"], start=1):print(f" {idx}. {_format_slot(slot)}")- print(f" Aggregator: {_format_slot(preset['aggregator'])}")+ agg_slot = preset["aggregator"]+ print(+ f" Aggregator: {_format_slot(agg_slot)} (acting model — runs every step and carries almost all of the cost)"+ )+ notice = _provider_mismatch_notice(config, agg_slot)+ if notice:+ print(f" note: {notice}")def _moa_section(cfg: Any) -> dict[str, Any]:@@ -111,11 +139,17 @@ def _cmd_configure(cfg: dict, args) -> None:if _prompt_choice("Add another reference model?", ["Add another", "Done"], 1) == 1:breakprint("Configure aggregator model.")+ print(+ "The aggregator is the acting model: it runs every tool-loop step, and almost all of the run's cost lands on its provider."+ )current = dict(current)current["reference_models"] = refscurrent["aggregator"] = _pick_slot(current.get("aggregator"))moa["presets"][preset_name] = currentmoa.setdefault("default_preset", preset_name)+ notice = _provider_mismatch_notice(cfg, current["aggregator"])+ if notice:+ print(notice)_save(cfg, moa)print(f"Saved MoA preset: {preset_name}")_print_config(cfg)diff --git a/hermes_cli/model_setup_flows.py b/hermes_cli/model_setup_flows.pyindex d5a7b7ba845..adb68670448 100644--- a/hermes_cli/model_setup_flows.py+++ b/hermes_cli/model_setup_flows.py@@ -113,14 +113,14 @@ def _model_flow_moa(config, current_model=""):names = list(presets.keys())default_name = moa.get("default_preset") or names[0]- # Rows show the aggregator so the picker is informative before drilling in.+ # Rows show the aggregator as the acting/billed model so the picker is informative before drilling in.rows = []for n in names:agg = presets[n].get("aggregator") or {}agg_label = f"{agg.get('provider')}:{agg.get('model')}" if agg else ""ref_count = len(presets[n].get("reference_models") or [])suffix = " ← default" if n == default_name else ""- rows.append(f"{n} (agg {agg_label}, {ref_count} refs){suffix}")+ rows.append(f"{n} (acting: {agg_label}, {ref_count} refs){suffix}")default_idx = names.index(default_name) if default_name in names else 0title = "Select a Mixture of Agents preset:"@@ -151,11 +151,18 @@ def _model_flow_moa(config, current_model=""):_save_model_choice(selected_name)preset = presets[selected_name]- _say("", f"Default model set to: {selected_name} (via Mixture of Agents)", f" Preset: {selected_name}", " Reference models:")+ _say(+ "",+ f"Default model set to: {selected_name} (via Mixture of Agents)",+ f" Preset: {selected_name}",+ " Reference models (advise once per user turn):",+ )for i, slot in enumerate(preset.get("reference_models") or [], start=1):print(f" {i}. {slot.get('provider')}:{slot.get('model')}")agg = preset.get("aggregator") or {}- print(f" Aggregator: {agg.get('provider')}:{agg.get('model')}")+ print(+ f" Aggregator: {agg.get('provider')}:{agg.get('model')} (acting model — runs every step and carries almost all of the cost)"+ )def _nous_login_args(args) -> argparse.Namespace:diff --git a/tests/hermes_cli/test_moa_config.py b/tests/hermes_cli/test_moa_config.pyindex 996a2c1c848..293337da330 100644--- a/tests/hermes_cli/test_moa_config.py+++ b/tests/hermes_cli/test_moa_config.py@@ -156,6 +156,42 @@ def test_validate_moa_payload_agrees_with_clean_slot():assert cfg["presets"]["p"]["aggregator"] == payload["presets"]["p"]["aggregator"]+def test_aggregator_billing_hint_in_print_config(capsys):+ from hermes_cli import moa_cmd++ moa_cmd._print_config({"model": {"provider": "openai-codex"}})++ out = capsys.readouterr().out+ assert "acting model — runs every step" in out+ assert "advise once per user turn" in out+ # The main provider differs from the preset's aggregator (openrouter by+ # default) → the billing notice must fire and name both providers.+ assert (+ "Aggregator is on openrouter; the whole tool loop will be billed there, not to openai-codex."+ in out+ )+++def test_no_billing_notice_when_aggregator_matches_main_provider(capsys):+ from hermes_cli import moa_cmd++ cfg = {"model": {"provider": "openrouter"}}++ moa_cmd._print_config(cfg)++ out = capsys.readouterr().out+ assert "acting model — runs every step" in out+ assert "Aggregator is on" not in out+++def test_billing_notice_silent_without_main_provider(capsys):+ from hermes_cli import moa_cmd++ moa_cmd._print_config({})++ assert "Aggregator is on" not in capsys.readouterr().out++# ── Per-slot max_tokens ────────────────────────────────────────────────────