findQueueBlockers reads a raw db.execute row, which is not run through the
schema: started_at comes back as a string, but was typed Date, and
applyRunContext called .toISOString() on it. Every inbox load with a
queued-behind run threw (479 times since 12:54 UTC). Coerce at the query,
and type the raw column honestly. The two other raw Date columns
(robots.updated_at, people.last_interaction) already coerce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Loki's dense ui-input-tight fields stay the same height as their neighbours,
and the box keeps its layout if an app class sets display:block on it.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
The system-prompt rule (#1095) still lost to an all-Italian outline on
farmaciadelparco. The instruction now closes the prompt, quoting the
owner's request so the model can see which language it is.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Shipped in #1092 and found on the live probe: a signed-out owner got a bare
401 (the proxy gates /api/*), and even past it the route sent redirect_url
while sign-in reads callbackUrl, so they would have landed on Loki's home
page instead of their site. The route is now on the proxy's public list (it
requires a session itself before minting anything) and uses sign-in's own
parameter. owner-note-builds pins both; it fails against the #1092 route.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Live on farmaciadelparco the preview card said 'Aggiunto un riquadro verde…'
to an owner who asked in English: the prompt's 'write new text in the page's
language' covered the summary too.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(studio): the private link comes back — mailed at intake, on a later address, and on request
A studio request's only credential is its private link; a closed tab was a
lost request. Now the link is mailed to the address given at intake, or
added later through a `set_contact` guest action; and `/api/studio-recover`
hands the address fresh links to every open request under it (the old
links die), answering identically whether or not the address is known.
Keys are never stored or logged — email.ts records recipient and subject.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(demo): classify /api/studio-recover for the demo sandbox; the rotation rejects a demo owner
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Tabs can be arranged: drag one onto another, or Alt+Shift+Left/Right; a pin
sends a tab to the front; "Group by project" keeps one project's lanes together
with a divider between groups. The arrangement is a view preference kept per
builder in the browser; the runner still owns which sessions exist.
Names read as names: the 32-hex run suffix some dispatches append no longer hides
the part that tells tabs apart (the full name stays in the tooltip), long names
truncate, and parallel lanes carry a short run id so two of them differ.
The "No session named X" screen listed every running session a second time under
the tab strip it sat beneath, with raw ids and a paragraph of explanation. The
strip is the one place to choose; the screen now says what is true in one line
and offers the two things to do.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* feat(watch): "Not quite" and "Show me" on the walkthrough; done fixes keep Watch + Share
Operator, 2026-10-08: "do 1 and 2" — say a fix is not quite right from the
walkthrough itself, and see an idea on the live page before it is built.
- Not quite (owner + reporter, never a shared link): typed or spoken (the
widget's mic), filed as a follow-up on the same page. The owner's starts
the fix at once via startOwnerBuild, now shared with Report's owner-pass
path (lib/feedback/owner-build.ts); the reporter's goes to the inbox.
- Show me: /api/widget/preview turns the words into a few edits from a
closed vocabulary (style, text, hide, insert, css) against the page
outline; widget/preview.ts sanitizes them (tag/attribute allow-list, no
url()/@import/expression, no handlers or javascript: links), applies them
in the owner's browser only and undoes them exactly. "Build this" sends
the words plus what the preview showed. Charged to the owner's AI budget,
rate-limited, never available to a viewer ticket.
- Done fixes keep "Watch the fix" + Share on the row; the last card gets
"Copy page link" for sharing the site without a walkthrough.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(owner-build): read the shared owner-build module, and pin that 'Not quite' uses it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(widget): one conversation with Loki; Watch is in the header for anyone who owns the site
The panel was three tools sharing a box: Request a change (a form), Ask Loki
(an advisor) and Chat, behind tabs and scope chips, each with a history that
vanished on close - and Watch could only be switched on by arriving through
one link on the project page in Loki, so an owner simply visiting their site
never saw it.
Now:
- One thread (widget/conversation.ts). Type, speak, paste a screenshot or
point at an element; Loki answers about this page (one tap: whole site).
Every suggested change, and your own message as written, has Send to
builder / Build this, which opens a confirmation card in the thread; the
receipt (building / track link) lands in the thread.
- The thread is kept per tab (widget/thread.ts, validated on restore), so it
survives the site's own page loads.
- Watch in the header: Review for the owner; for anyone else an explainer
with "This is my site - sign in with Loki", via GET /api/widget/owner,
which checks ownership of the widget's project and returns to the same
page with a pass. The return URL must be on the project's own site
(ownerReturnUrl), so the route cannot hand a pass to someone else's page;
a non-owner lands back with a plain explanation.
- data-fc-modes now only picks who answers: advisor (default), the studio
concierge (chat), or none (report). The owner always gets the advisor.
- widget/loki-api.ts holds the two calls; advise.ts and chat.ts are gone.
Tests: widget-thread (new), owner-note-builds (return-URL guard),
widget-embed-browser 41/41, widget-watch-browser 40/40,
widget-host-avoid-browser 24/24.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(widget): style guard follows the panel's real controls; comment no longer reads as an import
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
It needs a paid OPENAI_API_KEY the box does not have, answered 503 every
night and paged as a failed unit. Background AI spend is off fleet-wide
(the ai-digest row above was dropped for the same reason). Already
disabled on the box; this stops a reinstall from bringing it back.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(hetzner): a sleeping app naps cleanly; ivy-health checks what Loki runs
Sleep-when-idle stops the app with SIGTERM when its proxy idles out, and
Node exits 143. Without SuccessExitStatus systemd recorded that as
Result=exit-code, so every nap read as `failed` and paged Telegram as
"DOWN" quoting the boot banner, then "RECOVERED" on the next visit — ~10
sites flapping all day, burying real alerts. The generated app unit now
counts 143/SIGTERM as a clean stop; the test pins it (mutation-checked).
ivy-health.sh was box-only and still checked fleetcrown-app/-bridge and
the retired OpenClaw gateway, paging "DEGRADED (restart failed)" every 4h
for units that no longer exist. Versioned here, now heals postgres and the
loki-* units and probes loki-app /api/health; installed on the box.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(telegram): register ivy-health.sh as a sender
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(hetzner): ivy-health history without the retired name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A token's origins list is written at install time; apps.conf (the hosting
SSOT) can gain addresses later. Any address added outside Loki's attach
flow was missing from the token, so /api/widget-boot answered
{active:false} there while the site's other address rendered the widget:
xhiva.orangecat.ch (apps.conf) vs the long preview host (token).
One rule, src/lib/widget/origin.ts, now used by boot, ingest, chat, advise
and transcribe (it was copied into five routes): an origin passes when the
token lists it, or when it is another apps.conf address of a site the token
already lists. Never another site's. Empty list still means any origin;
a missing Origin still passes only on boot.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The first live share (farmaciadelparco) opened by quoting the request
verbatim to whoever got the link: its typos and the owner's private
ambition ('...if we are to become the biggest pharma retailer in
switzerland'). A request is often a stranger's, sometimes rough, sometimes
private. A viewer now gets a neutral opening, the live change and the
note's plain sentence; the test pins that the request never reaches them.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The agent switcher, the Claude | Terminal toggle and the chat view all keyed off
the project's saved preference, not the CLI running in the tab. A Claude-
preferring project with Cursor live labelled the switcher "Claude", offered a
chat view Cursor never writes a transcript for, and treated picking Claude as
"already active" - a no-op. The live CLI now decides; preference only answers
when nothing is running. A failed switch or close is shown instead of swallowed.
The agent tab strip gets what the shell workspace's already had: + starts a
session in place (the existing launcher), double-click or F2 renames (a display
name per builder; the session id never changes), and x closes with an armed
"Close?" second press because it ends a running agent. /api/control/close-tab
now honours the builder being viewed instead of always routing to cloud.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* feat(watch): share a fix's walkthrough with anyone; a cleaner last card
"How can I share these?" (operator, 2026-10-08). A walkthrough is not a
video: it is a signed ticket in the live page's fragment that the widget
plays on the real site. Owner tickets last a day and carry the maintainer's
reasoning, so there was nothing safe to hand on.
- Share: a long-lived share token (own HMAC domain, 90 days) behind the
public /w/<token>, which mints a fresh VIEWER ticket on every open and
redirects to the live page. The viewer's story is the request and the
live demonstration in plain words: no reasoning, PR or reporter
screenshot. Share buttons in Loki's inbox (next to Watch the fix) and on
the walkthrough's last card (share sheet, else clipboard, else the link).
- Same walkthrough for everyone: planned steps are kept per fix, audience
and page outline, so a link passed around doesn't re-plan per viewer
(or spend the owner's AI budget per viewer).
- The last card: one short question and one decision with Share beside it,
Replay and the code change as quiet links, close as an x in the corner.
It no longer repeats the agent's change log, and firstSentence no longer
cuts at an abbreviation ("...115/115 browser checks incl.").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* style(docs): format the share sentence
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(forms): dates read in words — all date fields use @bitbaum/whenkit's DateInput
Eleven raw <input type="date"> fields (events, goals, commitments,
subscriptions, crew assignments, interactions, location) showed the
browser's bare "tt.mm.jjjj" box. They now render whenkit's DateInput, a
drop-in with the same props and onChange(event): the tag changes and
nothing else. The visible box carries the SAME ui-input* classes, so each
field keeps its place in the layout, and the real input stays on top —
picker, keyboard, min, onBlur/onKeyDown inline editing all unchanged.
src/components/ui/date-input.tsx is the one place Loki imports it from (and
the one place the stylesheet is imported). Migrated with whenkit's
scripts/migrate-date-inputs.mjs, which changes only the tag and one import.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* chore(deps): whenkit 0.3.1 — the date icon scales with the field's text
Loki's dense ui-input-tight fields (12px) are not made taller by a fixed
20px icon.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* feat(watch): Review — Loki judges what you just did on your site and suggests what to improve
Watch mode only acted when something broke. It now also notices what a
demanding reviewer would (4xx, slow requests, console errors, slow loads,
main-thread freezes, layout shift, pauses between steps) plus measured page
checks (unnamed controls, unlabeled fields, tiny tap targets, missing alt,
broken images, sideways scroll, h1/lang). The pill counts them; Review sends
the session to Ask, which judges it through errors, design, engineering,
process and product - every point cited from the session - and each change
is one tap from a request that carries the watched steps. The trail now
survives page loads within a tab, so a multi-page site reads as one visit.
No model runs until Review is pressed. The report POST is now one helper
(widget/send-report.ts) shared by Send and the automatic fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(watch): Review never blames the site for Loki's own work; plain-text answers
Found by looking at the 390px render, not by the tests:
- opening Loki's own Review panel scored a 0.27 layout shift against the
site (Chrome reports shadow-DOM sources with a null node) - only shifts
pinned on a site node count now;
- the widget's own boot registered as 'the page froze 369ms' - a freeze now
counts only when it overlaps the second after a tap on the site;
- the review asked for **bold** lenses and the widget shows text, so clients
saw literal asterisks - plain-text rubric + plainAnswer() on every reply;
- '404 in 0.0s' - duration only when slow.
The browser test now proves the detectors fire on real jank (a Load more
that freezes and pushes content down) AND stay quiet for Loki's own panel.
The 'typed values never leave the page' checks were vacuous (fill() never
taps the field) - they tap the filled field now and fail under mutation.
Docs: the architecture table described Watch as 'still a seam'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Deploy (every fleet site, via selfhost-deploy.yml):
- page-check.mjs gets one 90s deadline for the whole look. On a host that
accepts and never answers, goto gave up at 45s and the next call waited
on the pending navigation forever; farmaciadelparco's deploys #3 and #4
sat in "Look at the live page before the deploy" until the job's 45m
limit. Verified against a never-answering socket: records "did not load"
at 90s and exits 0; a normal page still checks in ~3s.
- timeout-minutes on both page-check steps as the backstop.
Project page:
- deriveBuildStatus: agent_running=t is a live process, not a live build.
After a run closes Claude Code idles at its prompt, so the page said
"Building now · An agent is working" beside "Finished · PR #1 merged".
Building now needs an open run, or a prompt given after the last close.
Claude-Session: https://claude.ai/code/session_014d9r6dNr1vW789Q75hPcHF
Co-authored-by: Claude <noreply@anthropic.com>
#1077's narration hook imported lib/watch-narration, which imported
lib/ai/model-json → lib/agent/llm → db → postgres. Turbopack then tried to
bundle `fs`, `net`, `tls` and `perf_hooks` for the browser and the
production build failed, so Deploy has been red on main since af1463e.
The answer reader moves to lib/watch-narration-parse.ts (imported by the
route and the test only); lib/watch-narration keeps the browser-safe half
and now imports nothing.
Claude-Session: https://claude.ai/code/session_01ReWfUGdbNX6X67XDrbF8dg
Co-authored-by: Claude <noreply@anthropic.com>
* fix(watch, terminal): readable live screen, a "What's going on?" button, no false "Session ended"
What the operator saw on a phone, 2026-10-07:
- Watch's "screen" was every spinner frame glued together ("Actioning…●✢4*✶75✻
✻Actioning…5✻…"). A peek is the PTY's byte buffer; deleting the escape codes
kept every redraw. renderTerminalText now replays CR / cursor moves / erase
sequences into the lines the terminal actually shows, and the live line names
the real step ("Running 1 shell command…", "Writing src/app/page.tsx")
instead of Claude Code's decorative spinner word.
- "Open the full terminal" opened a blurred page under a sheet saying "Session
ended — its agent terminal is gone" while it was still connecting to a
healthy session. Connecting no longer reads as gone (presentTerminalRun takes
the real state), the sheet no longer opens by itself over the session, and
the genuinely-lost case names a way forward with a button.
- New: "What's going on?" — under the terminal on phones, in the Loki panel
header, and as the primary button on Watch (opens Terminal with ?explain=1).
Loki answers for a non-programmer: anything waiting on you first, what is
being built and how far along, an honest "Autopilot:" line saying whether it
carries on without you, and up to three one-tap things to tell it next.
- Watch said "Working · 1 min" three times with two spinners; the activity
fold now says when the run started. The kickoff card's four-line "Working"
paragraph with its own spinner is one aligned line, and the pending step's
dot lines up with the icons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ReWfUGdbNX6X67XDrbF8dg
* refactor(terminal): "What's going on?" state, button and Loki sheet in their own module
TerminalSurface crossed the 510-line function ratchet (533). The explain
request, the sheet that carries its answer and the button now live in
TerminalExplain.tsx; the rail takes them as one `explain` prop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ReWfUGdbNX6X67XDrbF8dg
* feat(watch): Loki narrates the build live; steer it or let autopilot drive, from one card
"Not enough magic" (operator, 2026-10-07). Watch showed a terminal's worth
of facts; a person watching wants to know what is being made for them and
whether they need to do anything.
- While an agent works, Loki reads its screen every ~30s (only when it has
moved) and writes one plain headline in the owner's terms — "Adding the
Team page in three languages" — with a line on what it means. Earlier
headlines stack under it as the story so far. lib/watch-narration (pure,
tested) + POST /api/projects/[id]/watch/narrate (AI-budget gated,
rate-limited, degrades to the agent's own step line, never an error).
- "It needs you" appears only when the screen shows a question or a stop
the agent cannot fix, with one tap to answer.
- The two ways to drive it, on the same card: a "Tell it something" box that
steers the running session (tab-inject), and the project's real autopilot
switch with one line saying what each state does.
- The old live message (typing dots, raw-screen fold, two links) is replaced
by the card; "Look closer" opens the terminal with the explanation asked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ReWfUGdbNX6X67XDrbF8dg
---------
Co-authored-by: Claude <noreply@anthropic.com>
Naming your own website on /change used to go straight from an address to
"Build a new version". Now the address alone opens a consultation first:
Loki reads the live page the way a new visitor and Google do and says, in
plain words, what is costing the owner visitors, what is worth fixing and
what is already right, with the proof it saw and how Google shows them today.
Every finding is a fix they keep or drop, and the build can be nothing more
than "fix these" (plus their own words, now optional).
- config/site-consult.ts: SSOT for the 19 checks: area, severity, owner copy,
business reason, and the agent instruction a chosen fix becomes
- lib/site-consult: SSRF-guarded single-page fetch (every redirect hop
re-validated, DNS must be public; private-address guard ported from
OrangeCat), a regex page reader, and pure rules. No model: the page is
anonymous and must not spend the shared AI quota
- POST /api/site-consult: public, rate-limited, cached, findings only
- the build brief carries the chosen fixes as check ids, so the instruction
an agent reads comes from config, never from the browser
- typing just an address no longer lands in "what should change"
Claude-Session: https://claude.ai/code/session_01X9tyuAD9YxN1gDFFUMAf6n
Co-authored-by: Claude <noreply@anthropic.com>
Fix walkthroughs:
- New /feedback/<id>/watch-fix mints a fresh owner tour ticket on every
open and lands on the live page's walkthrough (inbox when there is no
live page or no access). A ticket lasts a day; a Telegram message lasts
forever, so messages carry this address, not a ticket.
- notifyFixShipped: push, Telegram and the in-app alert for a live fix now
link the walkthrough ("▶ Watch the fix") instead of the bare page.
- getFeedbackWithProject returns the project's liveUrl.
Late night:
- lib/late-night: 23:00–05:00 local, one "night" key per evening, copy.
- LateNightAutopilot on Control: autopilot off → "Hand it to autopilot and
go to sleep" with one tap to turn it on; on → "Autopilot is on — go to
sleep". "Not tonight" hides it until the next evening.
Claude-Session: https://claude.ai/code/session_014d9r6dNr1vW789Q75hPcHF
Co-authored-by: Claude <noreply@anthropic.com>
The walkthrough could only show WHERE a change was: it had the report, the
handoff's one line and a PR title. The owner asked for how it was solved,
why so, what the alternatives were and who it helps.
- Design note: every fix prompt asks the agent for a `## Walkthrough`
section in the PR description (problem, change, why, considered,
helps, where, a plain line for the reporter). fix-note.ts holds the
field list once, rendering both the instruction and the parser; the
fix ledger keeps the parsed note on FixShipping.pr.note.
- Chapters: buildTourBeats turns report + screenshot + note + live steps
into a ~60s story. The widget plays it with Back / Pause / Next,
reading time scaled to each caption, the reporter's own screenshot as
the before picture, and no second click when going back.
- Reporter audience: tour tokens carry an audience inside the signed
payload (owner tokens unchanged, so old links still work; reporter
tokens last 7 days). /my-feedback offers "Watch your fix" on a live
fix. The reporter's story keeps their words, the live demo and the
plain line — no reasoning, PR or repository.
Claude-Session: https://claude.ai/code/session_01MqXhtjrmVb4vKE6oKSyHVg
Co-authored-by: Claude <noreply@anthropic.com>
* fix(watch): "Chat" and "Watch it" open the agent's conversation, one tap from its terminal
The Watch panel's Chat button opened the general Loki chat, which knows
nothing about the run, and "Watch it" landed on whichever terminal view
localStorage remembered. The terminal page already shows the same session
as the agent's conversation or its raw PTY behind one switch; nothing
deep-linked to it.
- /terminal accepts ?view=chat|terminal; the link wins over the remembered
view without overwriting it until the reader flips the switch.
- withTerminalView() in lib/fleet-context builds those links.
- Feedback Watch: Chat -> the run's conversation, Terminal -> the raw PTY.
- Loki dispatch card "Watch it" opens the conversation.
- Watch it work: "Follow <agent> live" beside "Open the full terminal".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d9r6dNr1vW789Q75hPcHF
* fix(terminal): read ?view= in useTerminalView so TerminalSurface stays under max-lines-per-function
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d9r6dNr1vW789Q75hPcHF
---------
Co-authored-by: Claude <noreply@anthropic.com>
From the operator's phone screenshots of /terminal (Brave, Android):
- Two switches for one choice. Keys | Write sat on the bar and Write opened a
second Type | Prompt switch: four combinations for "how am I talking to this
session". The bar is now ONE switch — Type · Prompt · Keys — and tapping the
open one closes it back to watching. That also gives the terminal back the
row the inner switch took.
- The prompt library covered the whole session. It opens upward over the
terminal at a flat 20rem; on a phone with the keyboard or browser toolbars
that is every visible line. Named `.ui-picker-panel` caps it at
min(20rem, 45dvh) wherever the picker is used.
- Suggestions that did not make sense out of context. "next best steps:**"
was a markdown heading the bullet-strip half-unwrapped, so the preamble
filter missed it; emphasis is now stripped before that check (Loki's
follow-ups share the parser). Chips show two lines instead of cutting a
sentence mid-word, and the model is asked for steps under 50 characters.
Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa
Co-authored-by: Claude <noreply@anthropic.com>
The caption card had no z-index (only the cursor layer did), so any
positioned host element painted over it: Substrata's floating ASK button
and phone tab bar covered the card and its "Looks right" button at 390px.
The card now takes the top z-index and lifts above a full-width bottom bar,
measured from what is painted at the bottom edge.
Claude-Session: https://claude.ai/code/session_01MqXhtjrmVb4vKE6oKSyHVg
Co-authored-by: Claude <noreply@anthropic.com>
Two things reported from the phone on /terminal:
- The bottom tab bar floated over the Prompt box, right above the keys.
The root viewport sets interactive-widget=resizes-content, which Chrome and
Brave on Android honour, so innerHeight and visualViewport shrink together and
useKeyboardInset is always 0 there — the "hide while the keyboard is up" rule
never fired. New useKeyboardOpen also treats "a text field is focused and the
window is much shorter than its tallest at this width" as open. Padding still
uses useKeyboardInset, which is correct under resizes-content.
- "Why is there no Loki widget to give feedback?" There is — the unlabeled icon
in the terminal header, and "Report a problem" behind the avatar. Neither
reads as feedback. The Menu sheet now leads with "Feedback on this page",
which closes the sheet first so the screenshot and point-at see the page.
Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa
Co-authored-by: Claude <noreply@anthropic.com>
- record-links.ts wraps bip-kit 0.6.0 linkDevelopment for Loki's map types:
/roadmap steps link to the changelog days that delivered them, /changelog
lines name the step they delivered, each entry has an anchor.
- recordText strips {#id} tokens wherever record text is printed:
/fleet/orangecat was showing 'Events, end to end {#events}'.
- parseRoadmapMarkdown joins a wrapped milestone's indented lines into it;
the continuation was dropped, or taken as the goal's one-liner.
- bip-kit ^0.6.0.
Claude-Session: https://claude.ai/code/session_01MFTqYKVJNY7ddWNQqsc7yM
Co-authored-by: Claude <noreply@anthropic.com>
* fix(terminal): name the conversation after the agent in the session; "Loki" is the supervisor only
The view switch read "Loki | Terminal" (#1041). That named the coding agent's
own conversation after a different AI: Loki runs on whichever model is first
in its chain, and the thing in the session is Claude Code today, Codex
tomorrow. The operator reported the result on 2026-10-07: "there can be one
model powering the chat, and another model is open in the terminal".
- TerminalViewSwitch takes the running agent's label: "Claude | Terminal",
"Codex | Terminal", "Chat | Terminal" when unnamed.
- "Loki" goes back to the supervisor panel: the desktop pane button and the
session-sheet section, whose row now says it answers on Loki's own model.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jbux2e4GEruUYXn1PC3VhM
* feat(projects): the Build strip ends on the outcome — live at skif.ch, or waiting on you
The project page knew whether an agent was working, how the last run was
graded, and (in the run's fix ledger) whether the change had merged and
deployed. It read the first two and said "work reached the repo" — true, and
not what the person who asked for the change wanted to know.
- lib/project-state-sentence: one sentence per project (headline, detail,
tone, waitingOnYou), from the build status plus the shipping ledger. Ends on
the outcome ("Live at skif.ch", "In review — goes live by itself", "Merged,
but not live"), never on the mechanism; no PR numbers, CI or auto-merge in
the words. `waitingOnYou` is true only when nothing moves until the
operator acts — a change in review is not waiting on anyone.
- LastAttempt carries `shipping` (normalized payload.fix), and `landed`
honours a deployed ledger, so a timed-out run that shipped is not "nothing".
- ProjectBuildStatus renders the sentence; its kicker follows the tone, and a
link to the live site or the change sits in the text — the action slot
stays the one button that starts work.
Control's card already shows the ledger line; Today lists only flagged
projects. Both unchanged here.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jbux2e4GEruUYXn1PC3VhM
---------
Co-authored-by: Claude <noreply@anthropic.com>
* wip(sites): sleep-when-idle building blocks (not wired in yet)
Adds the status list and idle time (_box-env.sh) and the pure generators
(lib.sh: sleeps_when_idle, wake_inner_port, sleep_app_unit, wake_socket_unit,
wake_proxy_unit). Nothing calls them yet: sync-infra.sh is unchanged, so no
site's units change. Wiring them in waits on the owner's go-ahead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191FbipnTCBDKHiKftp9W7B
* feat(sites): sites that are not live yet sleep when idle
Every site ran around the clock with up to 1 GB, which capped the 16 GB box at
roughly 50 sites however rarely they were visited. A site whose register status
is prospect, demo, validating or unverified now sleeps: systemd listens on its
port, the first request starts it (a second or two), and it stops after 15
idle minutes. Live sites (clients, products, evig, the 4001-4004 services) are
untouched; a row that becomes live is switched back to always on on its next
sync.
- sync-infra.sh: for a sleeping row, the app listens on port+20000 and is bound
to <name>-wake.service (systemd-socket-proxyd --exit-idle-time) behind
<name>-wake.socket on the public port. Caddy and deploy.sh keep talking to
127.0.0.1:$PORT, so neither changes; a deploy's restart pulls the proxy up.
Falls back to always on, out loud, if the box's proxyd lacks idle exit.
- install-watchdog.sh: a sleeping site is checked by its socket, not by a
request every 5 minutes (which would keep it awake forever).
- uptime-sweep.sh: sleeping sites are health-probed on the first sweep of
00/06/12/18 UTC instead of every 15 minutes, so botsmann's kind of outage
is still caught within hours; certificates are still checked daily.
- Sync sites workflow: re-applies sync-infra.sh to named sites and checks each
one answers — the rollout for sites already on the box.
Tests: test-sleep-when-idle.sh runs sync-infra and the watchdog installer end
to end against a recording ssh; test-uptime-sweep.sh covers the 6-hourly probe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191FbipnTCBDKHiKftp9W7B
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat(sites): give a site its own domain — evig.orangecat.ch → evig.ch
A site starts on <slug>.orangecat.ch. When its owner buys a domain, Loki can
now make that domain the site's address: the domain (and www. when it points
here) is served, the free address answers with a 308 to it, and the project's
live URL, production URL and widget origin list follow. Nothing the visitor
sees says where the site is hosted, and the site stays one repo, one Loki
project, on the same box.
- lib.sh caddy_vhost: the one rule for what a row's domains field means. A
row mixing an own domain with its free host serves the own domain and 308s
the free one. sync-infra now calls it; every existing row's vhost is
byte-identical (pinned against the real register in test-custom-domain.sh).
- attach-domain.sh <slug> <domain> | --detach: checks DNS first (A to the box,
no stray AAAA) and refuses with the exact records when it is not set —
Caddy would otherwise retry a failing certificate for hours while the free
address already redirects there. Edits the row, publishes it to main via
the shared publish_register_row (moved out of register-site.sh), syncs,
waits for HTTPS. Refuses the handcrafted 4001-4004 services (evig among
them) whose Caddy blocks are hand-written.
- GET/POST/DELETE /api/projects/[id]/domain + an "Own domain" panel next to
the live link: type the domain, see the records and whether they are set,
connect, or go back to the free address. Studio-box gating is the same as
site registration; everyone else gets the command.
Docs: docs/infrastructure/custom-domains.md, including why sites are not
hosted inside OrangeCat (removed 2026-08-27) and the two things a site's own
code may still need after a move (metadataBase, OrangeCat OAuth redirect URIs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191FbipnTCBDKHiKftp9W7B
* fix(env): document LOKI_SITES_IP / LOKI_SITES_IPV6 in .env.example
env-example-covers-src requires every variable src/ reads to be named there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191FbipnTCBDKHiKftp9W7B
---------
Co-authored-by: Claude <noreply@anthropic.com>
Moves chatkit from the f9f906b commit to the merged 0.4.1 commit, which adds
@bitbaum/chatkit/attach and the chatkit-check-file-inputs bin. `verify` now
runs `check:file-inputs` over src and widget: any file input whose accept
mixes image and document families (the shape that hid screenshots behind
Android's capture-app chooser) fails CI. Dependabot groups @bitbaum/*
releases into one PR.
Pinned to the commit until 0.4.1 is on npm (trusted publisher not configured
yet); then it becomes ^0.4.1.
Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck
Co-authored-by: Claude <noreply@anthropic.com>
- /fleet no longer says "no site yet" for loki, orangecat and bitbaum:
a project's own live URL counts as a site when apps.conf has no row
(they are served from the main Caddyfile), as the fleet map already did.
- An owner the register marks with "?" is never shown as a partner:
/fleet printed "with Stadt Zürich?" for the Reparaturbonus concept, and
the website concierge would have said "a pilot built with Stadt Zürich?".
- Loki's chat is not open-weight only: the chain is Groq (gpt-oss, qwen),
then Google (Gemini), then OpenRouter, and llama left it in 2026-08.
/why, /roadmap and /how-it-works now say that.
- /download: the Linux step described the AppImage chmod while showing
the .deb install line; the update note now says .deb updates need the
one command the banner shows.
- README: Next.js 16 (was a stale 16.2.6 pin; package.json is 16.3.8).
- packages/agent licence UNLICENSED -> MIT, matching the repo.
- CHANGELOG 2026-10-05 entry and a ROADMAP Shipped item for Make it yours.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The homepage said how Loki works but not what it is for. A new section after
"How it works" answers that in two groups: six situations one person or a
small team runs into (no code, an orphaned website, slow small changes, too
many AI tools, work that needs a human, unknown monthly costs) and six that
small organisations and the public share (sites nobody can change, open
source only coders can set up, sites broken on phones, reports that never
get an answer, AI without oversight, vendor lock-in). Each card is the
problem, what happens in Loki today, and one link to a public page where it
happens.
Copy is SSOT in src/config/problems-we-solve.ts, with the code behind each
claim cited next to it. scripts/test/problems-we-solve.ts pins unique ids,
links that resolve to public pages or real /how-it-works sections, and no
roadmap, media or local-model claims; public-copy-truth now covers both files.
Claude-Session: https://claude.ai/code/session_016tA6LherCgxwapQ2oYTjc5
Co-authored-by: Claude <noreply@anthropic.com>
The name becomes the repo and the <name>.orangecat.ch preview, and it used to carry
the request id because it doubled as the duplicate-submit guard. The operator, on the
xhiva preview: "why not just xhiva.orangecat.ch".
- siteName(): the registrable name (no www, no TLD, two-part suffixes like co.uk off,
accents off); "inspired" projects say so; "Make it yours" stays my-<repo>.
- firstFreeName(): -2, -3 only when the name is taken anywhere in the fleet (repo and
subdomain are global).
- The request id moves to the project's metadata (briefRequestId): a repeat finds its
project by id; a per-request lock covers two tabs at once.
- briefKind is recorded too, because "this is a repo copy" was ALSO read from the
name — and it is load-bearing (empty starter, the imported repo's Actions off).
Projects started before keep being recognised by their old name.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Loki's OrangeCat provider kept Auth.js's default profile, which carries the
email. For an OrangeCat identity Loki had not seen, that meant: the signIn
callback looked the address up in users, PATCHED that account (image, name)
and stamped its email as verified — on the strength of an address
OrangeCat does not verify — and then the adapter refused the sign-in with
OAuthAccountNotLinked. The provider is now accountkit's (v0.2.1): same
client_secret_post, PKCE and capability scopes, and a profile with no email.
An OrangeCat sign-in resolves its user through accountkit's
withOrangecatIdentity wrapped around the Drizzle adapter, by sub alone
(users.orangecatActorId, else the accounts row of an older link). keepTokens
keeps writing the accounts row, which powers publish/promote/wallet. A new
OrangeCat user keeps its address only when no Loki account holds it; else
email stays null (never a made-up address).
forgot-password keeps Loki's rule (a GitHub/Google account without a
password may set one) but never mails an account only OrangeCat created
(lib/auth/reset-eligibility.ts + test).
pages.error: Auth.js's bare "Error" page is replaced by /sign-in/error,
accountkit's SignInError; Try again goes back to /sign-in, which starts
whichever method the person picks. Added to the responsive audit.
Password, PIN, X and demo accounts are untouched.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
apply-schema default-granted ALL on every future table in an app schema to
anon and authenticated (copying printcraft's posture). A migration-created
table has RLS off, and the anon key ships in the browser bundle, so every
new table was readable and writable by anyone through PostgREST. Found live
2026-10-06: botsmann.consultations (visitors' names, emails, messages) —
closed by hand on the DB and in botsmann#221.
- Default privileges: tables and sequences to service_role only. A table the
anon key should reach grants it (or RLS + policy) in its own migration;
forgetting now fails with 'permission denied' instead of publishing data.
- refuse_public_exposure on both supabase exits: a table PostgREST serves
that anon can SELECT with RLS off fails the deploy, with the fix printed.
Checked live: botsmann and printcraft schemas return no open tables.
- Tests: 5 new checks (54/54); reverting the default grant fails 2.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The operator, through the site's feedback button: "why not just xhiva.orangecat.ch".
The agent traced it here (its audit D8): the hostname is this row's domains column,
applied to Caddy by sync-infra.sh. Wildcard DNS already resolves.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The xhiva agent ran in ~/.loki/worktrees/<project>-2ba3ac62/<runId> while 'is an
agent running?' matched only the primary checkout. A working agent read as absent
everywhere: the build card said 'no agent has picked it up, starting again is safe',
Terminal said 'session ended', Ask left it out, and the run never closed.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(terminal): the feedback tool on the Terminal page — no floating button over the PTY
From the operator, on a phone: "I don't see the button that allows me to
give feedback on elements and on the site" on the Terminal (loki#1037).
/terminal was excluded from the widget because a floating button over live
terminal output covers what you are reading — and nothing replaced it, so
the page used most on a phone had no way to report anything.
- /terminal is no longer excluded (config/feedback-widget.ts). The page
carries data-fc-place="hidden", so the widget loads with no launcher.
- A Feedback button in the terminal header opens the panel (report a
problem, point at an element, attach a screenshot) via Loki.report().
- lib/open-feedback: one helper for opening the panel from a control,
shared with the account menu's "Report a problem". It now checks
Loki.ready — the widget publishes a report() stub even when it will
never render, so a bare "is a function" check could click into nothing;
not ready → /support.
- Tests: feedback-widget-reach asserts the new contract; the widget's
browser test gains the Terminal fixture — hidden launcher, report()
opens the panel, closing it keeps the launcher hidden.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(phone-chrome): Report a problem opens through lib/open-feedback
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>