Commit Graph

2781 Commits

Author SHA1 Message Date
alan accb9970b6 Send later menu: use AppMenuAnchor like every other menu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 20:27:32 +00:00
alan f5ce4e5d8e Merge branch 'worktree-agent-aa9ed772f90c7c7b3' 2026-12-02 20:20:08 +00:00
alan 545291e04a App: run failure reasons, Run again, labelled tabs, actionable errors, nav fixes
- Run rows show a failed run's reason (else its diagnostic's first line,
  full text in a tooltip) or a short result preview; the Summary leads
  with "Why it failed".
- Run again for succeeded/canceled/interrupted runs opens the New run form
  pre-filled (prompt, workspace, report format) at the latest version with
  the original offered.
- Run detail and stage tabs show their names; touch shows captions on the
  Runs header and artifact viewer actions (desktop keeps tooltips).
- ErrorNotice maps not connected / server too old / permission / timeout
  to what to do, raw detail behind Details (Schedules, create chat, Runs,
  Pipelines banners).
- Settings has no Back arrow; Schedules keeps the rail on wide windows;
  phone Settings leads with Connection and Notifications and has a
  Jump to topic menu.
- Walkthrough: Open Connection (skipped when connected), labelled Copy.
- Pluralised counts; no duplicate status/rail names for screen readers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 20:16:22 +00:00
alan 59d2fdcb20 Merge branch 'worktree-agent-a785be85dc8fbff78' 2026-12-02 20:15:14 +00:00
alan 3cf6c5c0d5 Chat: create an unnamed chat without a title; 24-hour Send later picker; capture fixtures
The repository refused a blank title before sending it, so clearing the
Name failed with "Enter a chat name"; it now omits the title and only
requires a directory. The Send later time picker uses the 24-hour clock of
the Scheduled line. The capture fixture gains ?harnesses=1 (three
harnesses, two folders) and ?tables=1 (wrapping, long-token and too-wide
tables).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 20:10:47 +00:00
alan 876336f6fd Merge branch 'worktree-agent-abc9e7b0a4e0a0f54'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 20:05:02 +00:00
alan b1db6b9c50 Merge branch 'worktree-agent-a04a38e74fe1aef60' 2026-12-02 19:56:31 +00:00
alan b1fcdcf2c3 Chat: unnamed chats take the harness title, harness default per folder, word-safe tables, Send later
- New chat: a cleared Name creates the chat without an operator title; the
  list shows the harness's own title, or the default name until it has one.
  The server no longer records "New chat" for a blank title and OpenCode
  is created without a title so it names the session itself.
- New chat harness defaults to the one last used in the chosen folder,
  else anywhere, else OpenCode; remembered on the device per server.
- Markdown tables wrap at word boundaries and never go below a column's
  longest word (tokens over ~40 characters may break); a table whose words
  cannot fit scrolls sideways with the code block affordance.
- Composer: right-click, long-press, Shift+F10 or the context menu key on
  Send opens Send later... (30 min, 1 h, tomorrow 9:00, usage reset, pick a
  time), sent through the same path with send_at.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 19:55:40 +00:00
alan f02ff56dfe App: dark-aware HTML views, run cards, changed/missing file notes, one card width, dense diff rows
show_html documents that declare dark support follow the app theme; others
stay light. Tool description and skill docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 19:54:58 +00:00
alan 633b5953bb Chat: the server continues a usage-refused Claude chat at the reset
When Claude Code refuses an operator chat's turn for a usage limit and the
server does not continue it on another account, the server now queues a
durable prompt (auto-continue-<refusal id>, sent as Pipelines (automatic))
for a minute after the reset: the refused operator message when the turn
did no work, else "continue". The reset comes from the refusal's text,
else the rejected rate_limit_event. Refusals of turns Claude Code started
itself are handled too, with no client attached; a restarted server or a
device scheduling the same refusal adds nothing. The choice is kept per
Claude home beside auto-switch (or by the server for chats without one),
read and set with chat_auto_continue, on by default.

