Commit Graph
3 Commits
Author SHA1 Message Date
GandClaude Opus 5 caa0e41c3b chore: add a formatter (#449)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (1062 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(lint): reattach two guards the reformat detached

Both effects were one-liners, so a trailing eslint-disable-line covered the
setState call:

  useEffect(() => { setSelected(new Set()); }, [q.length]); // eslint-disable-line ...

prettier expanded the block. The comment stayed on the closing line while the
call moved above it, so the guard protected nothing and the rule its author had
deliberately silenced failed the build.

This is the second shape of the same defect — hirnli had the eslint-disable-NEXT-line
variant. Both come from the same fact: an eslint directive binds to a line
number, so reformatting can silently unbind it, which makes 'mechanical, no
behaviour change' false for any bulk reformat.

* chore(desktop): bump the runner version the reformat requires

desktop-release-drift enforces that anything built into Fleet Runner which
differs from the last released tag must carry a version ahead of that tag —
main read 0.8.15 and fleet-runner-v0.8.15 already shipped.

A whole-repo reformat changes bytes under desktop/, so the gate fires. The
alternative was adding desktop/ to .prettierignore, which would buy a quiet PR
by carving a permanent hole in the formatter's coverage — the precise shape of
silent drift this test was written to catch. Bumping is what the rule asks for
and costs one patch release whose only content is whitespace.

* chore: merge main and re-format

A whole-repo reformat conflicts with any concurrent commit, and a conflicting PR
runs no checks at all while reporting nothing. Conflicts resolved to main,
which is correct because this branch changes formatting and nothing else.

* chore: leave desktop/ out of this reformat

desktop-release-drift is right to refuse this. Everything under desktop/ is
built into Fleet Runner, so changing it means shipping: bump the version AND add
a FLEET_RUNNER_RELEASES entry, whose stated audience is 'person who installed
Fleet Runner and wants to know what changed'. For a whitespace-only build the
honest answer is 'nothing', so that release should not exist — and I should not
write release notes claiming otherwise.

I had bumped to 0.8.16 to get the gate green. That was the wrong direction:
publishing a build to three OS runners to keep a formatting PR quiet. Reverted.

desktop/ is excluded in .prettierignore with the reasoning recorded there, to be
formatted alongside the next real runner change, where the bump and the notes are
true anyway.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 09:23:30 +00:00
d6739a3030 feat(loki): a fallback within one vendor is not a fallback (#294)
Loki's tool loop was pinned to a single vendor, and its only degradation was a
step-down to a SMALLER MODEL AT THAT SAME VENDOR. Once the vendor's daily
budget was spent, every link in the "fallback" drew on the same exhausted pool,
so they all died together. On a free tier that is not a rare edge: Groq grants
100k tokens/day org-wide, shared with the dispatch strategist, form-assist and
autopilot, and one chat turn costs roughly 10k.

The vision half of this repo already learned this, the hard way. vision-models.ts
carries the lesson after four pinned free models rotted: "A CHAIN, not a model.
Free-tier models disappear and rate-limit; a single pin is a scheduled outage."
The chat half never got it. This applies the same shape, so the repo has ONE
answer to this problem instead of two.

  - config/chat-models.ts: CHAT_CHAIN, the SSOT, mirroring VISION_CHAIN. Every
    provider speaks the OpenAI chat-completions shape, so adding a vendor is a
    row in a table rather than a new client.
  - llm.ts walks the chain, and what it does next follows from WHY a link
    refused: `size` continues (another vendor's window may be far larger, and
    the size error is only surfaced once EVERY link refuses, since that is what
    loop.ts sheds facts on); `daily` skips that vendor's remaining models
    wholesale; `capacity` advances. A whole chain refusing on capacity alone is
    the one case where waiting is right, so it waits once, bounded.
  - probe-models.ts probes the whole chain via callModelLinkOnce, NOT the
    walker: a walk reports whoever answered, so probing "is gemma usable?"
    through it would happily return another link's success and pin a dead model.

Every entry was PROBED LIVE before being pinned, not taken from docs. The free
catalogue was enumerated by filtering OpenRouter's /api/v1/models for
pricing.prompt == "0" and supported_parameters containing "tools", then each
candidate was sent a real tool call. Nine links answer; two are excluded on
evidence (gemma-4-31b returned a provider error, nemotron-nano-12b-vl returns
200 with EMPTY content, which a naive client reads as a successful empty
answer).

FIVE of the nine answer only via the TEXT protocol. A native-only loop would
have silently lost most of this chain — the concrete payoff of llm.ts always
parsing both.

Model lists are read from env AT CALL TIME (LOKI_GROQ_MODELS /
LOKI_OPENROUTER_MODELS), so routing around the next rotted model is an env
change on the box rather than a redeploy. A value frozen at import would have
needed the very delay the override exists to avoid.

agent-name-lookup.ts asserted the old SMALL_MODEL constant. Its INTENT was "a
rate limit must step down, not abandon the tools" — which the chain serves
better — so the assertion is rewritten to that intent and gains a guard that
the chain spans 2+ vendors, the property that makes it worth having.

Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 12:43:36 +00:00
0314e313ee fix(loki): vision is a provider chain, not a pinned model that rots (#220)
* fix(loki): vision is a provider chain, not a pinned model that rots

Every screenshot attached to Loki has been failing. GROQ_VISION_MODEL
pinned meta-llama/llama-4-scout-17b-16e-instruct, which is DECOMMISSIONED
— 404 — and Groq now serves no vision model at all on this account. Found
while probing models for the tool loop, not by anyone using the feature,
which is the part worth fixing.

This is the fourth pinned-free-model rot in this fleet, so it gets the
class treatment rather than a new pin:

  config/vision-models.ts  a CHAIN across providers, tried in order.
                           Entries are OpenAI-compatible, so adding a
                           provider is a row, not a client. Groq keeps a
                           seat with no default model so restoring one is
                           one string.
  lib/vision.ts            walks the chain, first real answer wins.
  probe-models.ts          now probes BOTH halves — chat tool-calling AND
                           vision — with a real image. `npm run probe:models`.

"Real answer" is load-bearing: nvidia/nemotron-nano-12b-v2-vl returns
HTTP 200 with EMPTY content, which a naive client reports as a successful
analysis of nothing — reading to the user as "nothing notable in your
screenshot" rather than as a failure. Empty is treated as a dead link and
the chain continues.

Verified live against a solid-colour test image:
  google/gemma-4-26b-a4b-it:free  -> 200, correctly answered "Red"   OK
  google/gemma-4-31b-it:free      -> 429 rate limited                fallback
  nvidia/nemotron-nano-12b-v2-vl  -> 200 but empty                   excluded

FleetCrown had no vision-capable credential at all; it now shares
orangecat's OPENROUTER_API_KEY (added to /opt/fleetcrown/app/.env on the
box, which deploy.sh bootstraps into shared/ on the next release).

Retires callGroqVision + GROQ_VISION_MODEL — one caller, now on the chain,
and leaving a dead constant is how the next person re-pins a dead model.

The analysis block now names the model that read the image: it is the one
part of a Loki turn NOT grounded in FleetCrown's records, and saying so
keeps it from blending into the cited answer around it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(lint): drop the import orphaned by retiring callGroqVision

HTTP_TIMEOUT_XL_MS lost its only user when the Groq vision path was
retired. Caught by CI, not locally, because I linted the files I had
touched instead of the repo — and the orphan is by definition in a file
the change did not add a line to. Run `npm run lint`, not eslint on a
path list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 13:17:02 +00:00