Section 10

Fusion / Model Council

Set up the local Fusion / Model Council workflow for this repo.


setup agent prompt
Set up the local Fusion / Model Council workflow for this repo.

1. Resolve the Fusion skill first. Prefer the bundled `skills/fusion/SKILL.md` when it exists; otherwise inspect `~/.agents/skills/fusion/SKILL.md`. Read the skill before changing config or running a panel. Do not substitute Oracle or another review tool for the local Fusion CLI.

2. Inspect the local Fusion checkout when available at `~/dev/fusion`. Check `README.md`, `package.json`, `src/fusion.js`, `fusion.config.example.json`, and the preset configs under `configs/` (`low.json`, `medium.json`, `high.json`, `quality.json`). Use the checkout to understand the installed CLI and presets; do not paste private config values into your report.

3. Verify the command wrappers are available:
   `command -v fusion fusion-med fusion-high`
   If a wrapper is missing, inspect `~/dev/fusion` and use the install/link path supported by that checkout, commonly `npm install` followed by `npm link`, then re-check the wrappers. Do not overwrite an existing unrelated global binary without reporting the conflict.

4. Run provider preflight before any real council run. Use the selected preset's list command, usually:
   `fusion-high --list-providers`
   For moderate planning, also check:
   `fusion-med --list-providers`
   Report the configured provider ids, unavailable providers, provider families, and whether the expected Claude/Opus slot is present. The point is a mixed council: OpenAI-style breadth, Anthropic-style critique, Z.ai/GLM or other coding-model pressure, plus any configured local specialists. Treat a missing Opus-class provider as a quality gap to report, not an automatic reason to invent a different workflow.

5. Use durable prompt files for real questions. Create or identify a repo-local prompt file and pass it with `--file`; do not send long briefs through fragile shell quoting. The prompt file should include the decision, relevant repo paths, constraints, commands already run, observed failures, candidate options, verification expectations, and the recommendation format needed.

6. Use `--dry-run` when provider ids, config paths, wrapper behavior, or output location are uncertain:
   `fusion-high --dry-run --file path/to/prompt.md`
   Then run the full configured panel only after the command shape is clear:
   `fusion-high --file path/to/prompt.md`

7. Let Fusion use its default session store unless a repo-local run directory is explicitly requested. Normal runs write under `~/.fusion/sessions/YYYY/MM/DD/<session-id>/` and update `~/.fusion/sessions.jsonl`. Expected artifacts include `run.json`, `panel-*.stdout.md`, `panel-*.stderr.txt`, `finalizer-report.json`, `summary.json`, and `final.md`.

8. Wait for terminal provider states before recommending anything. Valid terminal states include `ok`, `failed`, `timedOut`, `quotaLimited`, `spawnError`, and `interrupted`. While a run is active, use `panel-status.json` or Fusion heartbeat output for status only. Do not act from early `panel-*` artifacts.

9. Continue only after Fusion exits and both `summary.json` and `final.md` have been read, or after a real terminal failure or interruption has been captured. `summary.json` should provide run status, provider states, timings, and artifact paths. `final.md` should provide the council recommendation.

10. Handle quota and rate failures as degraded council input. If a provider hits quota, rate limit, usage limit, 429 exhaustion, timeout, or another terminal failure after artifacts exist, name the provider, preserve the remaining outputs, and continue with the available panel. If a Kimi provider fails preflight with `auth.login_required`, report the Kimi auth failure and rerun once with `--only` set to the other configured provider ids. Do not use `--only` for ordinary narrowing unless explicitly requested.

11. Keep the OpenRouter comparison precise. Local Fusion is a local CLI inspired by the panel, comparison, and final-answer pattern. It is not the hosted OpenRouter Fusion product. Treat OpenRouter and Fable claims as context, not proof that every local run improves every task.

12. Respect privacy boundaries. Do not paste tokens, cookies, API keys, key-helper output, full environment dumps, private endpoints, or raw private session artifacts. Summarize sensitive material with redacted facts, provider states, paths, consensus, disagreements, and decision-relevant excerpts only.

13. Report setup and run results plainly: skill path used, local checkout status, wrapper paths, provider preflight result, provider mix, Opus-class provider present or missing, prompt file path, dry-run result when used, session path, terminal provider states, whether `summary.json` and `final.md` were read, quota/rate handling, consensus, contradictions, unique insights, blind spots, synthesized recommendation, repo evidence used to accept or reject the council output, and verification commands to run next.

