* fix(privacy): signed-out fleet register and health show only what /fleet shows
/api/fleet/register returned the owner's whole register (hidden rows, internal
descriptions) to anyone. Signed out it now returns /fleet's listed rows with
/fleet's fields only and no description, via one loader shared with the page.
The full register needs the owner's session/token or the control bearer.
/api/health answers ok/status/app to strangers; detail needs the bearer. The
live-commit readers (auto-merge, deploy check, ship-report) move to the
public release receipt.
Co-Authored-By: Claude <noreply@anthropic.com>
* test(unit): quarantine the 12 browser tests an agent sandbox cannot run
Explicit tracked list (scripts/test/quarantine-browser.json), skipped off CI
only and printed as QUARANTINED (no Chromium in sandbox). CI runs all of them.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Registers /api/cron/reminders for heidi (hourly, :41, POST). Heidi's opt-in
"questions are due" email is sent at 18:00 in each learner's own time zone,
so the route is called every hour; its policy sends at most one per person
every other day.
Claude-Session: https://claude.ai/code/session_019MDtmvF6Smf3iMYnGBqi12
Co-authored-by: Claude <noreply@anthropic.com>
When Loki registers a new site for a person, their OrangeCat subject is
written to the site's runtime env as OWNER_ACTOR_IDS (fleet AGENTS.md,
"The back office", rule 2). Only in the run that creates the env, never
over a line already there, and only when the subject is a plain account
id. No linked OrangeCat account: skipped with one log line.
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
Co-authored-by: Claude <noreply@anthropic.com>
* refactor(voice): retire own mic hooks for chatkit Composer and DictationField
The project card's box is chatkit's Composer (through Loki's wrapper); the
project brief and the command palette are DictationField. The microphone
is now the fleet's: retry of a failed take, browser fallback, problems in
words. Deletes use-whisper-mic, use-mic-composer and use-voice-input, and
the dead transcription-polling branch (the route only returns { text }).
use-voice-conversation stays until chatkit's useVoiceMode can end a turn
on a pause with the server leg, speak unasked lines, barge in by voice,
re-arm on silence and expose the input level.
Site template synced from fleet templates/app main (chatkit ^0.44.0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(deps): raise @bitbaum/chatkit to ^0.45.0
DictationField fits any form from 0.45 (controlled, uncontrolled,
react-hook-form). Loki's fields stay controlled; typecheck, lint, the
design check and the composer tests pass unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(widget): chat chunk budget 43 KB for chatkit 0.45
Measured: 42.01 KB gzipped on chatkit 0.42, 42.55 KB on 0.45. The
budget already sat at the old size, so the bump rounded over it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
keller-wake.service failed twice with "Didn't get any sockets passed in":
the proxy was started (an app restart pulls it up through BindsTo) while
keller-wake.socket was not listening, so systemd-socket-proxyd had no
listener to forward and exited 1. The generated proxy unit now Requires and
is ordered After its socket, so any start of the proxy starts the socket and
receives its listener; a socket that cannot bind fails as itself.
The host-check.* glob also matched the host-check.service.d directory, so
every pg-backup run printed "install: omitting directory" and the drop-in
never reached the snapshot. Stage plain files only, and stage the .conf
files in host-check's and hcloud-availability's drop-in directories the
same way the apps' drop-ins already are.
solon, 2026-11-29 15:59 UTC, from the unit's own journal:
Unable to locate executable '/opt/solon/app/launch.sh': No such file
Main process exited, code=exited, status=203/EXEC (restart counter 570)
The site answered 502 until the next good deploy at 16:56.
What happened: a deploy failed its health check and deploy.sh pointed app
back at the previous release. That release was now OLDER than the failed
ones left beside it. disk-gc.sh (hourly, and the disk is at 95 %) keeps the
newest two releases by date and removed the rest without asking which one is
live. disk-cleanup.sh, the manual script, has always protected the live
pointer; the automatic one did not.
- install-disk-gc.sh: tier 3 skips the release app resolves to.
- deploy.sh: after a rollback, remove the failed release and touch the one
the site is back on, so it is the newest by date. deploy.sh is fetched
fresh for every deploy, so this protects the box before the new disk-gc.sh
is installed there, and frees the failed release's space.
test-disk-gc.sh: a new case fails on the old code (live release deleted)
and passes now; a stale release beside it is still removed. 24 passed.
test:ops passes.
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
Run status now reconciles with the runner (lib/run-status), once, in the
run-track loader that /api/control/sessions, Watch and the run and command
routes all read:
- an open run whose agent the runner no longer has (a fresh snapshot taken
after delivery does not list its tab, or the runner reported the agent
exited) is Failed, cause agent_gone, "Agent exited without answering;
Retry" (botsmann 51bbcc27 and loki 3a5a7c2b read Needs you with nothing
listening);
- a finished run is Done or Failed, keeping what is left to do with its
change in nextAction (six sessions read working weeks after their agents
finished);
- the run and command routes take the run's status over the track's live
word, so they cannot disagree with the session list.
A pull request the agent named in its handoff and opened during the run is
the run's even on a branch the runner never saw: an agent working in its own
worktree pushes from another branch than the session's checkout, and run
57632eae's track said "Nothing reached GitHub" beside loki#1747. Loki still
acts only on pull requests from the run's own branches.
Taking a site offline stops its wake socket and proxy and keeps both unit
files. A proxy that was already failed stays in systemd's failed set, the
not-found sweep does not see it, and nothing will start it again. keller-wake
was that record: offline since 2026-11-01, then dispatched with an empty
journal. Offline now clears the failed state, and the sweep clears a wake
proxy whose socket is not enabled. A proxy whose socket is still enabled
still pages.
Hendlar's provision created bitbaum/hendlar on 2026-11-19 (starter commit
and all), then Loki stopped before writing the link. Every retry since asked
GitHub to create it again and got 422, so the project could never start.
On that 422, read the repo back and adopt it only when it is ours: in the
fleet org, under the slug this project would get, carrying the exact
'Started from Loki · <name>' stamp, and linked by no other project. A
hand-made repo of the same name still fails as before.
Why apps hang while systemd calls them active. Every app unit has
MemoryHigh=768M (MemoryMax=1G): above 768M the kernel slows the process
instead of stopping it. Node does not read that. It sizes its heap from the
whole machine and lets garbage pile up past the mark before it collects.
Measured on Solon's production build (a database with no law acts), 930
requests eight at a time:
no limit 775 MB peak (855 and 990 on other runs), 364 MB idle
512 MB heap 585 MB peak, same answers, same speed
On 2026-11-28 solon stopped answering three times while "active", a favicon
took 4 s, and Loki, OrangeCat and Substrata on the same box were fine; the
reconciler also caught substrata, heidi and sites not answering within the
same day. Not proven from the box (no session can read it; forge-ops#29
prints memory.events), but it is the mechanism the unit file itself sets up.
launch.sh.tmpl: start node with --max-old-space-size at 65 % of the lower of
the unit's memory.high and memory.max (768M -> 499). NODE_HEAP_MB or an own
--max-old-space-size in the app's .env wins; a unit with no limit gets no
flag. Setting it from inside the app does not work (v8.setFlagsFromString
after start: 849 MB peak, no better than none).
deploy.sh: launch.sh was written once by sync-infra and never again, so a
template change reached no running app. Each deploy now renders it again
with the generator's own function (lib.sh render_launch, which sync-infra
uses too), keeping the box copy's port, checked with bash -n before it
replaces the old file. The old file is kept and put back on a rollback.
test-launch-template.sh: 8 new behavioural checks. test:ops passes.
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
No loki deploy has shipped since 2026-11-26: apply-schema.sh refused
0140_pictures_in_the_bucket.sql as destructive. Its SQL is additive (two
ADD COLUMNs and a DROP NOT NULL); the hit was its own header comment,
"apply-schema.sh refuses DROP COLUMN, on purpose". strip_bodies now blanks
`--` comments as it already blanks dollar-quoted bodies, line numbers kept.
A statement before a trailing comment still blocks.
test-apply-schema.sh: 55 passed (2 new). 0138-0140 pass the guard; the old
genuinely destructive migrations (0002, 0006, ...) still hit.
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
A message (text and/or photo) from a linked chat that is not /start or
/stop is acknowledged at once and handed, after the response, to
OrangeCat signed with x-loki-signature + issuedAt on the shared
ORANGECAT_WEBHOOK_SECRET rail. OrangeCat stores it in the person's
conversation with the Cat. The Cat's answer comes back through the new
signed POST /api/orangecat/telegram-reply and is sent to that person's
own linked chat with an "Open in OrangeCat" button (the no-button rule
is unchanged). A message that cannot reach the Cat always gets a
one-line reason. The new senders are registered in
docs/telegram-notifications.md.
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T
Co-authored-by: Claude <noreply@anthropic.com>
* feat(media): keep pictures in the private R2 bucket, drain them out of Postgres
The owner's rule: pictures live in Cloudflare R2, not in Postgres or on the
box's disk, and the database gets cleaned up.
- src/lib/media/r2.ts: a small S3 client for R2, SigV4 by hand (node:crypto
+ fetch, no SDK), on the fleet's PHOTOS_S3_* names. Everything is private:
MEDIA_PRIVATE_S3_BUCKET, or private/loki/ in the photos bucket. Unset means
behaviour exactly as before.
- Chat pictures and report screenshots are written to the bucket when it is
configured; the row keeps the key (additive migration 0140: nullable
object_key and screenshot_keys). Reads try the bucket, then the old column.
A write the bucket refuses stays in Postgres, so nothing is lost.
- A throttled drain started from instrumentation moves what Postgres still
holds (chat images, report screenshots, executed commands' attachments):
small batches under a transaction-scoped advisory lock, upload, HEAD to
verify length/type/MD5, then key-and-null in one statement; error backoff,
IMAGE_DRAIN=0 kill switch, progress on /api/health under `media`.
- Commands that have not run keep their base64: runners hold no bucket
credentials. Retry puts moved bytes back before re-sending.
- Bot shots, private tile shots and preview pictures go to the bucket when
configured, the temp folder otherwise; bucket caches keep their age limits.
- Deleting a chat or an account deletes its objects by prefix.
- Dropping the emptied columns stays a manual step (apply-schema.sh refuses
DROP COLUMN): docs/infrastructure/media-storage.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T
* fix(media): private pictures only in MEDIA_PRIVATE_S3_BUCKET, never the photos bucket
The photos bucket (fleet-media) gets a public domain, so a private Loki
picture must never fall back into it. The private store now needs
MEDIA_PRIVATE_S3_BUCKET; unset, or equal to PHOTOS_S3_BUCKET, counts as
unconfigured: pictures stay in Postgres as today, the drain does not run,
and the env check warns in one line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T
---------
Co-authored-by: Claude <noreply@anthropic.com>
Solon stopped answering twice on 2026-11-28 (from 09:15 for ~2 h, and
from ~18:05) while systemd still called solon-app active; the watchdog
paged and nothing else happened until a redeploy. check() now counts
misses per target. After RESTART_AFTER (2, i.e. 10 min) in a row with no
answer or a 502/503/504, it restarts <label>-app if that unit exists, at
most once per RESTART_GAP_S (30 min) so a release that cannot start is not
restarted in a loop, and says RESTARTED (or RESTART FAILED). A 4xx or 500
means the app answered: no restart.
test-watchdog-check.sh: 17 passed (6 new).
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
ADR-0001 build steps 3 and 5 (infrastructure half). apps.conf gains the
`sites` row (port 4042, no domains: Caddy routes to it), so the forge-ops
reconciler deploys bitbaum/sites like any app and the name `sites` is
reserved. sites.caddy holds the preview host, the *.orangecat.ch wildcard and
the customer-domain catch-all, all on-demand TLS behind the engine's ask;
install-sites-caddy.sh installs it only after the engine answers and gives
the same ask answer as hirnli's check for every hirnli host, validates, and
can --undo. Validated against the box's full Caddy config on 2026-11-20.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The browser Loki's agents and Cat Bot already drive (lib/bot-browser) gets
a screen: a third view of a session beside Chat and Terminal, beside the
conversation on a wide screen and in its place on a phone, with the agent
box under it.
- CDP screencast while someone watches (6 fps, newest wins), drawn by the
existing RobotBrowser, which gains onTap
- one wheel: a person's step takes it; every bot step (a look too) answers
TAKEN_OVER until hand-back, and the bot's next look carries handedBack
- the password/code/card refusal shows as "<bot> needs you" with Take over
- caption, pointer on the bot's target, "What happened" timeline (never
typed text); native <select> offered as a picker; dialogs said in words
- memory: every browser's process tree measured (PSS), closed over 700 MB
- doors: /api/browser/live + /input (a signed-in person, own browsers only),
/api/browser/step (the account's ck_ token, for Terminal agents),
/api/browser/sessions; cloud-builder accounts only; demo denied
- /screen redirects to /terminal?view=browser
- scripts/test/screen-browser.ts: end to end at 390px and wide
Measured on the laptop: one live browser 229–236 MB PSS.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The off-site store (Backblaze B2, 10 GB cap) filled on 2026-11-16 and every
night failed after: pg_dump -Fc compresses, so restic saw each night's dumps
as all-new data (Solon alone ~2.3 GB/night).
- pg_dump -Z0: uncompressed; restic de-duplicates and compresses itself.
- Solon: --exclude-table-data=place_photo_bytes (a cache of public Wikimedia
Commons images the app re-reads on demand; moving to R2).
- Off-site paths now include /opt/supabase/docker/volumes/storage
(OrangeCat/Botsmann/Printcraft uploaded files had no off-site copy).
- KEEP_DAYS 14 -> 3 locally (history is off-site); freed ~9 GB on the box.
Already applied on the box (backup of the old script kept); this makes the
installer match it so a reinstall does not bring the old one back.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(fleet-brief): refresh the fallback snapshot; kit plan uses the scoped package names
fleet-brief-snapshot-fresh fails every verify from 2026-11-28: the snapshot
reached its 45-day limit. Regenerated with `pnpm run generate:fleet-brief
--from` a copy of bitbaum/fleet main (b91715cc7, 2026-11-26) read from the
Gitea mirror, because raw.githubusercontent.com answers 404 for bitbaum/fleet.
The fresh register exposes drift the old snapshot hid:
- listkit, threadkit, limitkit, ai-forms and bip-kit are now published as
@bitbaum/*. The kit plan matched none of them, so a bakery brief no longer
planned a list. Config keys and test expectations now use the scoped names.
- 18 packages instead of 16: the rendered brief is 4 570 chars. The test's
bound moves from 4 500 to 4 800, still below the renderer's 5 000 cut.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
* test(plain-shell): hermetic — an empty home and the default shell switches
plain-shell failed on the laptop verify runner for every PR from 2026-11-26
while passing elsewhere. The shell is a bash login shell, so it reads the
host user's ~/.bash_profile, and the runner reads LOKI_SHELL / LOKI_EXECUTOR
from the environment. Reproduced: on main, LOKI_SHELL=off fails it with the
'sealed builds only' refusal, and a ~/.bash_profile that exits fails the
echo round-trip. With this change both pass. waitFor also allows 20 s on a
loaded runner (it returns as soon as the text arrives).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
(cherry picked from commit b7ab9487ba)
* fix(widget-advise): a site on a package's bare name still reads what it does
The kit plan now keys on @bitbaum/ai-forms (and the other four renamed
packages), but a site installed before the rename depends on "ai-forms".
build-facts looked the description up by the exact name, so it lost it and
counted a planned package as missing. kitKey() maps the bare name to its key.
Found by the laptop verify of this PR (widget-advise).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
---------
Co-authored-by: Claude <noreply@anthropic.com>
kdeconnectd re-rolls its UDP ports on every restart; each one paged as a
NEW PORT (16 Telegram alerts in a day). Ports >= 32768 are now keyed by the
owning program, so a re-roll is silent and a new program still alerts.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(telegram): a chat that stops receiving is an alert, and a picture never vanishes silently
On 2026-11-23 a screenshot of an event sent on Telegram reached nothing: no
agent turn, no booking, no alert, no error. The owner's chat bot is collected
by the OpenClaw gateway (long polling), and the only health check asked
whether the gateway answered HTTP, which it can do while its Telegram channel
collects nothing.
- check-gateway also asks Telegram for the chat bot's inbox (getWebhookInfo,
read-only, lib/telegram/inbox.ts): a webhook set on the polled bot, or
updates waiting on two ticks in a row, raises telegram_inbox_stuck once and
says so in the chat (outbound still works when inbound is dead); it clears
on recovery. Skipped while the gateway itself is down.
- Loki's notification bot can no longer take over the chat bot: the same
token in TELEGRAM_NOTIFY_BOT_TOKEN is ignored (env.ts warns), since its
setWebhook would cut the gateway off from every owner message.
- ensureWebhook re-registers when Telegram reports 401/403 (a rotated
AUTH_SECRET left the URL matching and every update refused), keeping the
queued updates; the route logs refused calls (throttled).
- A photo or image file sent to the notification bot gets a reply saying it
was not read or booked and where to send it, and is recorded; a failed
reply is logged instead of swallowed.
Test: scripts/test/telegram-inbound.ts with a Telegram photo-update fixture.
Co-Authored-By: Claude <noreply@anthropic.com>
* docs(telegram): register the chat-bot inbox probe (src/lib/telegram/inbox.ts)
check-telegram-registry failed on #1765: inbox.ts calls api.telegram.org
but had no row in docs/telegram-notifications.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: catomean <catomean@users.noreply.github.com>
LAPTOP_DIR was /home/g/dev/orangecat, which exists on the laptop. Since
GitHub stopped running Actions for the org, the laptop runs the merge
check, and the test refused to run there ("exists here; this test needs
it absent"), failing every loki PR. The case under test is "a directory
from another machine"; a home that exists nowhere keeps it true wherever
the suite runs.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
'Make it happen' stopped at 'Making a place for the code' for every new
project: the place was a repository in the bitbaum GitHub organisation,
and the organisation now refuses new repositories (HTTP 422). The page
already says Loki keeps the code privately; make that literally true.
A new project whose code Loki keeps (no repo linked, and no personal
GitHub account of the person's own) is linked to loki://code/<slug>. The
runner that first materializes it makes a private bare repository next
to its dev root (~/loki-code/<slug>.git, LOKI_CODE_ROOT to override),
clones it, and gives an empty repository one commit on main, so run
branches and origin/HEAD behave as on any project. Dispatch routes it to
a cloud runner like a GitHub clone; workspace-source passes it through
with no token. The kickoff skips the GitHub site-deploy wiring for it.
A person's own GitHub account still gets a GitHub repository as before.
A GitHub or Gitea mirror can come later.
ai-kit 1.30 prices each paid answered call from its tokens and the vendor's
published price. The card now shows, per vendor and per app, "Cost: ≈ $X
(estimate)" and how many paid calls could not be priced (never counted as
$0); the headline adds "about $X by estimate". A note says the vendor's bill
is the final word and where its link is.
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
Co-authored-by: Claude <noreply@anthropic.com>
sync-package-updates paged on 15 Nov with 'Connection reset by peer'
during a Loki deploy, although the runner reruns a converging job when
loki-app restarts mid-request. It checked loki-app's start time the
instant curl failed, but a reset or empty reply is the old process going
down: the new one starts only after that stop finishes (up to ~13 s).
So it never saw the restart. Wait up to 60 s for the start time to move
before deciding; send-once jobs are still never repeated, and a cut with
no restart still fails (after the wait).
The test now also covers the production order (restart lands after the
cut); it fails on the old runner.