The app's limit banner now finds the refusal as the latest turn, ignoring
notices, agent reports and activity rows after it, reads and writes the
server's choice, and only schedules its own prompt for older servers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 19:52:03 +00:00
alan b91ef04ab0 Notifications: agent notify reaches every device and clears everywhere
- Server: chat ntfy messages carry a sequence id derived from their app id;
  clearing a chat app notification also clears it in ntfy (PUT
  /<topic>/<seq>/clear, verified on ntfy v2.38.1).
- Server: a turn that sent an agent notify does not also send chat_reply.
- notify tool and MCP instructions: Pipelines already notifies at reply end
  and for questions/approvals; notify is for mid-turn or background news.
- Shown notify items carry channels (apps/phone); the transcript row says
  where it went.
- App: NotificationBridge.close(tag); web closes tracked Notifications and
  tells other tabs over a BroadcastChannel; native bridge cancels by tag and
  now supports macOS. AgentNotices closes on notifications_cleared and on
  resubscribe cleared ids, and a tap sends clear_notifications.
- Docs: skill, chat reference, ntfy/notifications docs, app note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 19:49:31 +00:00
alan d204ce3187 Chat tools: argument validation, replace, file snapshots, server-fetched images, show_run, show_diff head/paths, schedule_followup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 19:44:47 +00:00
alan c441400f36 Chat: an unchecked earlier send no longer flashes 'Not sent' on open
A message a previous visit sent but never saw acknowledged was restored as
'Not sent' and flipped to sent a moment later, once the history read showed
the server had it. It now stays 'sending' until that read, and only becomes
'Not sent' if the server really does not have it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 16:48:13 +00:00
alan 7d7d839ffa App: remove the first-click permission hook only once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 16:39:31 +00:00
alan 355a5767fb Agent notifications are system notifications, never in-app toasts
An agent's notify call now always posts an OS notification when permitted,
whatever app is in front (only skipped while that chat is open in the
focused page); no toast or chime. Without permission the tab title counts
it. The browser's permission prompt is shown on the operator's first click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 16:32:29 +00:00
alan e05b2f07dc Merge branch 'worktree-agent-ae6543d03d048d81f'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 16:10:47 +00:00
alan 150481b57b App: agent notifications on the web (system notification, toast, tab title count)
The app subscribes to the notification stream on every connection and
delivers chat_notify notices: a toast when the page is focused (none if
that chat is in view), a browser notification titled '<chat>: <title>'
plus a '(n)' tab title count when it is not, and on insecure http pages a
toast, the title count and a short chime. Low priority posts only when
hidden. Replays within an hour show once; ids persist in the ledger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 16:02:47 +00:00
alan c264f865ff Servers: name a machine after its hostname once it connects
A saved server still named by the app ('My server', 'This server',
'Original legacy server' or its address host/IP) takes the hostname the
machine reports in get_status the first time the app connects; typed
names are kept. New servers (legacy migration, Settings with a blank
name, onboarding) start with the address host. A browser on its page
origin with no saved profile shows the reported hostname too. No server
change: get_status already reports the hostname.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:58:28 +00:00
alan c8541f29b7 Notify: an agent's notify reaches every connected app
The notify tool now records a chat_notify app notification with its own
id per call (no dedupe of repeated words) and the tool's priority, so
every subscribed client gets it and a reconnecting client replays it.
ntfy delivery is unchanged; the tool result names where it went.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:44:39 +00:00
alan 3e817a189b Keys: release a held modifier the browser says is up
After Ctrl+A switched Pipelines/Runs, Alt+K sometimes did nothing while
Ctrl+K worked: the framework still held Ctrl from a lost release, so Alt+K
read as Ctrl+Alt+K. Each key event's own modifier flags now release any
modifier the framework holds that the browser reports up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 14:27:38 +00:00
alan 1be33c0d46 Chat: choosing a docked chat hides the floating chat windows
A chat opened from the list, Ctrl+Tab or the quick switcher opened behind
the floating windows. Choosing a docked chat now hides the window group
(Alt+Y-style chord brings it back); choosing a floating chat shows its
window as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 14:10:47 +00:00
alan 1c4c1cfeef Merge branch 'main' into notify-link-claude 2026-12-02 12:30:58 +00:00
alan 0c75ff1b0d Notify link=: review fixes
- ntfy uses the link only beside a web run view; otherwise it keeps the
  run click and the receipt says why (app click stays the link).