14. Treat Fusion output as advisory. Do not start implementation until the council output has been reconciled with repo evidence and the final engineering call is clear.

Workflow route

Fusion / Model Council

Set up the local Fusion / Model Council workflow for this repo.

Eggo synthesizes multiple provider notes into one final recommendation for the Fusion / Model Council workflow.
Intent

Name the decision that needs more than one model perspective.

Evidence

Give every council member the same bounded repo evidence.

Route

Run the configured OpenAI, Anthropic, Z.ai/GLM, or other provider panel.

Verify

Read the synthesis, then reconcile it with project proof.

  1. Big Idea
  2. Try This Now
  3. Skill Reference Or Files To Inspect
  4. When To Reach For This
  5. How This Used To Work
  6. The Mental Model
different model notes feed one synthesized recommendation

Big Idea

Use Fusion when one model’s answer is too small a surface area for the decision.

Fusion is a local model council workflow. The win is not that models argue for sport. The win is that different model families and provider stacks make different mistakes, notice different risks, and bring different habits to the same bounded software question. Fusion runs those perspectives in parallel, then synthesizes the strongest result.

snippet-1
one hard software question
-> several independent model/provider perspectives
-> comparison of consensus, contradictions, unique insights, and blind spots
-> finalizer / synthesizer
-> fused recommendation
-> human engineering judgment

It is not for tiny edits.

Try This Now

Use Fusion when multiple perspectives can improve the decision. Start with: fusion-high --list-providers. For a risky strategy choice, ask the agent to write a prompt file, run the full panel, then read summary.json and final.md.

Good use:

snippet-2
Should this billing webhook fix use provider event ids, invoice locks, or a processing ledger?

Bad use:

snippet-3
Rename this variable.

Fusion is most useful when different strong models may notice different risks:

The point is not voting. The point is coverage. One model might catch the schema risk, another the rollout problem, another the security boundary, and another the boring test nobody wanted to write. The finalizer should turn that spread into one usable recommendation.

Skill Reference Or Files To Inspect

Bundled skill:

snippet-4
skills/fusion/SKILL.md

Common local source checkout:

snippet-5
~/dev/fusion

Common local skill install:

snippet-6
~/.agents/skills/fusion/SKILL.md

Local Fusion source files to inspect when needed:

Keep command details in the skill. This file explains when to ask for Fusion, what the agent should do, and how to confirm the council output was actually used.

When To Reach For This

Use Fusion when the cost of a missed perspective is higher than the cost of a slower council run.

Use Fusion ForWhy
checkout saved payment architectureUI, data, auth, provider, and rollback risks need different reviewers
billing webhook double-processingone model may prefer event ids, another may notice invoice-level locking or ledger recovery
auth/session refresh designsecurity, migration, UX, and rollback perspectives all matter
model outage fallbackprovider diversity keeps one model failure from defining the plan
risky refactorone model catches coupling, another catches migration order, another catches missing tests
debugging plandifferent models may pursue different plausible causes before the finalizer narrows them
code review before implementationthe council can preserve minority warnings a single answer would flatten

Skip Fusion when:

Rule:

snippet-7
Use Fusion when the answer should come from a council, not a monologue.

How This Used To Work

What you used to expect:

snippet-8
Ask one strong model for the answer and trust it if it sounds confident.

What this workflow gives you now:

snippet-9
Ask several independent models the same bounded software question, let each one
take its own path, then synthesize the useful overlap and the useful surprises.

What you used to expect:

snippet-10
The first model that finishes can unblock the work.

What this workflow gives you now:

snippet-11
Partial provider output is not the answer. The answer starts after Fusion writes
summary and final artifacts, because the value is in the comparison and synthesis.

The Mental Model

snippet-12
prompt file
-> provider panel from different model families
-> terminal provider states
-> judge/finalizer comparison
-> synthesis
-> summary.json
-> final.md
-> implementation decision
ConceptMeaning
prompt filethe bounded software question and evidence
provider panelOpenAI, Anthropic, Z.ai/GLM, Gemini, Kimi, OpenCode, Codex, Claude, Agy, or other configured voices running independent passes
terminal stateeach provider finished, failed, timed out, hit quota, or was interrupted
finalizercompares panel output, preserves consensus, contradictions, unique insights, and blind spots, then writes a final recommendation
summary.jsonrun status, provider states, timings, artifact paths
final.mdfinal council output to read before acting
panel artifactsuseful but partial until the run is complete

