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
GandClaude Opus 4.8 c0372977bd fix(ux): audit quick-wins + always-surface capacity banner (#31)
* fix(ux): quick-win batch from the action audit

Four honest/routing fixes surfaced by the full UX audit:
- proxy.ts: /privacy /terms /license /docs/quickstart were auth-gated (missing
  from the public matcher) — logged-out footer clicks bounced to sign-in. Now public.
- projects/[id] GET: the response omitted gitUrl, so the project detail DRAWER
  showed no repo link for GitHub-imported projects (the grid card worked). Added.
- DesktopDownload: macOS + Windows were marked status:'ready' but ship no asset
  (Linux-only) → the auto-detected Download CTA 404'd. Flipped to 'comingSoon'
  and added the ComingSoonPanel branch (watch-releases + use-web CTA) the config
  comment always promised but was never implemented.
- changelog.ts: added the real v0.8.9 entry (was stale at 0.8.8 vs the live
  release) so the footer version pill + /releases are current.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(control): always surface the capacity banner when autopilot can't act

Chasing the auto-reroute banner gate (after the SSE/GET session fix made the
data correct) revealed a UX gap: shouldShowManualCapacityBanner returned false
under autopilot for 'tab-closed' — so a project that hit a rate-limit wall but
isn't running showed NO indicator and NO call to action. A capacity wall must
never be silently invisible.

Now surfaces the manual banner under autopilot whenever autopilot CANNOT act on
its own (all-tried / no-fallback / tab-closed). For a not-running project,
clicking Switch still persists the agent preference for the next launch. When
autopilot CAN act, the auto banner shows instead. Test asserts the tab-closed case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 22:45:42 +02:00
GandClaude Opus 4.8 2e407f34a6 feat(control): headless auto-reroute agents off capacity walls under autopilot (#27)
* feat(control): auto-reroute agents on capacity walls under autopilot

Closes the loop from 'we can resolve a fallback' to 'we reroute live.' When
a project hits a rate-limit/quota wall (detectCapacityIssueFromProject) and
autopilot is on, FleetCrown now switches to the next installed fallback agent
itself via the existing switch-agent path — no human click. With autopilot
off, the manual CapacityIssueBanner is unchanged.

- src/lib/auto-reroute.ts: pure, tested decision (decideAutoReroute +
  shouldShowManualCapacityBanner). Loop-safe: AGENT_FALLBACK_ORDER cycles, so
  a per-episode tried-set stops an all-exhausted fleet from churning and
  surfaces a manual banner instead.
- ProjectCard: act once per distinct session state (mtime + outgoing agent)
  so a switch landing (which lags the poll) can't re-fire or flash a false
  'exhausted'; autopilot-gated; reuses performAgentSwitch.
- CapacityIssueBanner: 'auto' (switching…) and 'exhausted' variants.
- scripts/test/auto-reroute.ts (npm run test:auto-reroute): 12 cases incl.
  loop safety + skip-gate priority.

First increment (client/control surface). Follow-up: same decision server-side
in the beacon path for headless reroute when no browser is open.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(beacon): headless auto-reroute on capacity walls (no browser needed)

Increment 2: the /control auto-reroute only fires while the page is open.
The beacon path runs server-side when an agent's session ends, so it reroutes
unattended — the real fleet-operation win. The beacon already detected the
capacity issue + computed the fallback (resolveNextAvailableAgent) and only
stored it; now it acts.

- src/lib/auto-reroute.ts: decideHeadlessReroute + MAX_AUTO_REROUTES_PER_WINDOW.
  Loop safety without a client ref = DB guard: cap auto-switches per project
  per 15-min window (one full fallback cycle, then stop) + skip while a switch
  is still unclaimed.
- db/queries/pending-commands.ts: recentSwitchAgentStats(userId, tab) →
  {windowCount, pending}, windowed so a dead unclaimed command can't block.
- api/beacon/route.ts: on capacityIssue, resolve effective autopilot
  (per-project override ?? global) + dir/tab, then enqueue switch_agent.
  Best-effort — never blocks or fails beacon creation.
- 7 new headless test cases (19 total).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 07:08:22 +02:00