- The outbox retry of a hook's failed publication re-resolves the stage's
  link=, so the ntfy and app tap targets keep it.
- A valid link file is never the attached artifact.
- Notification artifacts are read through os.OpenRoot with O_NOFOLLOW.
- The link note is recorded once, on the first receipt, and never becomes
  the run-level failure reason.
- Android: a recents relaunch does not reopen the link, and a run thread of
  several entries opens the run rather than the latest external page.
- Docs and the protocol comment say "first non-empty line".
2026-12-02 12:29:46 +00:00
alan 141661e355 Chat: Ctrl+K / Alt+K on Chat opens a quick switcher for the open chats
On Chat the chord now toggles a centred dialog (bottom sheet on a phone)
with an autofocused filter over the open chats in list order; Ctrl+N/Down
and Ctrl+P/Up move the wrapping selection, Enter opens the chat as Ctrl+Tab
does (pane reused, composer focused), Esc or the chord closes it. From other
destinations the chord still jumps to Chat. Ctrl+N/Ctrl+P are handled so the
web page prevents their defaults (Ctrl+P no longer prints); a browser tab
keeps Ctrl+N reserved, documented in the help and notes/chat-quick-switch.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 12:27:39 +00:00
alan f5f31b7bcd Notify link=: a stage's public/ file sets the phone tap target
A stage's notify block may name `link=<pattern>` (validated like `open=`).
When the hook fires, the newest public/ match is read (at most 4 KiB); its
first non-empty line, if an absolute http(s) URL ntfy accepts as a click,
becomes the ntfy Click and the app notification click, with the run kept
as the app's run action and ntfy's browser view. A missing file or invalid
URL keeps today's tap target and is noted on the receipt diagnostic.

Android opens such an http(s) click in the browser (after clearing the
notification) instead of handing it to Flutter as a route.
2026-12-02 12:20:22 +00:00
alan 26b1c00094 Chat perf: notes and numbers; the 4K bench runs on a wasm build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 01:34:53 +00:00
alan 9987697be4 Merge branch 'main' into worktree-agent-ae15c1acd71123eab 2026-12-02 01:21:19 +00:00
alan 7b045e5aab Chat perf: path-free running border, keystroke- and delta-quiet composer, spinners that do not relayout their list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 01:21:19 +00:00
alan 5e77ec35c6 App build image: make the build script executable regardless of the host umask
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:09:55 +00:00
alan 6de1fa588f Merge branch 'worktree-agent-a69b1e8a6164ea62e' 2026-12-01 21:05:51 +00:00
alan 3b1760fe8e Web: WebAssembly build served cross-origin isolated, immutable and precompressed
The web app is built with --wasm (skwasm, JS/CanvasKit fallback beside it).
The proxy serves it with COOP same-origin + COEP credentialless so skwasm
renders on a worker; an installed build loads from /_v/<buildId>/ cached as
immutable, other files revalidate by ETag, and the installer precompresses
.br/.gz variants the proxy sends by Accept-Encoding. The bootstrap no
longer registers Flutter's deprecated service worker (a reload per install).
Read aloud on the web uses the Web Speech API through package:web: the
flutter_tts web plugin's interop casts fail under wasm. Bench kit: isolation
and headed modes, renderer and memory reporting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:05:17 +00:00
alan 2889d59119 App: replace a silent socket instead of hanging; blink the terminal cursor on a timer; keep one markdown cache entry per streamed reply
A socket that outlived a sleep or network change looked open, so every
queued request waited its own 30 s timeout behind the last until the page
was reopened. The client now replaces a socket whose request times out
unheard (or after two timeouts in a row), and probes it with a ping after
a quiet spell or on returning to the foreground.

The terminal's blinking cursor ran a Ticker (a frame every vsync); a 530 ms
timer now flips it. Streamed deltas no longer flood the markdown cache and
evict finished answers.