Local Fusion shells out to local CLIs. It is not the same product as OpenRouter Fusion.

snippet-13
OpenRouter Fusion is a hosted product.
Local Fusion is a local CLI implementation inspired by the same useful pattern:
panel -> judge/finalizer -> synthesis -> final answer.

Local Fusion runs through configured local commands such as Codex, Claude, Agy, and OpenCode. Those commands can point at different model families and providers, including OpenAI, Anthropic, Z.ai/GLM, Gemini, Kimi, or other local account wiring. Provider availability, cost, quotas, auth, and data handling depend on the local CLI accounts and config.

Origin Story To Keep Straight

The practical origin story is:

snippet-14
Do not anchor serious work to one model's blind spots.
Use multiple independent model/provider perspectives when the decision is expensive.
Synthesize the council output so the final choice carries both consensus and caveats.

OpenRouter Fusion made the pattern visible in a hosted product: send one prompt to a panel of models, have a judge analyze the answers, then produce a fused response. OpenRouter reported that its Fusion tests on DRACO deep research tasks showed panels beating individual models, including budget panels approaching frontier-model performance.

The Fable 5 availability shock sharpened a related lesson: model access can change. Hard-coded single-model workflows are brittle. A council or fallback pattern keeps important work moving when one model disappears, rate-limits, or underperforms.

Careful wording:

What Local Fusion Does

Local Fusion:

Current default run artifacts usually live under:

snippet-15
~/.fusion/sessions/YYYY/MM/DD/<session-id>/

Common artifacts:

Treat these as private by default. They may contain prompts, source snippets, commands, stdout, stderr, and model responses.

Command Shape

Ask the agent to use the skill. Do not memorize every flag.

Common shape:

bash
fusion-high --list-providers
fusion-high --dry-run --file path/to/prompt.md
fusion-high --file path/to/prompt.md

Moderate planning:

bash
fusion-med --list-providers
fusion-med --file path/to/prompt.md

Custom config:

bash
fusion --config path/to/fusion.config.json --file path/to/prompt.md

Long prompt rule:

snippet-19
Write a prompt file and use --file.

Do not make the agent jam a long implementation brief through fragile shell quoting.

Prompt Shape

Use a bounded software question, and name the perspectives you want the council to cover.

markdown
# Fusion Prompt

## Goal

Choose the safest first implementation strategy for duplicate billing webhook processing.

## Council Perspectives

- architecture reviewer: data model, boundaries, rollback
- security reviewer: replay, idempotency, abuse cases
- implementation reviewer: smallest patch and tests
- operations reviewer: observability, retry behavior, degraded states

## Current Evidence

- provider sends repeated paid invoice events
- current handler sometimes processes the same invoice twice
- suspected files:
  - src/billing/webhook.ts
  - src/billing/idempotency.ts
  - tests/billing/webhook.test.ts

## Candidate Strategies

- provider event id guard
- invoice-level processing lock
- webhook processing ledger

## Constraints

- do not change provider contract
- avoid schema changes in the first pass unless the council strongly argues for it
- preserve existing invoice state transitions
- prefer the smallest patch that can be tested

## Verification

- pnpm test billing-webhook -- --runInBand
- pnpm build

## Ask

Compare the strategies. Identify consensus, contradictions, unique insights,
blind spots, missing tests, and the first shippable slice. Synthesize one
recommendation that keeps the best argument from each useful perspective.
End with rollback notes and the proof commands to run.

Ask The Agent This

Use Fusion for architecture choice:

snippet-21
Use the $fusion skill.

We need to choose the first implementation strategy for duplicate billing webhook
processing. Write a prompt file that compares provider event id guard,
invoice-level processing lock, and webhook processing ledger.

First list providers and report the provider/model-family mix. Then dry-run the command, then run the full configured panel.
Wait for Fusion to finish. Read summary.json and final.md before recommending a
path. Show consensus, contradictions, unique insights, and blind spots. Do not
implement until the synthesized council output has been reconciled with repo evidence.

