Commit Graph

97 Commits

Author SHA1 Message Date
alan eed3806efb Add a home-restricted folder picker to the new-chat dialog
Server: list_directory returns a directory_listing (path, home, parent,
entries with is_dir/is_git_repo/hidden, truncated) confined to the server
user's home subtree after cleaning and resolving symlinks, refusing pseudo
filesystems and capping entries at 2000. Documented in docs/cli.md.

App: "Choose folder…" in the create dialog opens a picker (full-screen page
on phones, large dialog on wide windows, Material and Cupertino) with
breadcrumbs, filter, Show hidden, git badges, dimmed files, recent folders,
inline errors and "Start chat here". The probe app gains a folder fixture
for captures.
2026-11-01 21:51:48 +00:00
alan e42f9cc031 Send mid-turn chat prompts to the harness and queue the rest durably on the server
Claude Code (stream-json stdin) and Codex (turn/steer pinned to the active
turn) receive a prompt sent while a turn runs immediately. Other harnesses
(OpenCode) get a durable chat_prompt_queue row owned by the session: it
survives the last client detaching and a server restart, is delivered in
order when the turn ends with or without a client, and is deduplicated by
operation id. chat_subscribe carries the queue, chat_queue frames report
delivered/removed/failed changes, and chat_unqueue removes a waiting prompt.
2026-11-01 18:30:20 +00:00
alan d1846441cc Stream ntfy notifications to app clients over /connect
Record every notification published to ntfy (run outbox, stage notify
hooks, chat question/approval/reply) in a persisted app_notifications
outbox and stream it to subscribe_notifications clients with an after
cursor; clear_notifications and ack_attention clear across devices, as do
runs leaving waiting, deleted runs and answered chat questions. Add the
notify.ntfy_enabled setting (default on) to stop only the ntfy publish.
2026-11-01 02:03:58 +00:00
alan 31e89e872b Add run size_bytes and delete_runs to free disk space
Every run summary carries size_bytes (artifact tree, server-created Pi
session directories and an estimate of the run's database rows), cached in
pipeline_runs.size_bytes, invalidated by triggers, measured when a run
finishes and backfilled in the background. delete_runs removes terminal
runs with every scoped row and server-owned file, refuses active ones with
a reason, and pushes runs_removed to subscribers. pipelines runs rm is the
CLI form; retention apply now shares the complete row deletion.
2026-10-31 22:11:14 +00:00
alan b109ab3e06 Notify on run end only for runs marked Notify me
Auto runs no longer alert on failure or success; only notify_mode on does,
unless the run_finished setting (now 'Notify when any run ends', default off)
opts into every run end. Waiting still notifies auto and on runs. The setting
is stored under a new key so a value saved under the old meaning is ignored.
2026-10-31 16:52:04 +00:00
alan f4b3ef17cc Persist and broadcast shared attention acknowledgements 2026-10-31 12:23:51 +00:00
alan 498c6f17a6 Add server notification settings with app checkboxes
Persist three global ntfy switches in server_settings: run_finished
(default on: auto-mode runs notify on success, read inside the
transition transaction; on/off modes unchanged), chat_needs_you
(default on: gates chat question/approval alerts) and
chat_reply_finished (default off: one alert per finished assistant
turn). Expose notification_settings / set_notification_settings over
the websocket protocol, add a Phone notifications section with
Material and Cupertino checkboxes in Settings, document the settings,
and keep the cli, tui, stage and pipeline test packages from
inheriting a real ntfy configuration.
2026-10-30 21:36:27 +00:00
alan 8c421952db feat(chat): show sent images as thumbnails with a full-screen viewer
Operator-attached images render as rounded thumbnails above the user
bubble and open a zoomable Material/Cupertino viewer. Inline data: URIs
decode locally; file:// attachment-store URIs load through the new
chat_attachment_image websocket request, which serves only regular image
files directly inside the private attachment store (os.Root, <= 4 MiB,
sniffed raster types). Missing files show an 'Image no longer available'
placeholder; other files keep the file row.
2026-10-30 20:53:03 +00:00
alan 6d430948a6 feat(chat): per-chat permission modes for Claude, Codex and OpenCode 2026-10-24 18:16:10 +01:00
alan 5a65526d29 feat(chat): chat-adopt finds Claude Code and Codex sessions, not only OpenCode 2026-10-23 22:03:08 +01:00
alan e507f554c3 feat(chat): files upload over HTTP before the prompt, up to 100 MiB each 2026-10-23 21:25:41 +01:00
alan fe02d153f1 Preserve saved schedule run-level write scope 2026-10-21 01:04:43 +01:00
alan 4d8b34939d Separate saved run schedules from pipeline definitions 2026-10-21 00:48:34 +01:00
alan 3e62ed7979 feat(protocol): distinguish reported chat metrics from unavailable values 2026-10-21 00:01:17 +01:00
alan 4969d667b3 Expose native chat compaction activity and retained replay 2026-10-20 22:17:41 +01:00
alan ec3eda9e05 runner: keep export handoffs nonterminal through recovery 2026-10-20 21:20:06 +01:00
alan ca78b24f47 fix(audit): expose verified visit exports and export-only recovery 2026-10-20 21:20:06 +01:00
alan d564765ca5 fix(codex): reconcile cold connections without resuming queued goals 2026-10-20 18:33:20 +01:00
alan 34939edd0e Render run list miniatures from compact per-stage route evidence 2026-10-20 18:22:13 +01:00
alan 9cdfd9d9ab search: browse bounded recent items with kind-only queries 2026-10-20 17:54:55 +01:00
alan 35329e4022 feat(chat): broker Codex approvals and complete typed tool interactions 2026-10-20 17:41:35 +01:00
alan ed0abb976d feat(chat): persist safe Codex next-turn model selection 2026-10-20 16:35:31 +01:00
alan a049b552f6 Recover incomplete session exports through durable runtime jobs 2026-10-20 16:30:04 +01:00
alan fdf0369ede Enforce runtime report contracts and recoverable session exports 2026-10-20 16:05:33 +01:00
alan b96b9d94a6 fix: keep cancellation pending until execution cleanup is confirmed 2026-10-20 15:49:08 +01:00
alan e504780976 fix(chat): settle authoritative turns and make capabilities explicit 2026-10-20 15:45:44 +01:00
alan 016fcb552a fix: persist and retry run alerts and honor notification modes 2026-10-20 15:44:23 +01:00
alan 6bfe4c8921 chat: add model switching and preloaded instructions
Expose the OpenCode model list and session model switch over the chat protocol,
carry a per-session model provider on chat rows, and apply a preloaded behavior
brief as a durable session instruction entry when a chat is created.
2026-10-20 14:58:20 +01:00
alan f5ccec8e1f chat: deliver attachments and cancel runs immediately
Carry browser files as base64 prompt attachments, write them to private
temporary files and pass file:// references to OpenCode, and map the user
turn's top-level files back into history. Replay a running step on subscribe,
forward only a caller-supplied msg_ id, and persist cancel on the run and live
step before interrupting the runner.
2026-10-20 14:30:53 +01:00
alan 0d7e81362f web: run pipelines from the browser and quiet background chat
Add the Run pipeline dialog with prompt, server directory and a per-run
notification choice; add --notify auto/on/off to run and retry; move the live
tool call onto the tool-count line and tick the reasoning duration; stop chat
frames from repainting a different screen.
2026-10-20 12:56:47 +01:00
alan f7a3a49f94 chat: add the Codex backend
Store a chat's harness with its operator session, expose chat_backends and a
backend choice in New chat, and route each session through a manager. The Codex
adapter uses the App Server's Unix WebSocket for threads, turns, history,
questions and interrupt; OpenCode remains the default and Claude is not
advertised until its sidecar and login are wired.
2026-10-20 12:10:39 +01:00
alan ff36e777c9 web: compose with Enter, share chat titles, reserve the star
Enter inserts a newline and Ctrl/Cmd+Enter sends; slash commands still run on
Enter. Chat renames are stored in the server registry so every device sees the
same title, with a one-time upload of old local titles. The star no longer
covers the row status, and shell frames patch the background bar in place so the
composer stays mounted while streaming.
2026-10-20 03:44:16 +01:00
alan 526c19fc21 web: shared chat stars, pipeline mini graphs and agent questions
- Persist chat stars in the operator-session registry (chat_star) so every
  browser/device shows the same Starred group; migrate old local stars once.
- Add a compact pipeline graph shape to list responses and draw a lightweight
  list miniature; replace the cryptic id/version line with the stage count.
- Surface OpenCode form questions as a chat card (chat_answer), replay a
  pending form to late subscribers, and notify for background questions.
- Make the mobile dock's Search cell equal to every destination, keep the
  tab row visible with 100svh, and let Source use the full pane height.
- Let a fresh sign-in auto-connect to its own origin; use a Lax session cookie
  with Expires so Remember me survives app/link launches.
- Keep shipped starters and the skill agnostic: no repository paths, project
  areas or personal device commands; add Diagnose/Fix and Research starters.
- Refresh the installed skill and document the new browser conventions.
2026-10-20 03:11:37 +01:00
alan 217e11da1d Merge branch 'main' into turn-integration
# Conflicts:
#	internal/server/runner.go
#	internal/stage/model_prompt.go
#	internal/stage/model_run.go
#	internal/stage/model_test.go
2026-10-19 22:32:13 +01:00
alan e37b864c40 stage turns: replace JSON results with file-based markdown turns
Each model visit now gets <run>/stages/<seq>-<stage>/ with input.md,
memory.md, output.md, private/ and a shared run-level public/. The model
reads the two input files, follows the stage's instructions verbatim and
returns complete markdown; only the # outcome section is parsed.

- add internal/turn layout, render and output parsing
- write input.md/memory.md before a visit and output.md from the final
  message; inventory all turn files as stage artifacts
- accumulate completed turns and system-written public file additions in
  memory, including across retries and resume
- remove the JSON envelope, strict field validation, line format and the
  repair ladder for model stages
- republish pipeline authoring prompts and docs in the new style

Checks: go build ./..., go vet ./..., go test -count=1 ./..., gofmt -l .
2026-10-19 22:27:44 +01:00
alan 72aecd8b1f Remove resource pools, leases and wait queues
Drop the resource allocation feature end to end: store tables and migration, runner scheduling and cleanup, protocol types and commands, CLI commands, TUI screens, tests and docs. Existing databases open cleanly and definitions carrying a retired resources block still validate.
2026-10-19 22:27:27 +01:00
alan 2fe63012f9 chat: a verification chat can never appear in the operator's list
The operator's chat list showed ~99 stray "New chat" entries. The listing
was already fail-closed (registry-only); the fault was what got recorded: an
automated UI check drives the real page, so its throwaway chat was recorded as
an operator chat exactly like a manually created one and stayed in the list for
ever (each run added one).

Server: chat_create takes an optional ephemeral flag. The session is created,
bootstrapped, usable, closable and reopenable exactly like any other, but its
registry row is hidden, so chat_sessions never lists it. operator_sessions gains
an ephemeral column (idempotent migration, existing rows default to listed) and
the list query filters it; the single-row lookup does not, so close/reopen keep
working. RecordVerificationSession is the hidden recorder.

Web: the page marks a create ephemeral only when automation asks for it
(__pipelinesEphemeralChat, set by the UI smoke for its throwaway chat), so the
smoke's own runs stop polluting while a manual create is unchanged.

Tests: a hidden row is never listed yet is still looked up and closable; a
normal re-record of the same id lists it again; a pre-ephemeral database
migrates with every existing chat still listed. Live data pruned separately
(107 -> 8 registry rows, backed up).
2026-10-19 13:15:08 +01:00
alan 63cae54fb4 Merge branch 'main' into chat-cross-client-echo-order 2026-10-19 00:08:33 +01:00
alan 7da3d54013 chat: reconcile history by canonical message identity 2026-10-19 00:08:30 +01:00
alan 89a2bf1e01 Add operator resource pool configuration commands 2026-10-18 23:37:46 +01:00
alan 3187b0c06e Merge branch 'main' into chat-cross-client-echo-order 2026-10-18 23:28:54 +01:00
alan a022b58c5c Wire pool resource targets through runner and repair quarantined-member handoff 2026-10-18 23:20:55 +01:00
alan a4c7149060 Merge branch 'main' into android-target-pool-allocation 2026-10-18 22:10:47 +01:00
alan 4de7cfbfe4 feat: retry selected stage with input overrides 2026-10-18 21:49:37 +01:00
alan 980f52bd85 Merge branch 'main' into chat-cross-client-echo-order 2026-10-18 21:46:00 +01:00
alan 36d1c8ea7a chat: preserve cross-client reconciliation work 2026-10-18 21:45:56 +01:00
alan 112e94baee feat: add pooled resource allocation contract 2026-10-18 21:11:24 +01:00
alan a8499bb57f Merge branch 'main' into retry-from-failed-stage 2026-10-18 20:38:06 +01:00
alan b8beeb250b feat: resume retries from failed stage 2026-10-18 20:38:03 +01:00
alan a1cb85a25b Merge branch 'main' into background-task-output-api 2026-10-18 20:23:48 +01:00