Adds tool/perf/idle_session_bench.mjs (idle frames, long-session heap,
snapshot census) and notes/perf-hangs-idle.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:47:22 +00:00
alan 23d8658e80 Chat: Ctrl+Tab cycles the list's chats, starred only when any are starred
Ctrl+Tab / Ctrl+Shift+Tab on the Chat destination now steps through the
chat list's open chats in list order (wrapping) instead of the workspace
panes: only the starred chats when any open chat is starred, otherwise all
open chats. From a chat outside the cycle it goes to the first (Shift: last).
The target opens as a list click does, focusing the pane already showing it.
The terminal's claim on Ctrl+Tab and floating-window cycling are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:28:18 +00:00
alan 364e0cb3c9 Chat queue: wake the runner when a scheduled head is unqueued; end a stale observed turn once the harness is idle
A prompt queued behind a scheduled prompt (the app's auto-continue at a
usage limit's reset) stayed queued after that head was removed: unqueue
never woke the runner, which slept until the removed prompt's send_at.
unqueue now wakes it, and the runner re-checks a scheduled head at least
every 30 s.

Safety net: a due prompt held by a turn the room only observed (its end
lost, or a reattach watcher that gave up) is delivered once the harness
reports itself idle for a settle period and its probe confirms it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:58:51 +00:00
alan 18e0e565ca App: Claude account auto-switch setting; the limit banner leaves a refusal the server is continuing alone
The Claude account dialog shows 'Auto-switch account when usage runs out'
(claude_account_auto_switch) when the server reports it. The usage-limit
banner schedules no auto-continue while the server's auto-switch continue
prompt is queued. A chat refused after another chat already switched the
Claude home gets a fresh switch stamp, so its banner clears too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:31:31 +00:00
alan ed9072b79a Claude accounts: switch a chat refused for usage to another saved account and continue it
When Claude Code refuses an operator chat's turn for a usage limit, the
server marks the refused account until its reset and, if the chat's Claude
home allows it (claude_account_auto_switch / `pipelines claude-account auto
on|off`, on by default, kept in pipelines-accounts/settings.json), switches
the home to the saved account with the most usage left through the
claude_account_use path. Switches of one home are serialized, so chats
refused together switch once. Each refused chat gets one queued prompt,
marked as sent automatically, that asks the agent to check it is on track
before continuing; the app's auto-continue-at-reset prompt for the refusal is
removed (and refused if it arrives later), and the operator gets a
low-priority notification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:23:43 +00:00
alan 1995382e8c Merge branch 'worktree-agent-a241489d88c80f413' 2026-11-30 16:35:25 +00:00
alan 0dc805ae0e Chat: show the active Claude account in the send tooltip, menu and limit banner
usage.account now carries the email and organization of the account
Claude Code is signed in to (from its initialize account, or the saved
account just switched to), sent at process start and after a switch.
The app shows it as the send tooltip's usage prefix, the Claude account
menu subtitle, the usage-limit banner's status line and the info sheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:33:46 +00:00
alan a1891c818c Claude accounts: route the request with the chat's native session id
The account requests carry the chat in a claude_account body, which the
multi-machine gateway neither routed by nor stripped of its chat@ prefix,
so the server refused them as 'a valid chat session id is required'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:23:41 +00:00
alan e80f18969c Merge branch 'worktree-agent-a11776f2a9241a0c9' 2026-11-30 16:13:58 +00:00
alan 293474ac3c Chat usage limit: Claude Code-style banner with auto-continue; drop the approaching-limit banner
- The usage-limit banner now reads 'Out of usage credits' (or the refusal's
  own 'You've hit your 5-hour limit'), 'Auto-resuming at <time>', an
  'Auto-continue when limits reset' checkbox and Try again, keeping the
  account switcher's 'Switch to <account>'.
- Auto-continue (a shared, persisted preference, on by default) hands the
  server a durable scheduled prompt (send_at = reset + 1 min) with an
  idempotent auto-continue-<refusal id> operation id: the refused operator
  message again, or 'continue' when the refused turn had already worked.
  Unchecking unqueues it; Try again unqueues it and sends now.
- Remove the approaching-limit banner, its SnackBar announcements and their
  marks; the send-button usage ring replaces them.
- Claude Code's rate_limit_event overage fields (overageStatus,
  isUsingOverage/overageInUse, overageDisabledReason, overageResetsAt) reach
  clients as usage.account.extra_usage; the ring tooltip and the banner say
  'Extra usage available' or 'Using extra usage'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:13:33 +00:00
alan aeefe67631 Chat: a reply that streams during a history read is shown whole
The thread controller records numbered (seq) deltas that arrive while the
newest page is read and folds back those the page does not include, onto its
live parts or parts it lacks; a delta the page already included is not added
again when it arrives late. The page's order now leads when a reply streamed
during the initial read, so the reply stays below its prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 15:46:54 +00:00
alan 2cdd524ecc Merge branch 'main' into worktree-agent-a3ec65b20dc3028b9 2026-11-30 15:41:57 +00:00
alan ea25cf504f Claude chat: a history read mid-reply carries the streaming block's beginning
Claude Code writes a content block to its session file only once the block
is complete. A client that read history while a block streamed (opening the
chat mid-reply, a reconnect, a resync) got only the deltas after its read,
and nothing re-sent the block's beginning, so the reply showed with its first
part cut off. Deltas are now numbered (seq) and their text retained for the
newest assistant messages; the newest history page adds every retained part
the transcript lacks and reports the last included seq (live_seq) and the
overlaid parts (live_parts).

History now numbers empty text/thinking blocks as the live stream does, so a
thinking block after an empty display-omitted one keeps one part id live and
in history. Text a content_block_start carries is published, not dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 15:41:57 +00:00
alan 7a259d8f60 Merge branch 'worktree-agent-a49d9cec6b60ce85a' 2026-11-30 15:12:07 +00:00
alan c490f71042 Claude account switcher: save and switch a chat's Claude login in place
Saved accounts live under <CLAUDE_CONFIG_DIR>/pipelines-accounts/<slug>/
(0700 dir, 0600 files). Switching changes what /login changes: the
claudeAiOauth entry of .credentials.json and oauthAccount of .claude.json
(atomic temp+rename, mode and other keys kept) and the org caches /login
drops, under Claude Code's own refresh, storage and config locks, so
running CLIs continue on the new account without a restart. The active
login's rotated tokens are written back to its slot first.

Server: claude_accounts / claude_account_save / _use / _remove, chat-scoped
and Claude-only; a switch moves the home's open chats to the new account's
quota (usage.account.switched_at), clearing a reached limit.
CLI: pipelines claude-account list|save|use|remove [--dir].
App: Claude account in the chat menu, and Switch to <account> on the
usage-limit and usage-warning banners, with a confirmation snack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 15:10:08 +00:00
alan 22550b3403 Send button: keep its 'Send' name for assistive technology when usage is shown
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 15:06:22 +00:00
alan 3951c65a7a Chat: a discreet usage ring around the composer's Send button
A thin ring around Send shows the harness account's 5-hour window used share
(the most used live window when there is no 5-hour one): barely visible
normally, tertiary from 80%, error from 95%. The button's tooltip (hover,
long-press on touch) adds every window with its reset time. No ring when the
quota is unknown or unsupported. Painted behind the unchanged button, so its
size, target, states and animations stay as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:55:42 +00:00
alan 1772100af2 Claude history: show the newest 64 MiB of an oversized transcript
A session file over 64 MiB made the whole chat history unavailable. The
history now reads only the file's newest 64 MiB (from a whole line) and
opens with a notice that earlier turns are left out and how to see them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 13:46:09 +00:00
alan b6d06219cd Chat: warn before the harness account's usage limit runs out
A compact banner above the composer when any quota window of the chat's
harness account reaches 80% (error colours from 95%), naming the most
constrained window and a second one also at 80%+. Dismissing it holds per
harness+window until the next level (80/90/95) or a reset, across chats and
reloads; a newly crossed level is announced once with a root SnackBar. The
usage-limit banner wins. Fixture: quota=warn80|warn95.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 12:34:01 +00:00