Use Fusion for auth/session review:

snippet-22
Use the $fusion skill.

Review the auth/session refresh-token rotation plan. The decision is whether to
put rotation in middleware, the session store, or an explicit auth workflow
boundary. Include likely files, constraints, migration risk, rollback risk, and
verification commands in the prompt file.

Run the full configured Fusion panel and wait for terminal provider states.
Read the final artifacts. Then give me the synthesized recommendation, the
minority warnings worth keeping, the recommended first slice, risks, and tests
to run.

Use Fusion for a risky implementation review:

snippet-23
Use the $fusion skill before editing.

The checkout saved payment method implementation touches auth, account billing,
provider customer ids, and checkout UI state. Ask Fusion for independent critique
from different model/provider perspectives: architecture, security, implementation,
and operations. Ask for missing tests, privacy risk, rollback concerns, and the
smallest safe patch.

After Fusion finishes, show the council's consensus, contradictions, unique
insights, blind spots, and synthesized recommendation before making any code change.

Use Fusion for model outage or fallback planning:

snippet-24
Use the $fusion skill.

We need a fallback plan for a model-dependent feature so one model outage does
not take down the app. Ask the council to compare hard-coded model slugs,
provider-layer failover, model fallback chains, and local fallback behavior.

Return the synthesized first shippable config change, the provider failure modes
each model noticed, and what to log when a fallback fires.

What To Confirm / How To Know It Worked

GoalConfirmation
skill invokedagent explicitly says it used $fusion
providers checkedagent ran --list-providers for the selected preset
provider diversity namedagent reports the configured model/provider-family mix
prompt was durableprompt was saved to a file and passed with --file
command shape checkedagent used --dry-run when provider ids or paths were uncertain
full panel waitedagent waited until providers reached terminal states
partial output not overusedagent did not act from only panel-*.stdout.md
final artifacts readagent read summary.json and final.md
degraded providers handledquota, timeout, or failure was reported without throwing away useful outputs
synthesis preservedfinal answer names consensus, contradictions, unique insights, and blind spots
recommendation reconciledfinal answer maps the synthesized recommendation back to repo evidence
implementation stayed separatecode changes happened only after council output was read
private output respectedsession artifacts were not pasted wholesale

Strong proof phrases:

Weak proof phrases:

If It Goes Wrong

Fusion is missing:

bash
command -v fusion fusion-med fusion-high

Then inspect the common local checkout:

bash
cd ~/dev/fusion
npm install
npm link
fusion-med --list-providers

Provider auth fails:

bash
fusion-high --list-providers

Then check the provider CLI directly only when needed. Do not paste tokens, cookies, full environment output, or key-helper config.

One provider hits quota:

snippet-28
Treat it as a degraded council run.

Expected behavior:

Do not restart the whole run just because one provider is unavailable.

Agent acts before Fusion finishes:

snippet-29
Stop the implementation.

Ask for:

snippet-30
Show the Fusion session path, summary.json status, final.md, provider terminal
states, and the council synthesis. Then continue from that output.

Only panel artifacts exist:

snippet-31
Panel artifacts are partial.

Wait for:

If the run was interrupted, use the interrupted summary as explicit failure evidence.

Prompt was too vague:

snippet-32
Bad: Use Fusion to review auth.

Better: Compare middleware-first, session-store-first, and explicit workflow boundary
for refresh-token rotation. Include constraints, likely files, migration risk,
rollback, and verification commands.

Prompt included secrets:

snippet-33
Stop. Rewrite the prompt.

Include file paths, redacted facts, and failure summaries instead of secrets.

Final answer sounds confident but ignores the council:

snippet-34
Extract consensus, contradictions, unsupported claims, unique insights, blind
spots, and the recommendation from the Fusion artifacts. Do not flatten the
council into one confident paragraph.

Fusion Compared To Nearby Workflows

WorkflowUse It ForNot For
Oracle PackXhuge code context and one expensive deep external reviewquick local multi-model disagreement
Section 6 variationscomparing generated implementation candidatescomparing independent model critiques
Fusionhard decision where disagreement matterstiny changes or low-latency work
Impsone narrow tool-shaped lookuparchitecture tradeoffs
Agent markerscapturing a bounded debug momentchoosing among architectural strategies

References And Resources