mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 16:47:08 +01:00
starter-sync/096281ff91f8
1482
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7436883e32 | chore(starter): sync scripts/site-template to bitbaum/fleet@096281ff91 | ||
|
|
6a966ac6ae |
fix(sessions): the session walk says what tab-inject does, and tab-inject says when a task waits (#1674)
Traced 2026-11-12. On the cloud builder tab-inject queues a task that the claim gate holds while an earlier run of the project is open (so it never types into an agent mid-task), but it answered only ok, and the walk said a running session gets the prompt typed into it. A prompt for a plain shell was queued and answered 200, then refused by the runner. - tab-inject: a task held behind an open run answers heldBehind (runId, startedAt, label) and a message, read with findQueueBlockers, the gate's own predicate; a prompt for a shell is 403 before anything is queued - LOOP-WALK: 'give it a task' says it waits its turn; 'type into it' says how to send a message mid-task (bracketed paste, then Enter); open-tabs names are lowercase; the shell refusals are the real statuses - scripts/test/session-walk-truth pins the routes and the text together Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
69f2f11b22 |
test(unit): no test can reach the real repository from a push (#1684)
The pre-push hook runs the unit suite with git's hook environment, and from a linked worktree GIT_DIR is absolute; an absolute GIT_DIR overrides 'git -C <sandbox>'. lane-base.ts (new on main today) made its throwaway repo that way. Pushing from a worktree on 2026-11-12, its 'init' commit (author test) replaced every file of the branch being pushed, and its git init and git config set core.bare, core.hooksPath /dev/null and user.name test on the real repository. The push's hook failed, so nothing reached GitHub. worktree-workspace.ts and the shell fixtures each guarded themselves; a new test did not. The runner now strips git's own repository variables (git rev-parse --local-env-vars) from every test it spawns (scripts/test/lib/test-env.ts). scripts/test/test-runner-git-env.ts replays the hazard between two throwaway repositories and checks the guard; run against lane-base.ts, an inherited GIT_DIR got its commit unguarded and nothing guarded. Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
7f8e731b08 |
feat(ux): say it on the first screen; a shorter homepage; a header that stays (#1675)
* feat(fields): sixteen text boxes get the microphone; chatkit 0.25 Fleet experience standard, step 9. The experience audit counted 34 hand-made text areas with no microphone; it now counts 17, and package-plan.json sets the ceiling at today's counts so the number can only fall. - @bitbaum/chatkit 0.22.1 -> 0.25.0. Composer behaviour and the class names Loki overrides are unchanged; LOKI_VOICE keeps the transcribe route's own sentence (showServerDetail), which names the fix. - <TextArea> (components/ui/text-area.tsx): Loki's one adapter over chatkit's DictationField, drawn to match ui-input. Sixteen files use it. One file is exempt with its reason on its first line (URL paths, one per line). - Field takes htmlFor, so its label names the control and a press on it focuses the field. - A signed-out visitor's microphone is the browser's own recogniser (VISITOR_VOICE): the server leg answers 401 without a session, so on /change the mic recorded a whole take and then failed. - The widget chat bundle budget goes 40 -> 41 KB: 41,414 -> 41,614 bytes gzipped, the two new dictation problems a person can act on. The other seventeen wait for props the shared field gains in bitbaum/chatkit#85 (autoFocus, onKeyDown, onBlur/onFocus, name, inputProps). The stylesheet in this commit also carries the public-site rules of the next one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * feat(public): say it on the first screen; a shorter homepage; a header that stays The way in - The homepage's one action is the shared composer. What a signed-out visitor says is kept in the tab (lib/first-words), shown back on sign-up and handed to the new-project form at the end of onboarding or sign-in. With a sentence carried, onboarding does not ask for a project name, a folder and a GitHub address first. The homepage - 10.66 -> 7.48 phone screens at 390x844, 6.6 -> 5.11 at 1440x900. - Three figures for the three steps, drawn in tokens (LoopFigure). - Three problems on the homepage, all twelve on /why. Where it runs is one sentence and two links. The closing block is the shared FinalCta. - One label for sign-up everywhere: Start a project. Header, menu, footer - The header was sticky in name only: .ui-public-surface was overflow: hidden, which made it the sticky container. overflow-x: clip. - The phone menu takes focus, keeps Tab inside and hands focus back. - The Product menu opens on a press, not on hover. - Navigation and Sign in show from 1120px (was 1280px). - A 2px focus ring, on the public surface and as the app-wide fallback. - A skip link. Four footer groups instead of five. Corners - An unknown address outside the app drew the framework's bare 404 with no way back; the in-app one said Back to Today and went to Loki; the error page printed the raw error; the loading placeholder drew cards on pages that are rows. The share image leads with the headline. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * fix(ux): dates render once; rows say the part that matters; a person's words - APP_LOCALE is a server variable, so a client component formatted dates in the default locale while the server used the configured one: a hydration error on /approvals with APP_LOCALE=de-CH. next.config.ts hands the same value to the browser as NEXT_PUBLIC_APP_LOCALE. - Home's running rows lead with the live step. A phone row holds about thirty characters and every row read 'Next best step · Editing src/app/pa…'. - The workbench's three rows on a phone were each cut before the words that say what the row is for. - Terminal without cloud access, Home's first-run row and the widget row use the person's words (computer, Loki button), not ours (runner, widget). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * docs(ux): the November UX pass, the public surface map, the changelog Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * feat(fields): the remaining text boxes get the microphone; chatkit 0.27 The second step of the fleet's experience standard for Loki. The shared field gained what a form's text area needs in bitbaum/chatkit#85 (0.27.0): autoFocus, onKeyDown, a submit key, a field-level blur, name, inputProps. Sixteen more files move onto <TextArea>; the experience audit goes bareTextareas 17 -> 1 and the ceiling in package-plan.json follows. Kept, file by file: Cmd/Ctrl+Enter saves where Cmd+Enter did (goal and person notes, project description, the idea step), Escape still cancels, Enter still sends an interview answer and confirms a queued prompt, notes still save when focus leaves the field, and an inline editor no longer closes when its microphone is pressed. The studio's forms still read their text by name from the native form. The scheduled job's prompt keeps the mono face and spell-check off. ProjectBriefFill's separate Speak button is the field's own microphone now (the same transcribe route). Left: control/prompt-input.tsx, a prompt box with its own attachments and paste-to-attach. It is a composer, not a form field. Checked: tsc, lint, the design gate, file inputs, 599 unit-test files; in a browser, autofocus, both submit keys, Escape, save on blur and not on the microphone, 44px microphone and 16px text at 390, and the chat and Home composers after the bump. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * test: a git fixture cannot reach the real repository from a hook in a linked worktree A hook run from a linked worktree exports an absolute GIT_DIR, which overrides git -C <sandbox>. dispatch-launch-dir.ts ran its fixture commands with that environment, so a pre-push from a second worktree wrote a test@test init commit onto the branch being pushed and set core.bare = true, a test identity and a hooks path of /dev/null in the real config. Nothing reached the remote; the repository was repaired by hand. worktree-workspace.ts already clears those variables for itself. The unit runner now clears them once for every test, and dispatch-launch-dir.ts does so for a direct run. Checked: with a bogus GIT_DIR inherited, the test passes and the real repository is untouched. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * docs(ux): the text boxes' second step, and what is left Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * chore(deps): chatkit 0.28.1, where a dictated take respects a field's maxLength bitbaum/chatkit#87, found while reviewing this branch's converted fields. 0.28 also draws a visible border on the composer while it has keyboard focus and stops thread-following from scrolling the page up. Checked on 0.28.1: the chat, Home and homepage boxes at 390px in both themes (text goes in, send enables, no sideways scroll, no console errors), tsc, lint, the design gate and the widget size test (41 KB budget holds). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * refactor(ux): the text boxes and the chatkit raise leave this pull request The staged rollout gate holds any pull request that raises a shared package until both chatkit canaries serve that exact version. On 2026-11-12 kivvi and causius served chatkit 0.25.0, the gate could not match kivvi's deployment receipt to its current commit, and this pull request raised Loki from 0.22.1 to 0.28.1, so it could not merge. Everything else in the pass needs no package change. This commit undoes the three text-box commits ( |
||
|
|
119a1025a8 |
fix(loki): "I have one" opens the projects an account already belongs to; import stays second (#1683)
QA's Viewer seat owns no project but is a member of qa-agent-walk. Home's
"I have one" opened the GitHub import ("No GitHub account linked yet")
instead of the project it already had.
The /loki seed counts projects shared with the account (listSharedProjects).
With none of its own and some shared, the start chips are New project,
"I have one" (opens /projects, which lists them) and "Import from GitHub".
An account with nothing shared keeps "I have one" as the import.
Test: scripts/test/i-have-one.ts.
|
||
|
|
cacac77ffa |
fix(terminal): say whose cloud builder is off, not "Cloud runner offline" while the fleet's runner is up (#1682)
QA's seat read "Cloud sessions are offline" (and "Cloud runner offline" at 1366) while the runner was up. Presence is read per account: the seat's own private builder was what was off, and the words read as the fleet's runner. - /api/builder/presence answers cloudScope: fleet (the account the box's runner works for), private (its own builder) or none. - /terminal's chip and empty state say "Your cloud builder offline" and that it is separate from the runner that builds Loki's own projects; an account with no cloud builder reads "You can't see this cloud runner". - An account not allowed on the cloud is gated, not offline, even before open-tabs answers. Test: scripts/test/terminal-whose-runner.ts. |
||
|
|
2dc59d1d83 |
fix(home): Home says why it is empty and how to get in, instead of loading forever (#1681)
QA's seat opened /control with a session that could not read Home: the /api/control read answered 401, `data` stayed null, and Home showed its skeleton cards for as long as the page was open. A failed read now shows what happened: a 401 or 403 says the browser is not signed in (or is the wrong account) with a Sign in link back to Home; anything else names the error with Try again. Test: scripts/test/home-load-failure.ts. |
||
|
|
033d3bbb0f |
fix(queue): an idle session does not hold its project's queue, and a queued task says what it waits on (#1680)
* fix(queue): an idle session does not hold its project's queue, and a queued task says what it waits on Grok Bot's dogfood, 12 Nov: two /api/inject prompts to orangecat (08:10 and 09:21 Zurich) sat Queued for over an hour behind "an earlier task" while that session had been idle since 06:17, and the 10:25 answer promised "starts in 5 minutes at the latest". - A beat under 512 bytes is not work (lib/run-progress isWorkingBeat): an idle session trickles 40-96 bytes a minute (#1676), which kept lastProgressAt fresh. A blocked beat still counts. - A delivered run with no working beat for 30 minutes, and not blocked on a question for a person, no longer holds its project's lane (runIdleSql in olderOpenRunSql: the claim gate, the blocker lookup and the reaper read the same definition), and the reaper no longer shelters it because its project's process is alive. Its close says it went quiet. A run that never beat keeps its lane: unknown is not idle. - A queued task names the run it waits behind, when it opened and when its agent last printed work, in Zurich time (inject answer: message and waitingOn; the run's track). The update hold's five-minute bound is not said for a task that waits behind an open run. Tests: scripts/test/idle-run-release.ts; lane-and-reaper gains two real Postgres scenarios (an idle run releases the lane and is closed; a working run and a run asking a person still hold it). * fix(queue): an idle run does not make its project busy either, as in the claim gate |
||
|
|
dcc912e487 |
fix(auth): an agent's token reads its projects, its account and its conversations (#1677)
A Viewer seat sending its ck_ token got 401 from /api/user-projects, /api/me and /api/projects/:id, and could not follow a conversation: the middleware let the Bearer through, but each GET asked for a browser session only. - GET /api/user-projects, /api/user-projects/:id, /api/me, /api/projects/:id resolve the caller with getApiUserId (cookie first, then the token). - The transcript stream takes a token too (getApiActor); a plain shell stays a signed-in person's (mayPeekTab), and the stream stays keyed by the caller. - Scope is the user's own: owned rows, or a project shared through a membership with its role. Writes that change the account or a project stay session-only. Tests: scripts/test/token-session-routes.ts (which handler takes a token, which does not); scripts/test/token-scope.ts in test:db (a seat's token reads its shared project read-only, never the owner's other one; expired and revoked tokens resolve to nobody). |
||
|
|
7ea443c528 |
fix(mcp): session links name their builder, and a dispatch hands back the link (#1673)
loki_sessions and loki_session_read built their links as a bare /terminal?project=, so a phone that last chose 'Your computer' opened the laptop's session of the same name instead of the cloud one (traced 2026-11-12; fixed for the HTTP routes in #1657). Both now use sessionOpenUrl, which names the cloud builder, and loki_dispatch passes on the openUrl inject-core returns, in its text and structured content. Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
a1b009f26e |
feat(sessions): a token reads its sessions and what was said in them (#1661)
* feat(sessions): a token reads its sessions and what was said in them An agent that starts Claude Code in a Loki session (tab-inject) could read the screen (#1641) but not the conversation: the parsed transcript was only readable over the cookie-only transcript stream, and since #1644 over OrangeCat's signed rail. - lib/session-reads: the list, one run, or one project with the last things said in its conversation, moved out of the signed route unchanged, so two doors share one copy - GET /api/control/sessions: the same reads with a session or ck_ token (?project=, ?runId=, ?items=), no-store - every row names its session and carries openUrl, the same session in Loki's Terminal on that run (lib/dispatch-card sessionOpenUrl) - the list says it is cut at 25 and carries total, so a cut list is never read as the whole one - LOOP-WALK's Session walk names the read; tests pin both doors to the one lib Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy * fix(sessions): the conversation read is current, on the session's builder, and never ends a person's view Traced end to end before merge (2026-11-12): - a cached conversation was served forever: after the first read sent peek_stop the runner stopped streaming, so a later read returned the same copy without the agent's answer. The cache now counts only while someone is watching; otherwise the read waits for a frame posted after it asked. - peek_start and peek_stop carried no channel, so the owner's laptop runner could take a read meant for the cloud session (transcript null). They now name the project's builder (projectPreferredChannel). - the read counted its viewer under a key of its own, so its peek_stop could end a person's live view of the same session on a phone. It now shares the Terminal's viewer count (same user, tab and channel). - a cloud link carried no source, so a phone that last chose 'Your computer' opened the laptop's session of the same name. sessionOpenUrl names the cloud builder, and each row's link uses the session's builder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
6d47eae8a5 |
feat(studio): the studio site can tell who is signed in (#1672)
bitbaum.orangecat.ch is static files with no accounts of its own; a person's account there is their Loki account. Until now its header could not know anybody, and a builder's only way back in was a Loki page that makes a new private link. - GET /api/studio-session answers the studio's origin, with the reader's own session cookie: a name, a handle, a picture, whether they run the studio, and their builder applications by status. No email, no account or application id, no access key. Signed out is an answer (200), with the addresses to sign in and out at. Public on the proxy's list because the proxy's own 401 carries no CORS headers. - GET /studio/return?to=/builders/ is the studio site's sign-in door: behind the proxy, so a signed-out visitor signs in first, then lands on that page of the studio site. The destination is a path on the studio's own origin and nothing else. - /sign-out?then=studio ends on the studio site (/studio/left, public). - One header shape for everything the studio site reads with a session (STUDIO_SESSION_HEADERS); /api/fleet/private uses it. scripts/test/studio-session.ts pins the answer's shape, what it must never carry, the return-path rule against open redirects, the headers, and which of the three routes the proxy guards. Claude-Session: https://claude.ai/code/session_019MDtmsSWTTpVpe4wh3v1sb Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
6a05433fe0 |
fix(runs): one status, after the review of #1647: a closed run is over, a held command is Starting (#1671)
An adversarial review of #1647 (an open run's status comes from its track) found five regressions, all live: - A finished run whose command was never claimed (queued for an offline builder, then stopped or reaped) read Queued, not terminal; callers polled it forever. A run that is over now reads its outcome first. - No run event marks a runner's claim, so a command a runner held read Queued, or Needs you: no runner has picked it up. Both status routes now hand the track what the command row knows (the claim; for a prompt typed straight into a live session, that it was submitted), and a claimed, unanswered command is Starting, never below. - The chat card's offline-builder view, with its one-tap Run it in the cloud, was never reached once that status read Needs you. It is again. - A direct-mode run read Queued, then Needs you, with no runner involved. - The run sheet had no words for Starting and Needs you; a blocked agent read "an agent starts on it in a moment". scripts/test/one-run-status.ts, scripts/test/dispatch-card.ts. Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
510d8e2a14 |
fix(runs): whose pull request it is, after the review of #1643 (#1666)
* fix(runs): whose pull request it is, after the review of #1643 A review of the merged attribution change found the remaining ways a run could claim, or act on, a pull request that is not its own: - The fix ledger decided "this run's" by time alone, and on that basis could merge (auto-ship) or put back into draft a pull request somebody opened on another branch, when the handoff named it. auto-ship prOwnership: Loki acts only on a pull request on one of the run's own branches; it reports one as the run's when it is on them, or, for a runner too old to report branches, when the handoff names it. - Evidence recorded before #1643 was never checked again, so run 70d1a78d kept loki#1636. It is checked with GitHub once and removed when foreign; Watch no longer falls back to evidence the ledger called foreign, and other views do not trust unchecked old evidence. - The window had no end, so an earlier run sharing a branch with a later one claimed the later run's pull request. It ends 15 minutes after the run. - Only the ten newest pull requests were scanned; a busy repository pushed the run's own off the page. Pull requests are asked for by head branch. - Legal branch names with # or + were dropped. The rules are git's. - The runner also reports the remote branch a checkout pushes to, skips the repository's default branch whatever it is called, and its exit and shipped beats carry the branch. Runner 0.8.69. scripts/test/run-evidence-ownership.ts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj * fix(runner): a run closes as shipped only with a pull request opened during it, and only then stops the agent The runner's idle check took any open or merged pull request on the branch the agent sat on. A session that carries on from an earlier run sits on that run's branch, so a read-only probe was closed Done with the earlier run's pull request, and the runner stopped the shared session whatever the server answered (also when the run had already been closed another way). - findShippedPr takes the run's start; a pull request opened before it is not this run's. - The server says closed: true when the beat closed the run; the runner stops the agent only then. Found by a review of the probe path (2026-11-12). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
00ac95a8a1 |
fix(home): a Being built row that needs you says Needs you once, the question, and takes a reply (#1670)
On a phone the owner read "Waiting for you · Waiting for your answer" on a project's row: the state twice, and nowhere what answer was wanted. The row titled itself with the project, so the question that control-now put into the job's title was never drawn. - The state is the canonical word, CANONICAL_LABEL.needs_you, once — the same vocabulary canonicalStatus() gives every other surface. - Then the question in one line: the session's block reason, else the run's handoff block reason, the session's next, the run's next; never empty. A permission prompt shows what it asks (the run's blockedQuestion, now carried on /api/control and typed on the run payload), a sign-in wait says someone has to sign the agent in. - An agent idle at its prompt waiting for an answer gets a reply field under its row; Send goes to that project's agent through the same /api/inject as the box at the top of Home. A permission dialog or a sign-in is not a typed reply: those rows open the session, as before. Tests: control-now pins the word, the question's sources and when a reply is offered; home-being-built-browser checks the row at 390px in light and dark. |
||
|
|
7dd29e12df |
fix(one-off): a fresh session stays one-off: nothing of the shared session goes in, nothing of it comes back (#1665)
Found by a review of the merged fresh-session change (2026-11-12):
- A retry (automatic after a refusal, or from Watch) re-sent a one-off as an
ordinary message, into the shared session. It is retried as a one-off.
- /api/control closed the project's newest run from the SHARED session's
handoff without checking whether it was a lane run, so a one-off could be
closed with the shared session's summary, announced to its caller, and
left running. A lane run closes only from its own session file.
- A one-off's prompt carried the project's escalation note ("diagnose the
last failure") and, on the local runtime, the shared session's last
handoff and an instruction to update the shared session file.
- A one-off's close advanced or cleared the project's escalation ladder.
- On the local runtime the shared tab's prompt and handshake files were
written for a one-off, even when the request was then refused.
- OrangeCat's separateSession asked for a lane, which quietly queued in the
shared session when no lane was free. It is a fresh session now: a
session of its own, or a refusal with the reason.
scripts/test/one-off-stays.ts.
Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
b824a48686 |
fix(lanes): a lane starts clean: from main, in a new conversation, without touching the shared checkout (#1662)
* fix(lanes): a lane starts clean: from main, in a new conversation, without touching the shared checkout A lane is a run beside the project's own session, in a worktree of the same checkout on the cloud builder. A review of the merged runner fixes (2026-11-12) found three ways it did not start clean: - Its worktree was cut from the checkout's HEAD, which on the box is the shared session's run branch (loki/run-<id8>). The lane began with another run's unmerged commits and its pull request carried them. It now starts from the remote default branch (worktree-workspace laneBaseRef). - Its checkout step ran git pull --ff-only in the folder the shared session's agent works in; the run branch tracks origin's default, so the live agent's files could move under it. A lane now only fetches (ensureBoxWorkspace pull: false). - A dispatch that carried the project's sessionId kept it in a lane, so the lane ran claude --resume of the shared conversation in a new folder. A lane resumes nothing. Also: a live lane reopened after a builder restart is looked for in its own folder (pty-runtime's record), and traced back to its checkout for pruning, not to the dispatch's laptop path. scripts/test/lane-base.ts runs real git for each case. Runner 0.8.68. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj * fix(lanes): a lane that cannot start says why in words the retry policy reads A laptop lane for a folder that is not on that machine was refused as a worktree failure, and a missing box checkout as "nothing was launched". auto-reimplement-policy reads neither as a workspace problem, so both were retried on a builder where they cannot work. Both now use its words ("does not exist on this machine", "nothing was launched here"). Found by a review of the merged runner fixes (2026-11-12). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
7718294354 |
fix(builder, composer): a silent sealed session no longer holds a runner update; the composer falls back to the cloud runner (#1676)
* fix(builder): a sealed session that has been silent for half an hour no longer holds a runner update The drain restarts the box runner only when no agent is working. A sealed session has no status file the drain can read: its agent lives inside gVisor and the unit's cgroup holds only the `podman run` that relays its terminal, so it counted as working for as long as it was open, and sessions stay open for days. Measured on the box, 2026-11-12 07:56 UTC (Sealed builds run 43178274733, mode=activity): three open sealed sessions, one of them eighteen hours old, relayed 0, 40 and 96 bytes in a minute while the drain logged "3 agent(s) working — deferring restart" on every look. The runner stayed two releases behind for hours, so the runner fixes merged that morning were not running, and the commands route held new work for the restart. - agent_is_busy: a sealed session that has relayed under 512 bytes a look for 30 minutes is not working. Shorter than that, or a quiet that cannot be told, still is: unknown is not idle. - quiet_for reads the relay's cumulative byte counters and keeps its note under /run/loki-drain/<unit>, outside the drain's own process: every deploy starts a new drain, and a clock that restarted with it would never reach thirty minutes on a box that deploys several times an hour. - The rule is the sealed session's alone. An unsealed agent that is not Claude still always holds the restart: its output was not measured. What it can cost: a sealed agent stopped at a permission prompt in the middle of a task prints nothing, so after thirty minutes of that the restart goes ahead; the session reopens and its open run is closed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt4p1jMfJnbJtpeNhi * fix(composer): the project composer falls back to the cloud runner when the project's own builder is off The chat reroutes a project pinned to an offline computer to the cloud runner and says so (inject-core). The project composer for an idle project (/api/control/tab-inject) asked for the routing decision without that fallback: a project registered from a laptop queued for the laptop while it was shut, with the laptop's folder as the place to start, and the answer named no builder. The row sat until the reaper closed it an hour later. - tab-inject passes the project's offline fallback, starts a rerouted dispatch in the folder the cloud runner clones into, and answers with the builder that took it and the reroute sentence. - execution-access test pins the three. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt4p1jMfJnbJtpeNhi --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
29944cfd65 |
fix(queue): every way a feedback fix starts gets its lane, and a busy project never queues a message it has no run for (#1669)
Found by a review of #1639 (2026-11-12): - "Implement all", the widget's "Build all" (both batch-dispatch) and the automatic retry of a stuck Implement (retry-queued) did not ask for a lane, so since #1639 they waited behind the project's open run while a single Implement got one. They ask for a lane, as Implement does. - The claim gate holds a busy project's queued row back by its run. When the run could not be recorded (a failed insert), the row had none, was claimable at once, and would be typed into the session it was meant to wait for. Such a message is refused with a sentence; nothing is sent. scripts/test/busy-placement.ts. Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
2784b1d62d |
feat(loki): the Cat reads what Loki needs from you, with a link; the start knows the day (#1668)
OrangeCat's Cat opened the owner's morning with "Loki is waiting on you to
continue orangecat": no words for what Loki needed, and a link that 404s.
Rail (POST /api/orangecat/actor-status, OrangeCat's Cat home and context):
- lokiUrl used the user_projects id; /projects/[id] is keyed by the entity
id, so every link the Cat gave opened a 404. Entity id now, or the by-name
/projects/go/<name> when there is no entity.
- blockReason crosses as its code. Agents write "awaiting_user — no
high-impact work remains; …", which never equalled "awaiting_user", so
readers comparing codes missed the most common block.
- needsYou per project: the agent's own next step (session_next) when the
project waits on its owner; the autopilot's brake becomes "Loki finished the
work that mattered most. Pick what comes next." instead of "waiting on you".
- needsYou top level: approvals and the owner's alerts, from the same
composition /today shows (composeNeedsYou over loadNeedsYouExtras), counted
tiers only, each with an absolute link; linkless lines never cross. The PIN
rule is upstream: locked, only the approvals count leaves.
Start screen (/loki, the home after sign-in since 2026-11-01): the date and
time under "What are we working on?", read from the reader's clock, and one
row into Today ("Start my day" in the morning). The day stays Today's
(2026-10-21); this is a row, not the card that was removed.
APP_LOCALE moves to src/lib/constants/locale.ts (re-exported from
constants.ts) so a client bundle can import it without os/path.
Claude-Session: https://claude.ai/code/session_019MDtmuRtJkg48NMfQPd41v
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
663661c565 |
fix(inject): a read-only probe ends Done on the builder it asked for, and a refusal by choice is not a failure (#1667)
* fix(inject): a read-only probe ends Done on the builder it asked for, and a refusal by choice is not a failure Found by a review of the probe path end to end (2026-11-12): - Every run's status went through the feedback-fix mapper, which calls a run that finished well with no pull request "Needs you, nothing shipped". A git status probe ended there. Only a feedback fix owes a change; any other run that finished well with nothing pushed is Done, cause finished_no_change (canonicalStatus expectsChange, from run-track-load). - Neither POST /api/inject nor MCP loki_dispatch could ask for the cloud builder: zod drops unknown keys, so builderChannel vanished without a word. Both take it now (builderChannel / builder). - A fresh session refused for lack of a free lane was closed as a failing run and advanced the escalation ladder; four of them paged the owner with no agent ever run. That refusal no longer counts. scripts/test/probe-path.ts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj * test: two text pins follow the new shape of the inject route and the refusal close busy-placement read the inject route's call on one line; refused-dispatch- closes-run read closeRunUndelivered with a one-key options object. Both still assert the same thing: the route passes session on, and a refused dispatch closes its run quietly before the failure is reported. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
d128019ab9 |
fix(one-off): a fresh session ends with its run, on the builder it ran on, and says where it is (#1664)
#1640 closed a one-off's tab only when its own handoff closed the run. One that never reported (reaped), was refused on its ack, or ended with a runner restart kept its agent open in its lane, free to go on to something else and holding a project lane and a builder agent session. - one-off-close.ts: notifyRunClosed, which every close path calls once, queues close_tab for a one-off's lane tab; the handoff close no longer does it separately. - The close goes to the builder the dispatch command names now. A queued dispatch moved to the other builder used to be closed on the first one, which answered "nothing to close". - loki_dispatch's result carries the lane tab (sessionTab) and says it. - A refused fresh session reads the lane count again before it says the project is full; a database error used to read as "wait for one to close". - scripts/test/one-off-close.ts. Found by a review of the merged runner fixes (2026-11-12). Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
64e2c6b543 |
fix(builder, runs): a held task waits minutes and says so; a build says when it is live (#1663)
* docs(handoff): checkpoint for building with Loki and with a Cat bot The objective, the two journeys that count as done, how production can be reached from an agent session, and the state when the work began. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt4p1jMfJnbJtpeNhi * docs(handoff): what the investigation found, and what it did not reach Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt4p1jMfJnbJtpeNhi * fix(builder): a task held for the runner's update waits minutes, not for ever, and says so While the cloud runner is behind the deploy the commands route hands it no work-starting command, so the idle moment its restart waits for comes. The hold had no end, and on 2026-11-12 the restart did not come: two runner releases landed 35 minutes apart, the drain read "5 agent(s) working" on every look for an hour, and the builder claimed screen peeks and nothing else (Sealed builds run 43165605499). Every task a person sent sat queued while the chat said a runner would claim it shortly. - runner-update-hold: a held command is handed over once it has waited five minutes, and the hold applies only within two hours of the newest runner release. Running on last week's runner is recoverable; a task that never starts is not. - claimNextPendingCommand takes the overdue rule. While holding, an empty at-once list claims nothing (it used to claim everything). - The person is told why and for how long: in the chat reply, in the /api/inject answer (builderUpdating, message) and as the run track's headline while the job is unclaimed. - loki-loop-check.yml: the end-to-end check of the live site on demand, with an optional real no-change task that must come back into its thread. loki-e2e-check.sh --report takes the project, the wait and the dispatch choice from its caller. - sealed-builds.yml mode=activity: read-only, what each agent process of the runner read and wrote over a minute, so the drain's "working" can be measured for sessions it cannot read a status for. - pre-push: the watchdog's sleep no longer holds the caller's output open for fifteen minutes after the push has landed. Server and box scripts only: no runner code, no runner version. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt4p1jMfJnbJtpeNhi * fix(runs): a build tells the truth after the agent finishes, and says when it is live A task sent from the chat ended at "done, pull request opened". What it said next was wrong in several ways, and the one thing a person waits for, that it went live, was said to nobody. - The "done" message reads the pull request the runner itself reported (payload.prUrl from closeRunShipped, read by nothing until now) and asks GitHub with the token that can read the repository. The person's own OAuth token is refused on the organisation's repositories, so a run that shipped could be posted as "No pull request or push was found". The reaper's evidence lookup asks the same way. - "Live" is read from the site: a merged change is live when the commit in the site's /.well-known/fleet-release.json is the merge or comes after it (feedback/served-release). Workflow-run labels are wrong on this fleet: a Deploy run is labelled with main's tip at its start, a batched merge has no Deploy run of its own, and OrangeCat's deploy is named CD. It only upgrades; with no receipt the workflow-run verdict stands. - A chat build is followed to live on the fifteen-minute cron that already follows feedback fixes (run-follow-notify): on the change to live, or to a failed deploy, one line in the thread the task came from and one push. GitHub and the release receipt only, no model. Old news is not announced. - A task that waits behind the project's earlier run says so in the chat, the /api/inject answer (queuedBehind, message) and the track, instead of "will claim it shortly". - Isolated runs ship through a pull request: worktreePromptNote told every lane and one-off session to push straight to main. - The close message no longer prints "Live: <address>" beside a pull request that has not merged. Server only, plus one prompt line the runner reads at its next start. No file under desktop/, no runner version. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt4p1jMfJnbJtpeNhi --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
f7a0b051b7 |
fix(runner): a dispatch is delivered only once the request is in Claude Code's own conversation (#1660)
A busy CLI looks the same whether it is answering the request or carrying on with its own plan (probe 9e3658d9, 2026-11-12). The runner verified a Claude dispatch on the CLI's session status alone. - prompt-evidence transcriptShowsPrompt: the request must be in the agent's log as a person's message written after the inject. Measured how Claude Code 2.1.322 logs a pasted prompt by driving it in a pseudo-terminal as the runner does: inside <pasted_content> tags, which are unwrapped. An older [Pasted text #N] placeholder after the inject also counts. - The dispatch ack is verified:false with a sentence when the log exists and the request is not in it; no log is no evidence either way. - The ack now sends deliveredAt and workspaceId. Both were built and then dropped, so delivery was stamped at ack time. - Runner 0.8.67 with its release note. - scripts/test/prompt-in-transcript.ts, with the measured log line as a fixture. Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
220ea00416 |
fix(runs): the delivery track shows a pull request and commits only from the run's own branches (#1659)
#1643 tied live evidence to the run's branches, but the track's own read of the repository (lib/repo-progress) still took the newest pull request opened since the run began, and the newest push. That read is where run 70d1a78d's "Pushed: <#1636's commit>" and its pull request came from (2026-11-12). - readRepoProgress takes the run's branches; a pull request's head and a pushed ref must be one of them. - run-track-load passes runBranches(run). - scripts/test/run-branches.ts replays the incident against repo-progress; the three new checks fail on main and pass here. Claude-Session: https://claude.ai/code/session_019MDtmtHxn2FxY2x8pJ83Xj Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
b376ead370 |
feat(orangecat): a bot follows a run to its answer, and asks a one-off in a fresh session (#1658)
* feat(orangecat): a bot follows a run to its answer, and asks a one-off in a fresh session A bot that sent a task could not reliably read the answer: - the runner streams a conversation only while someone watches it, so a read a minute later found nothing, or an older conversation passed off as current - a read by project took the project's latest open run, so an answer in a separate session could come back as the shared session's conversation - a one-off session closes when it reports, leaving nothing to ask for after - /api/orangecat/task could not ask for the fresh one-off session (#1640) Now, on /api/orangecat/sessions: - runId + watch (seconds, <= 300): the bot holds that run's session as a viewer for that long (lib/integrations/orangecat-watch.ts), so the runner streams the conversation while the agent works - runId + items: the last items of THAT run's own session (its lane or one-off tab), on that run's builder - every row carries the agent's handoff once it reports (lib/run-handoff): the answer survives the session being closed - a read with nobody viewing waits for a snapshot newer than its join; an older copy alone comes back marked live: false On /api/orangecat/task: session "fresh" (and separateSession as its alias) gives each project a one-off session; a busy project is no reason to refuse it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU * fix(orangecat): a signed task outside its window is refused; a run whose track fails is never read as idle From review of the rail: - /api/orangecat/task had no freshness window, so a captured signed request could be replayed to start agent sessions later. It now takes issuedAt and refuses one older than the read doors' window (optional until every OrangeCat sends it; OrangeCat sends it from now on) - a sessions read whose run track failed to load reported the run as Idle with no runId, which a follower took for settled. Such a run is now said from its own row: working while open, done or failed once closed, with its handoff Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU * fix(orangecat): a follower's poll never reaches GitHub; a transcript read waits for the whole snapshot From review: - a bot following a run reads it every few seconds, and every runId read loaded the owner's full track, which looks at GitHub. poll: true reads the run's own facts and cached ledger only - the runner posts a snapshot in batches of 100; a read returned on the first batch, so a long conversation came back without its tail. It now waits until the batches stop arriving Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU * fix(orangecat): a session's task says what was asked, not the cross-project preamble From review: for a task sent to several projects, the row's one-line task was the first line of the preamble the agent is given ('Cross-project task. The same request below was sent to ...'). askedOf takes the preamble off; a prompt without one comes back as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
12e0357d8f |
feat(sessions): starting a session answers with where a person opens it (#1657)
* feat(sessions): starting a session answers with where a person opens it An agent that starts Claude Code in a Loki session hands the owner the session to look at, on a phone or a computer. The Terminal's address was built only inside the app's own cards, so a caller had to guess it. - lib/dispatch-card sessionOpenUrl: the full link to the session in Loki's Terminal, on that run when there is one, This computer for a local one - tab-inject (live, dispatch, queued), /api/inject and MCP loki_dispatch (through inject-core, a parallel lane included) and agent/launch return openUrl - LOOP-WALK's Session walk says so; scripts/test/session-open-url pins it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy * fix(sessions): a session's link names its builder A cloud openUrl carried no source, so the Terminal opened whatever source that browser last chose: a phone that last picked 'Your computer' opened the laptop's session of the same name instead of the cloud one the agent drove (traced 2026-11-12). sessionOpenUrl now says source=cloud for the cloud builder, and the screen capture's openUrl (POST /api/control/peek-tab) is the same full link instead of a bare path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
8d2101068a |
chore(crons): call Solon's Places import hourly (#1656)
The route no longer does the work inside the request: it starts a worker that drains the queue of sources its run log says are behind, and answers at once (solon src/lib/places/importer/queue.ts). Called hourly, a publisher that was down is tried again the same day, and a day with hundreds of sources due no longer needs one request longer than the runner's 300 s. Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
662b0c9038 |
test(ai): the chain tests clear every key the chain reads, not a list that missed Gemini (#1655)
ai-budget-gate and chat-chain unset GROQ_API_KEY and OPENROUTER_API_KEY by
hand before checking that an unkeyed provider adds nothing. Gemini joined
the chain later, so on any machine holding GEMINI_API_KEY both failed
("unkeyed providers contributed capacity", "unkeyed provider leaked into
the chain") for a reason that was the environment, not the code.
Both now take the key, model-override and budget-override names from
CHAT_CHAIN itself, so a provider added later is cleared too.
|
||
|
|
694961287e |
test(unit): a machine where node-pty cannot load skips the PTY tests and says why; CI still runs them (#1654)
The terminal tests (executor, sandbox-executor, plain-shell,
terminal-run-view, claude-dialog-not-a-composer) drive a real PTY through
node-pty. Its native binary is built where pnpm install ran; an agent
sandbox that shares the box's node_modules on an older glibc cannot load it
("GLIBC_2.42 not found"). On 2026-11-12 every push from such a sandbox
failed those five in pre-push whatever the change, and the hook's only way
out is --no-verify, which also skips everything that did run.
Off CI only, the runner now probes node-pty once. When it cannot load, a
test that fails with exactly that load error is reported as skipped, with
the reason printed at the top and in the totals; any other failure in the
same file still fails. With CI set the probe never runs, so CI's run stays
the gate.
|
||
|
|
85e8deac30 |
feat(mcp): a connected agent lists open sessions and reads what a session's terminal shows (#1653)
Over MCP an agent could send a task to a project's agent (loki_dispatch) and was told not to poll: it had no way to see that the session was up or to read what the agent answered. The HTTP side got both for a token in #1641. - loki_sessions: agent sessions open on the owner's builders, each with the link that opens the same session in Loki's Terminal. Plain shells are never listed. - loki_session_read: the end of one session's terminal output as plain text (escape sequences removed, redrawn and repeated lines collapsed). Queues the same peek_tab command as POST /api/control/peek-tab and waits up to twenty seconds; a builder that does not answer is an error that says so. A plain shell is refused before anything is queued. - both read only, so both sit under loki.chat, as the scope rule requires. Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
51c6e238dc |
ops(box): see who holds Postgres connections, reap idle ones on request (#1651)
* ops(box): read who holds Postgres connections, and reap idle ones on request * ops(box): reap also caps idle loki sessions at 15 minutes |
||
|
|
186679c091 |
fix(runner): auth and quota failures are judged only on the run's own evidence (#1650)
* fix(runner): the auth canary fails a run only on that run's own evidence A fresh solon tab on the cloud runner was failed as "claude is not authenticated" because the newest Claude transcript in its folder was a two-day-old session ending "Please run /login". A Grok run a minute later was failed with the same text, telling the operator to set CLAUDE_CODE_OAUTH_TOKEN, because the canary read Claude's folder for an agent that never writes there. The runner's sign-ins were fine. - Claude: a transcript last written before the prompt is not evidence. - Other agents: read what the agent printed since the prompt, minus the prompt's own words; never Claude's transcripts. - The error names the refused agent and its own fix. * chore(runner): 0.8.66 with its release note: the auth canary reads only this run * fix(runner): a quota wall is the agent's own answer, and a provider that answered since is not spent At 05:41 Zurich a Solon brief about replacing a "rate limiter" whose memory "resets on deploy" failed its run as "claude cannot generate because its usage limit is exhausted", and Loki then offered Claude as spent for an hour. Claude kept working for fourteen more minutes. - Claude: a wall counts only when Claude's own transcript since the prompt holds an API error naming a limit. The screen echoes our brief. - Other agents: the screen check also ignores an echo of the prompt whose spaces a TUI redraw dropped. - spentProviders: newest run per provider decides; a run that finished successfully after the wall clears it. An open run proves nothing. - Runner 0.8.67 (0.8.66 went to #1643). |
||
|
|
f873c3641c |
feat(orangecat): a person's bot files a finding into the feedback inbox over the signed rail, and reads it back (#1648)
A QA bot files through POST /api/projects/<id>/feedback with its own seat's
token. A person's OrangeCat bot has no Loki token: it acts over the signed
rail as the Loki account linked to its owner. It had no way to file.
- lib/feedback/agent-filing.ts is now the one body of a machine filing and of
a report's status read (moved out of the two routes, unchanged in what it
does: rate limit, idempotent replay, source agent, the owner's opt-in
build; the two status shapes by seat)
- POST /api/orangecat/feedback: signed, fresh, the linked account, a project
by name that the account has a seat on. A filing (words only) answers like
the seat door; { feedbackId } reads the canonical status
- no second inbox and no second contract: both doors call the same body
Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
9253f40898 |
fix(runs): an open run has one status, read from the same facts as its track (#1647)
/api/orchestration/runs/<id> and /api/control/commands/<id> answered status "delivered" / "working" while track.summary in the same response said "Waiting for a runner" (2026-11-12). The word came from the command row, the sentence from the run's events, and the run route treated every run as executed and verified from the moment it was opened. - RunTrack.live: Queued, Starting, Working or Needs you, decided in the same order as the track's summary; null once the run has finished. - alignLiveViewWithTrack: while a run is open, both routes return status, label, detail and tone from the track. - An open run is never "Delivered to agent" on a runner's ack alone: it is Starting until the agent prints after the prompt, then Working. - The run route reads the run's own command row instead of assuming it. - scripts/test/one-run-status.ts replays both contradictions. Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
0b6e30ac7a |
feat(orangecat): a task can name the cloud runner, answers with a status address, and a busy project says so (#1646)
* feat(orangecat): a task can name the cloud runner, answers with a status address, and a busy project says so The task door already answered with each project's runId. A caller on OrangeCat still could not ask for the always-on runner, had no address to follow the run at, and a task for a project that was already at work was queued behind the open run without a word. - builderChannel: "cloud" | "local" is passed to the dispatcher as the caller's named builder (403 with a sentence when the cloud runner is not this account's to use) - every sent project answers with statusUrl next to runId - a project with an open run refuses the whole task with 409 and a sentence naming it; queueIfBusy: true queues behind the open run as before /api/inject/multi and the MCP dispatch are unchanged: refuseBusy is opt-in. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU * feat(orangecat): a task for a busy project can ask for a separate session Main now queues a message to a busy project first in, first out, and gives a parallel lane only to a caller that asks (busy-placement). The task door passes that through: separateSession starts a lane for a one-off that should neither wait for the open run nor be folded into it. Without it, and without queueIfBusy, a busy project still answers 409 with a sentence, which now names both choices. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
ec0cd635ba |
feat(inject): session "fresh" starts a one-off session in its own worktree and closes it when it reports (#1640)
* fix(inject): a message to a busy project waits its turn; only a caller that asks gets a parallel lane With parallel dispatch on, every dispatch to a busy project forked a lane with a new agent session. A message sent to orangecat while a run was open (2026-11-12) started a second agent instead of queueing behind the open run, while the same message to loki queued: the difference was whether a lane was free, not what the caller meant. - orchestration/busy-placement.ts: the one rule. Busy means queue, first in, first out; a lane only for whenBusy: "lane". - executeInject plans a lane only through that rule. - feedback Implement asks for a lane, as before. /api/inject, the MCP loki_dispatch and chat dispatches are messages to the session and queue. - scripts/test/busy-placement.ts pins the rule and those callers. * feat(inject): session "fresh" starts a one-off session in its own worktree and closes it when it reports A read-only one-off question typed into a project's shared session does not stay one-off: "only run git status, then stop" was answered, and then the session went back to its own plan and edited tests (2026-11-12). - POST /api/inject and the MCP loki_dispatch take session: "fresh". - The prompt gets a lane of its own whether or not the project is busy: a new agent in its own worktree, no resumed conversation, told it is a one-off. - When it reports ready the run closes and close_tab is queued for the lane. - It never falls back to the shared tab: without a lane it is refused with fresh-session-unavailable (409) and nothing is sent. - scripts/test/busy-placement.ts pins the rule, the prompt, the close and the two entry points. --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
03d9415598 |
fix(registry): loki's own project runs on the cloud builder; an offline pinned builder is said in words (#1645)
* fix(registry): loki's own project runs on the cloud builder; an offline pinned builder is said in words The loki registration was pinned to the owner's laptop, offline since 2026-11-11 07:19, and its session note still described that laptop's blocked session. Every dispatch asked for an offline builder and was sent on to the cloud; an API caller saw only channel: cloud. - drizzle/0137: that one registration (found by its laptop path) moves to builder_pref cloud, and its session note is cleared while it still says what was stale. Data only. - rerouteNotice: the inject response says in a sentence that the project's own builder is offline and which builder took the work; the MCP loki_dispatch already prints the response's message. - scripts/test/registry-cloud.ts pins the migration's scope and the sentence. * refactor(registry): keep the reroute sentence clear of lines other open changes touch Same behaviour. The sentence's import, its place in the response and its place in dispatch-status.ts move so this change merges cleanly beside the open inject and run-status changes. --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
71cfa45816 |
feat(orangecat): a signed read of a person's agent sessions and their conversation (#1644)
OrangeCat bots steer Claude Code sessions over the signed rail, but the conversation was only readable over a cookie-only SSE, so a bot could send a prompt and never read the answer. POST /api/orangecat/sessions answers, as the Loki user linked to the actor: - every project's session in one row: builder, online, canonical state, the task in one line, last activity, latest run, its track sentence, PR url - with runId: that run, with the owner's full track - with project: the row plus the last N (<= 40) transcript items, clipped The state is the canonical one from the run-track loader; nothing is re-derived. The transcript is the copy lib/sse-bus already keeps; with none cached the route joins as a viewer for a few seconds, as the stream does. Claude-Session: https://claude.ai/code/session_019MDtmsQh5BSKKaJXnf4KjU Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
6bb3d7461c |
fix(runs): a pull request is a run's only when it is on one of the run's own branches (#1643)
* fix(runs): a pull request is a run's only when it is on one of the run's own branches Run 70d1a78d on loki ran git status and nothing else; its page claimed loki#1636 as its pull request and "Pushed:" with that pull request's commit. #1636 was opened by hand on another branch while the run was open. "The newest pull request since the run started" is a time window, not an attribution. - lib/run-branches: a run's branches are loki/run-<id8>, its worktree branch, and every branch its runner reported the agent's checkout on. Never main. - findRepoWorkEvidence takes those branches; a pull request's head or a pushed ref must be one of them. Watch, the reaper's correction and the outcome post all pass them. - The runner's progress beat carries the checkout's branch; the server keeps the list on the run (payload.branches). - The two branch names have one source; the builder code re-exports it. - scripts/test/run-branches.ts replays the incident against the real finder. * chore(runner): 0.8.66 with its release note --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
546d2ce912 |
test(terminal): the idle composer test waits for its own mount, not the last one's (#1642)
terminal-idle-browser failed three CI runs on 2026-11-11. The failing runs took about 40s against 8s when green and ended in a Playwright timeout: one 30s wait near the end of the file. Every late step starts with mount(), which re-renders under a new key and then waited for 'textarea', a wait the previous mount's box already satisfied. root.render commits in a later task, so on a slow runner the next fill or file went into the old tree and the remount discarded it. Reproduced by delaying the remount 12ms and 30ms (same 40s, same timeout at 'No session is running yet' and 'brief.txt'). mount() now waits for the box inside its own data-mount wrapper; the delayed runs pass. Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
46ec257ad2 |
feat(sessions): an agent's token can list open sessions and read a session's screen (#1641)
An agent could start a project's coding agent in a Loki session, type into it and close it with a ck_ token (tab-inject, tab-inject-raw, close-tab), and could even ask for a capture of its screen (POST peek-tab), but the list of open sessions and the capture's answer took a browser session only. It could not see that the session was up or read what the agent answered. - GET /api/control/open-tabs takes a session or a token - GET /api/control/peek-tab/[id] takes a session or a token, no-store - POST /api/control/peek-tab takes an optional channel and returns resultUrl and openUrl (the same session in Loki's Terminal) - a plain shell's screen stays a signed-in browser's: a token gets 403 on asking and 404 on reading (lib/peek-access) - LOOP-WALK gains the Session walk; scripts/test/agent-session-read pins it Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
fab5e0513a |
fix(inject): a message to a busy project waits its turn; only a caller that asks gets a parallel lane (#1639)
With parallel dispatch on, every dispatch to a busy project forked a lane with a new agent session. A message sent to orangecat while a run was open (2026-11-12) started a second agent instead of queueing behind the open run, while the same message to loki queued: the difference was whether a lane was free, not what the caller meant. - orchestration/busy-placement.ts: the one rule. Busy means queue, first in, first out; a lane only for whenBusy: "lane". - executeInject plans a lane only through that rule. - feedback Implement asks for a lane, as before. /api/inject, the MCP loki_dispatch and chat dispatches are messages to the session and queue. - scripts/test/busy-placement.ts pins the rule and those callers. Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
1be367df36 |
fix(builder): a dispatch starts in the builder's own checkout, never the laptop path (#1638)
* fix(builder): a dispatch starts in the builder's own checkout, never the laptop path
A message to a busy project gets a parallel lane, tab <project>~<run>. On the
cloud builder the checkout was looked up under that tab name: no such project,
nothing to clone, and the stored laptop directory went on to the sandbox
("Sandbox cwd does not exist: /home/g/dev/orangecat", 2026-11-12). The run
died before the prompt arrived.
- dispatchLaunchDir: the project's checkout on this builder first, by project
name, then the run's worktree of it. A lane without its own worktree, or a
project the builder can neither find nor clone, is refused with the reason.
- launchAgentPty no longer hands on a directory that is not on the builder,
and asks for the project's repository and token, not the lane's.
- /api/control/workspace-source answers for a lane tab as for its project.
- scripts/test/dispatch-launch-dir.ts pins it against the real checkout and
worktree steps.
* chore(runner): 0.8.65 with its release note
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
96ec923169 |
fix(feedback): a closed report never tells a seat the owner has to act (#1637)
A Viewer or Reporter seat polling an archived report read 'the project's owner or an editor has to act on it. Poll again later', and one marked done without proof read 'needs the project's owner'. Nobody is going to move a closed report. seatStatus now says so for closed_without_change and done_unproven: who nobody, kind none, and what the filer can still do (look at the live page, file a new report). Open reports are unchanged. Claude-Session: https://claude.ai/code/session_019MDtmtCjm3CvrFm3kYaTgy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
0d8a06f099 | ops(hetzner): check and repair a corrupt grubenv from a workflow, dry run first (#1636) | ||
|
|
f92111d7f5 |
fix(feedback): a Viewer seat that filed gets a cause, reason and next step, not a bare Needs you (#1635)
GET /api/feedback/[id]/status gave a non-owner seat only {state, label}, so a
machine filer saw "Needs you" with no cause and no reason. seatStatus adds
cause, reason and a non-dispatching next step, still with nothing of the
machine; filing still starts no build.
Claude-Session: https://claude.ai/code/session_019MDtmuwGtV473C5Jg3NXEZ
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
7c3d4f1a77 |
docs(feedback): machine filer role and the scripted agent walk (#1624)
* docs(feedback): machine filer role and the scripted agent walk Adds the machine filer to the LOKI-WORKS roles table and an Agent walk to LOOP-WALK with the exact filing contract (seat token, idempotency, statusUrl, canonical states, build opt-in default off). scripts/walk/agent-walk.mjs files as an agent from the environment, polls statusUrl and never prints the token. Claude-Session: https://claude.ai/code/session_019MDtmuk1DzMJHBJdsDfRhG * docs(walk): statusUrl must share the LOKI_URL origin or the walk exits 3 Claude-Session: https://claude.ai/code/session_019MDtmuk1DzMJHBJdsDfRhG --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
ddd57fe562 |
fix(builder): sealed agents start after a reboot; the cloud builder caps open agent sessions (#1634)
* fix(runner): the cloud builder keeps at most eight agent sessions open On 2026-11-11 the box had 27 agent CLIs open, about 0.4 GB each, beside 21 live sites on 16 GB. Memory ran out and every site went down. Plain shells were capped at three; agent sessions were not capped at all. - lib/agent-session-limit: eight by default (LOKI_AGENT_MAX_OPEN changes it), cloud builder only, shells not counted, re-opening an open tab is never refused - /api/agent/launch refuses the ninth with a sentence that says to close one; Resume and New session already show that error - launchAgentPty refuses it again: every way in ends there (launch, dispatch, switch, tabs restored after a restart) and the server's count can be one heartbeat old Idle sessions are still not closed by themselves. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq * fix(builder): sealed agents start again after a reboot; runner 0.8.64 After the power reset of 2026-11-11 every sealed agent failed with 'the container failed to start: it exited before printing anything'. podman keeps its runtime state under the runner's $HOME/.run, a real directory, so the state outlived the reboot and podman refused every container ('current system boot ID differs from cached boot ID'). - the sealed drop-in gets an ExecStartPre that removes that state when it was written before this boot, and leaves it alone otherwise - sealed-builds.yml mode reset-runtime does the same by hand for a runner that is already up - desktop/package.json 0.8.64 with its release note: the session limit changed the runner Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
0a936f0023 |
fix(ux): Home and the Terminal say plainly whether anything is running (#1633)
* ops(hetzner): the disk cleanup reaches what actually fills the box Its first complete run (2026-11-11, dry) would have freed nothing: every app was already at two releases and the 127G in use was elsewhere. Six tiers written from that day's usage report, each dry-run first: - container logs over 200M are truncated (one was 2.2G), syslog rotated - /opt/<app>/app-prev-* copies older than 14 days (kivvi kept seven from July), never the live app or the rollback target - superseded browser downloads under ~/.cache: the newest of each is kept - superseded agent CLI versions: the two newest are kept - pnpm store prune - node_modules and build output inside checkouts and agent worktrees idle for 14 days and not in use; source is never touched The target percentage is an input (default 75). Database dumps and Solon's 17G of places-snapshots are deliberately not here. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq * fix(terminal): the empty screen says nothing is running After a restart ended every session the page read 'Pick up where you left off' over rows of project names, and the owner could not tell whether anything was running (2026-11-11). The fact comes first now, as a status line; the heading over the rows says what pressing one does. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq * test: a failed test file shows the end of its output, not one line The runner printed only the last line a failed file wrote. An uncaught assertion ends in its stack and a closing brace, so CI named terminal-idle-browser as failed three times on 2026-11-11 with ' }' and never said why. It now prints the last 40 lines. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq * fix(home): one sentence says whether anything is running, with a way to watch it The foot of Home's status card read '0 working · 0 awaiting input · 32 idle' over 'Counts only agents Loki started'. The owner, on a phone on 2026-11-11, could not tell from it whether anything was running or where to see it. - lib/running-now states it: 'Nothing Loki started is running right now', 'N agents working now', or that something waits for a reply - working agents get a Watch link to the Terminal; a waiting one gets Reply - the idle count (every project doing nothing) is gone; the caveat about agents Loki did not start is in the sentence, not a second line Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq --------- Co-authored-by: Claude <noreply@anthropic.com> |